>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
 A: Hint: Use 
$$\sin^2 x +4\sin x+5 = (\sin x +2)^2 +1$$ 
and 
$$2\sin^2 x +8 \sin x +8 = 2\left(\sin x + 2 \right)^2.$$
Also, break the fraction into two pieces
$$\dfrac{(\sin x +2)^2 +1}{2\left(\sin x + 2 \right)^2}=\dfrac{1}{2}+\dfrac{1}{2}\dfrac{1}{\left(\sin x + 2 \right)^2}$$
A: You can simplify the expression as
$$\frac12+\frac1{2(\sin x+2)^2}$$ and the extreme values are
$$\frac12+\frac1{2\cdot3^2},\\\frac12+\frac1{2\cdot1^2}.$$
A: 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.
A: MrYouMath has already provided a good answer.
This answer uses your method.
You already have a quadratic equation on $t$
$$(2y-1)t^2+4(2y-1)t+(8y-5)=0\tag1$$
where $y\not=\frac 12$.
Note here that we want to find $y$ such that $(1)$ has at least one real solution $t$ satisfying $-1\le t\le 1$. 
It seems that you've missed the condition $-1\le t\le 1$.
Let $f(t)$ be the LHS of $(1)$.
Then, since the vertex of the parabola $Y=f(t)$ is on $t=-2$, we have
$$f(-1)f(1)\le 0,$$
i.e.
$$\frac 59\le y\le 1$$
A: Let $t=sin(x)$, $$y=\frac{t^2+4t+5}{2t^2+8t+8}=\frac {1}{2}[1+ \frac {1}{(t+2)^2}]$$
Note that $$-1\le t \le 1$$ Thus $$ 1\le y \le5/9$$ 
