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?
 A: This is a well-known problem: the maximum of $a\cos x+b\sin x$ is
$\sqrt{a^2+b^2}$. One way to see this is to use Cauchy-Schwarz:
$$a\cos x+b\sin x\le\sqrt{a^2+b^2}\sqrt{\cos^2x+\sin^2x}=\sqrt{a^2+b^2}$$
and then get equality by finding an $x$ with $\cos x=a/\sqrt{a^2+b^2}$
and $\sin x=b/\sqrt{a^2+b^2}$.
A: 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.
A: With $\tan t=\dfrac43$ then $\cos t=\dfrac{1}{\sqrt{1+(\dfrac43)^2}}=\dfrac35$ so
\begin{align}
3\cos{2x}+4\sin{2x}
&=3(\cos{2x}+\tan t\sin{2x})\\
&=\dfrac{3}{\cos t}(\cos t\cos{2x}+\sin t\sin{2x})\\
&=\dfrac{3}{\cos t}\cos(t-2x)\\
&=5\cos(t-2x)\\
&\leqslant5
\end{align}
A: Your idea holds only if it is $$a \cos wx + b \sin wx$$  & $$a=b$$
As here a is not equal to b. And also that $a \lt b$.A greater $\sin x$ will be preferable for the max.
Therefore your max is different than actual.
         But you can always use differentiation, or the identity 
$$- \sqrt {a^2 + b^2} \lt a \cos x + b \sin x \lt \sqrt {a^2+b^2}$$
