<s>[INST] Range of $\sin^2x-\sin x +1$ How can we find the range of $f(x) =\sin^2x-\sin x +1$? 
The function can be written as $(\sin x-\frac{1}{2})^2+\frac{3}{4}$.
Range of $\sin x$ function is given by : $-1 \leq \sin x \leq 1$.  Please guide how to get the result.
 [/INST] The function $\ (\sin x-\frac{1}{2})^2+\frac{3}{4}\ $ is continous and bounded. 
Let's take a look at the extrema. These lie at the points where the derivative $\ 2\cos x\cdot(\sin x-\frac{1}{2})\ $ vanishes. So
$\sin x-\frac{1}{2}=0\ \ \ \ \ \ \text{or}\ \ \ \ \ \ \cos x=0\ \rightarrow\ \sin x=\pm1.$
Hence the extrema take the values $\ 0^2+\frac{3}{4}=\frac{3}{4}\ $ and $\ ((-1) -\frac{1}{2})^2+\frac{3}{4}=3$.
</s>