<s>[INST] How do I find the maximum and minimum values of $1−4\cos(2\theta)+3\sin(2\theta)$? To find the maximum of $$1 - 4\cos(2\theta) + 3\sin(2\theta) $$I tried:
$$1-4(1)+3(1)=0.$$
To find the minimum I tried to substitute with the minimum values of sin and cos:
$$1-4(-1)+3(-1)=2$$
I know I'm wrong, could someone explain why? And how I should go around obtaining the correct answer?
Thanks
 [/INST] Following is an algebraic way of finding the range of  $
As $\cos2\theta=\frac{1-\tan^2\theta}{1+\tan^2\theta}$ and $\sin2\theta=\frac{2\tan\theta}{1+\tan^2\theta}$
So, $1-4\cos2\theta+3\sin2\theta=\frac{(1+t^2)-4(1-t^2)+3(2t)}{1+t^2}=y$(say) putting $t=\tan\theta$
So, $t^2(y-5)-6t+y+3=0$
This is a Quadratic Equation in $t=\tan\theta$ 
As $\theta$ is real, so will be $t,$ hence the discriminant $(-6)^2-4(y-5)(y+3)\ge0$
$\implies y^2-2y-24\le0$
(i)$\implies  (y-6)(y+4)\le 0\implies$ either $(y\le 6, y\ge -4\implies -4\le y\le 6)$ or $(y\le -4,y\ge 6)$ which is impossible
(ii)$\implies (y-1)^2\le 25=5^2\implies -5\le y-1\le 5\implies -4\le y\le 6$
</s>