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...

Note that your equation reduces to
\begin{align}
1
&= a\sin{x}+(a+1)\sin^2{\frac{x}{2}} + (a-1)\cos^2{\frac{x}{2}} \\
&= a \sin x +a \left(\sin^2{\frac{x}{2}} + \cos^2{\frac{x}{2}}\right) +
\sin^2{\frac{x}{2}}- \cos^2{\frac{x}{2}} \\
&= a \sin x +a + \sin^2{\frac{x}{2}}- \cos^2{\frac{x}{2}} \\
&= a \sin x +a - \cos(x) \\
\end{align}
And this could be rewritten as
$$
\frac{1 + \cos x}{1 + \sin x} = a 
$$
for $\sin x \ne -1$ or 
$$
\cos x = -1 
$$
for $\sin x = -1$ which can not happen.
So we assume $\sin x \ne -1$.
