Max and min of $f(x)=\sin^2{x}+\cos{x}+2$. My first try was to look for when $\cos{x}$ and $\sin{x}$ attain their min and max respectively, which is easy using the unit circle. So the minimum of $\sin{x}+\cos{x}$ has maximum at $\sqrt{2}$ and minimum at $-\sqrt{2}.$ But if the sine-term is squared, how do I find the minimum of $\sin^2{x}+\cos{x}$?
I then tried the differentiation method:
$$f'(x)=2\sin{x}\cos{x}-\sin{x}=(2\cos{x}-1)\sin{x}=0,$$
which in the interval $(0,2\pi)$, gave me the the roots $\left(\frac{\pi}{2},\frac{3\pi}{2},\frac{\pi}{3},\frac{5\pi}{3}\right)$. So
$$f(\pi/2)=3, \quad f(3\pi/2)=3, \quad f(\pi/3)=\frac{13}{4}, \quad f(5\pi/3)=\frac{13}{4}.$$
So $f_{\text{max}}=\frac{13}{4}$ and $f_{\text{min}}=3.$ But the minimum should be $1$.

HINT: write $f(x)$ as
$$f(x)=1-\cos(x)^2+\cos(x)+2 \\=-\cos(x)^2+\cos(x)+3\\=-\left(\cos(x)^2-\cos(x)+\frac{1}{4}\right)+\frac{13}{4}\\=-\left(\cos(x)-\frac{1}{2}\right)^2+\frac{13}{4}$$
