Solve $\cos(\theta) + \sin(\theta) = x$ for known $x$, unknown $\theta$? After looking at the list of trigonometric identities, I can't seem to find a way to solve this. Is it solvable?
$$\cos(\theta) + \sin(\theta) = x.$$
What if I added another equation to the problem:
$$-\sin(\theta) + \cos(\theta) = y,$$
where $\theta$ is the same and $y$ is also known?
Thanks.
EDIT: 
OK, so using the linear combinations I was able to whip out:
$$a \sin(\theta) + b \cos(\theta) = x = \sqrt{a^2 + b^2} \sin(\theta + \phi),$$
where $\phi = \arcsin \left( \frac{b}{\sqrt{a^2 + b^2}} \right) = \frac{\pi}{4}$ (as long as $a\geq 0$)
Giving me:
$$x = \sin(\theta + \frac{\pi}{4}) \text{ and } \arcsin(x) - \frac{\pi}{4} = \theta.$$
All set! Thanks!

Linear equations in $\sin \theta $ and $\cos \theta $ can be solved by a
resolvent quadratic equation, using the two identities (also here):
$$\cos \theta =\frac{1-\tan ^{2}\frac{\theta }{2}}{1+\tan ^{2}\frac{\theta }{2%
}}$$
and
$$\sin \theta =\frac{2\tan \frac{\theta }{2}}{1+\tan ^{2}\frac{\theta }{2}}.$$
In this case, we have
$$\begin{eqnarray*}
\cos \theta +\sin \theta  &=&x \\
&\Leftrightarrow &\left( 1-\tan ^{2}\frac{\theta }{2}\right) +2\tan \frac{%
\theta }{2}=x\left( 1+\tan ^{2}\frac{\theta }{2}\right)  \\
&\Leftrightarrow &(x+1)\tan ^{2}\frac{\theta }{2}-2\tan \frac{\theta }{2}%
+x-1=0 \\
&\Leftrightarrow &\tan \frac{\theta }{2}=\frac{2\pm \sqrt{4-4(x+1)(x-1)}}{%
2(x+1)} \\
&\Leftrightarrow &\tan \frac{\theta }{2}=\frac{1\pm \sqrt{2-x^{2}}}{x+1} \\
&\Leftrightarrow &\theta =2\arctan \frac{1\pm \sqrt{2-x^{2}}}{x+1}.
\end{eqnarray*}$$
