Function range problem $(sin^2\theta  +\sin\theta -1)/(sin^2\theta -\sin\theta+ 2)$ .
It is asked to find the range of this function.
Here i was assumed a variable 
$z=sin\theta$ so that i get
$-1<=z<=1 $
and then i obtained a quadratic equation as :-
$(y-1)z^2 -(y+1)z + 2y +1 =0$  from here i need some help or if there's some other way for this  problem that might also help. Thanks!

Since $z^2 - z + 2 = (z - 1/2)^2 + 7/4$, the given function's domain is $\mathbb{R}$.
$$f(z) = \frac{z^2 + z - 1}{z^2 - z + 2} = 1 + \frac{2z- 3}{z^2 - z + 2}$$
Let us differentiate the function.
$$f'(z) = \frac{(2z - 3)' (z^2 - z + 2) - (2z - 3) (z^2 - z + 2)'}{(z^2 - z + 2)^2} \\= \frac{2z^2 - 2z + 4 - (2z - 3)(2z - 1)}{\text{A positive number}} = - \frac{2z^2 - 6z - 1}{\text{A positive number}}$$
What can you talk about the shape of $f(z)$? When $f(z)$ has local maximum/minimum?
