[Algebra]
Problem: If $f(x)=\sin ^{2} x-2 \sin x+2$, what are the minimum and maximum values of $f(x)$ ?

Solution: We rewrite by completing the square as $f(x)=\sin ^{2} x-2 \sin x+2=(\sin x-1)^{2}+1$.

Therefore, since $(\sin x-1)^{2} \geq 0$, then $f(x) \geq 1$, and in fact $f(x)=1$ when $\sin x=1$ (which occurs for instance when $x=90^{\circ}$ ).

Thus, the minimum value of $f(x)$ is 1 .

To maximize $f(x)$, we must maximize $(\sin x-1)^{2}$.

Since $-1 \leq \sin x \leq 1$, then $(\sin x-1)^{2}$ is maximized when $\sin x=-1$ (for instance, when $\left.x=270^{\circ}\right)$. In this case, $(\sin x-1)^{2}=4$, so $f(x)=5$.

Thus, the maximum value of $f(x)$ is 5 .

Final answer: 5,1