Finding the Range of a Trigonometric function The range of $$f(x)=3\cos^2x-8\sqrt3 \cos x\cdot\sin x+5\sin^2x-7$$is given by:(1)$[-7,7]$(2)$[-10,4]$(3)$[-4,4]$(4)$[-10,7]$
ANS: (2)
My Solution
The equation can be written as: $$3\cos^2x-8\sqrt3 \cos x\cdot \sin x+16\sin^2x-11\sin^2x-7 \\\implies (\sqrt3\cos x-4\sin x)^2-11\sin^2x-7$$
So let $y=\sqrt3\cos x+4\sin x$
$$-\sqrt{(\sqrt3)^2+4^2} \le y\le \sqrt{(\sqrt3)^2+4^2} \implies 19 \le y^2 \le 19 \implies y^2\in[0,19]$$
CASE 1: When $y^2=0$
$$f(x)=0-11\sin^2x-7 \text{ ,taking } \sin^2 x=0\text{,  minimum value of }f(x)= -7$$
CASE 2: When $y^2=19$
$$f(x)=19-11\sin^2x-7 \text{ ,taking } \sin^2 x=1\text{,  minimum value of }f(x)= 1$$
So my range is $y\in[-7, 1]$
where is the problem?

Let's do this.
\begin{align}
f(x)&=3\cos^2 x−8\sqrt3 \cos x\sin x + 5\sin^2x−7 =\\
&= 3(\cos^2x + \sin^2 x) - 4\sqrt3\cdot 2\sin x\cos x + 2\sin^2 x - 7=\\
&=3 - 4\sqrt 3\sin 2x + 2\sin^2 x - 7 = \\
&=-4 -4\sqrt 3\sin 2x + 1 - \cos 2x=\\
&=-\cos2x -4\sqrt 3\sin 2x-3.
\end{align}
Now we have
$$1\cdot\cos2x +4\sqrt 3\cdot\sin 2x = \sqrt{1^2 + (4\sqrt 3)^2}\sin(2x+\varphi)=7\sin(2x+\varphi),$$
where $\sin\varphi=1/7$, $\cos\varphi=4\sqrt3/7$. So you have
$$f(x)=-7\sin(2x+\varphi)-3,$$
and range is $[-7-3,7-3] = [-10, 4]$.
