<s>[INST] If $ f(x) = \frac{\sin^2 x+\sin x-1}{\sin^2 x-\sin x+2},$ then value of $f(x)$ lies in the interval If $\displaystyle f(x) = \frac{\sin^2 x+\sin x-1}{\sin^2 x-\sin x+2},$ then value of $f(x)$ lies in the interval
assume $\sin x= t$ where $|\sin x|\leq 1$
let $\displaystyle y = \frac{t^2+t-1}{t^2-t+1}$
$\displaystyle yt^2-yt+y=t^2+t-1$
$(y-1)t^2-(y+1)t+(y-1)=0$
for real roots $(y+1)^2-4(y-1)^2\geq 0$ or $(y+1)^2-(2y-2)^2\geq0$
$(3y-3)(3y-1)\leq 0$ or $\displaystyle \frac{1}{3}\leq y\leq 1$ 
but walframalpha shows different answer
https://www.wolframalpha.com/input/?i=range+of+f(x)+%3D+%5Cfrac%7B%5Csin%5E2+x%2B%5Csin+x-1%7D%7B%5Csin%5E2+x-%5Csin+x%2B2%7D
could some help me with this, thanks
 [/INST] Where DeepSea has left off,  let $2t-3=-u\implies1\le u\le5$
As $u>0,$
$$y=1-\dfrac{4u}{u^2-4u+11}=1-\dfrac4{u+\dfrac{11}u-4}$$
Now $u+\dfrac{11}u=\left(\sqrt u-\sqrt{\dfrac{11}u}\right)^2+2\sqrt{11}\ge2\sqrt{11}$
$\implies\dfrac1{u+\dfrac{11}u-4}\le\dfrac1{2\sqrt{11}-4}=\dfrac{2\sqrt{11}+4}{44-4^2}=\dfrac{\sqrt{11}+2}{14}$
$\implies y=1-\dfrac4{u+\dfrac{11}u-4}\ge1-\dfrac{4(\sqrt{11}+2)}{14}$
Again with $1\le u\le5,$ clearly, $\dfrac u{u^2-4u+11}=\dfrac u{7+(u-2)^2}>0$
Trying to prove $\dfrac u{u^2-4u+11}\ge\dfrac18$
</s>