Find maximum value of $f(x)=2\cos 2x + 4 \sin x$ where $0 < x <\pi$ Find the maximum value of $f(x)$ where 
\begin{equation}
 f(x)=2\cos 2x + 4 \sin x \ \
 \text{for} \ \ 0<x<\pi
\end{equation}

We can utilize algebra to avoid calculus as follows 
$$f(x)=2\cos2x+4\sin x$$
$$=2(1-2\sin^2x)+4\sin x$$
$$=2-(4\sin^2x-4\sin x)$$
$$=2-(2\sin x-1)^2+1\le 3$$ as for real $x,(2\sin x-1)^2\ge 0$
the equality occurs if $2\sin x-1=0\iff \sin x=\frac12\implies x=n\pi+(-1)^n\frac\pi6$
For $0<x<\pi, x=\frac\pi6$ or $\pi-\frac\pi6$
