Find maximum of $f(x)=3\cos{2x}+4\sin{2x}.$ Find maximum of $f(x)=3\cos{2x}+4\sin{2x}.$ The shortest way to do this is to only consider $2x\in[0,2\pi)$, set $t=2x$ and note that


*

*Max$(\cos{t})=1$ for $t=0.$

*Max$(\sin{t})=1$ for $t=\frac{\pi}{2}.$


Max of these two functions added is when $t$ equals the angle exactly in the middle of $[0,\pi/2]$, which is $t=\pi/4.$ For this $t$ we have that $\cos{\pi/4}=\sin{\pi/4}=\sqrt{2}/2.$ So; $$f\left(\frac{\pi}{4}\right)=3\frac{\sqrt{2}}{2}+4\frac{\sqrt{2}}{2}=\frac{7\sqrt{2}}{2}.$$
Correct answer: $5$. My answer is slightly less than $5$. Why?

We can express $3\cos 2x + 4\sin 2x$ in the form $R\cos(2x-\alpha)$, where $R>0$ and $\alpha$ is acute.
Use the identity $\cos(A-B)  = \cos A \cos B + \sin A \sin B$ to find the values of $R$ and $\alpha$.
\begin{eqnarray*}
R\cos(2x-\alpha) &=& R(\cos 2x\cos\alpha + \sin 2x\sin \alpha) \\ \\
&=& (R\cos\alpha)\cos 2x + (R\sin\alpha)\sin 2x
\end{eqnarray*}
We need $R\cos\alpha = 3$ and $R \sin \alpha  = 4$, i.e. $\cos\alpha = \frac{3}{R}$ and $\sin\alpha = \frac{4}{R}$. So we can draw a right-angled triangle with angle $\alpha$, hypotenuse $R$, opposite $4$ and adjacent $3$.
Pythagoras tells us that $R = \sqrt{3^2+4^2} = 5$ and $\alpha = \arctan\frac{4}{3}$. Meaning that
$$3\cos 2x + 4\sin 2x \ \ \equiv \ \ 5\cos\left(2x-\arctan\tfrac{4}{3}\right)$$
Hence $-5$ and $+5$ are the minimum and maximum respectively.
