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

This is an answer without using derivative.
As you did, let $t=\sin x$. 
First of all, we have $y\not=1$ since for $y=1$ we get $t=\frac 32\gt 1$.
Since $y\not=1$, we have
$$\begin{align}y=\frac{t^2+t-1}{t^2-t+2}&\iff  (y-1)t^2+(-y-1)t+2y+1=0\\&\iff t^2+\frac{-y-1}{y-1}t+\frac{2y+1}{y-1}=0\\&\iff \left(t-\frac{y+1}{2y-2}\right)^2+\frac{7y^2-6y-5}{4(y-1)^2}=0\tag1\end{align}$$
Let $g(t)$ be the LHS of $(1)$.
Note that we want to find the condition on $y$ such that $g(t)=0$ has at least one real solution satisfying $-1\le t\le 1$.
Here, $Y=g(t)$ is a parabola whose vertex is $(\alpha,\beta)$ where $\alpha=\frac{y+1}{2y-2},\beta=\frac{7y^2-6y-5}{4(y-1)^2}$.
Case 1 : When $\alpha\lt -1$, we have to have $\beta\lt 0$ and $g(-1)\le 0$ and $g(1)\ge 0$
In this case, we have $\frac 13\lt y\le \frac 12$.
Case 2 : When $\alpha=-1$, we have to have $\beta\le 0$ and $g(1)\ge 0$
In this case, we have $y=\frac 13$.
Case 3 : When $-1\lt\alpha\lt 1$, we have to have $\beta\le 0$ and "$g(-1)\ge 0$ or $g(1)\ge 0$"
In this case, we have $\frac{3-2\sqrt{11}}{7}\le y\lt\frac 13$.
Case 4 : When $\alpha=1$, we have to have $\beta\le 0$ and $g(-1)\ge 0$
There are no such $y$.
Case 5 : When $\alpha\gt 1$, we have to have $\beta\lt 0$ and $g(-1)\ge 0$ and $g(1)\le 0$
There are no such $y$.
Hence, the answer is
$$\color{red}{\frac{3-2\sqrt{11}}{7}\le y\le\frac 12}$$
