Find all values that solve the equation For which values a, the equation
$$ a\sin{x}+(a+1)\sin^2{\frac{x}{2}} + (a-1)\cos^2{\frac{x}{2}} =1 $$
has a solution?
My idea: I think it's possible to factorize equation or reduce equation to the form like: $a(\sin^2{\frac{x}{2}} + \cos^2{\frac{x}{2}}) =1 $
Let's go:
$$ 2a\sin{\frac{x}{2}}\cos{\frac{x}{2}} + asin^2{\frac{x}{2}} + sin^2{\frac{x}{2}} + a\cos^2{\frac{x}{2}} - \cos^2{\frac{x}{2}} = 1$$
$$ a\left(sin{\frac{x}{2}}+\cos{\frac{x}{2}}\right)^2 = 1 - \sin^2{\frac{x}{2}} + \cos^2{\frac{x}{2}}$$
$$ a\left(\sin{\frac{x}{2}}+\cos{\frac{x}{2}}\right)^2 =2\cos^2{\frac{x}{2}}$$
I can't finish...

HINT....The equation simplifies to $ a\sin x +a- \cos x=1$ can you take it from there?
