<s>[INST] >Finding range of $f(x)=\frac{\sin^2 x+4\sin x+5}{2\sin^2 x+8\sin x+8}$ 
Finding range of $$f(x)=\frac{\sin^2 x+4\sin x+5}{2\sin^2 x+8\sin x+8}$$

Try: put $\sin x=t$ and $-1\leq t\leq 1$
So $$y=\frac{t^2+4t+5}{2t^2+8t+8}$$
$$2yt^2+8yt+8y=t^2+4t+5$$
$$(2y-1)t^2+4(2y-1)t+(8y-5)=0$$
For real roots $D\geq 0$
So $$16(2y-1)^2-4(2y-1)(8y-5)\geq 0$$
$$4(2y-1)^2-(2y-1)(8y-5)\geq 0$$
$y\geq 0.5$
Could some help me where I have wrong, thanks
 [/INST] Let
$$g(t)=\frac{t^2+4t+5}{2t^2+8t+8}=\frac{1}{2}+\frac{1}{2t^2+8t+8},$$
then
$$
g'(t)=-\frac{2(2t^2+8t+8)(4t+8)}{(2t^2+8t+8)^2}=-\frac{1}{(t+2)^3}.
$$
Thus $g$ strictly decreases in the interval $[-1,1]$, and $g(-1)$ and $g(1)$ are maximum and minimum respectively.
</s>