\(3cos4x+\left(cos2x-sinx\right)^2\)
\(=3cos4x+\left(\left|cos2x-sinx\right|\right)^2\)
\(\le3cos4x+\left[\left|cos2x\right|+\left|sin\left(-x\right)\right|\right]^2\)
\(\le3cos4x+2\left(cos^22x+sin^2x\right)\)
\(=8cos^22x+2sin^2x-3\)
\(=8cos^22x-cos2x-2\le7\)
Đẳng thức xảy ra khi \(\left\{{}\begin{matrix}cos2x=-1\\cos2x.sin\left(-x\right)\ge0\\cos2x=sin\left(-x\right)\end{matrix}\right.\Leftrightarrow x=\dfrac{\pi}{2}+k\pi\)