Find all values of $a$ for which the image of the function
$$y=\frac{\sqrt{a}-2\cos x+1}{\sin^2x+a+2\sqrt{a}+1}$$
contains $[2, 3]$.
Now, I've already transformed it to
$$y=\frac{(\sqrt{a}+1)-2\cos x}{(\sqrt{a}+1)^2+1-\cos^2 x}$$
And in turn
$$y=\frac{b-2t}{b^2+1-t^2}, b=\sqrt{a}+1\ge 1, t\in[-1, 1]$$
However it is not clear what I should do next. Is there some elegant solution I am missing?
The latter function is continuous on the interval. So that's enough to find all $b$'s such that $y$ take both of the values $2,3$. Now if $y$ take this two values, then takes all the values $[2,3]$ by the mean value theorem.