Solve trigonometric equation: $1 = m \; \text{cos}(\alpha) + \text{sin}(\alpha)$ Dealing with a physics Problem I get the following equation to solve for $\alpha$
$1 = m \; \text{cos}(\alpha) + \text{sin}(\alpha)$
Putting this in Mathematica gives the result:
$a==2 \text{ArcTan}\left[\frac{1-m}{1+m}\right]$
However I am unable to get this result myself. No matter what I try normal equation transformations or rewriting the equation with the complex e-Function ..., everything fails. Even going the other Direction from Mathematica's Solution to my original equation resulted in nothing sensible. 
Any help of how to do do this transformation is very much appreciated.
Thanks in advance
 A: So you have $1 = m\cos{\alpha} + \sin{\alpha}$. Now you have $1+m = m(\cos{\alpha}+1) + \sin\alpha$ and $1-m = m(\cos\alpha -1) + \sin{\alpha}$. So then you have $$\frac{1-m}{1+m} = \frac{m(\cos\alpha-1) + \sin\alpha}{m(\cos\alpha +1) + \sin\alpha} = \frac{-m \tan\frac{\alpha}{2} + 1}{m\cot\frac{\alpha}{2} + 1}$$ using the half angle formulae's. Then cross multiplying and solving you should be able to get the value of $\alpha$
A: Since we are adding different proofs, here is a geometric one, for the special case when $m > 0$ and $\alpha$ is acute.
We use the Law of Tangents which states, that in a triangle

the identity
$$ \frac{a-b}{a+b} = \frac{\tan\frac{\alpha - \beta}{2}}{\tan\frac{\alpha+\beta}{2}}$$
holds.
Now consider the below triangle 

We have $\displaystyle \angle{BCA} = \alpha$, $\displaystyle  \angle{CBA} = \pi/2$ and $\displaystyle \angle{CAB} = \pi/2 - \alpha$.
ABC is a right angled triangle with $\displaystyle AC = 1 = m\cos\alpha + \sin \alpha$. Point $\displaystyle D$ is chosen on $\displaystyle AC$ such that $\displaystyle AD = \sin \alpha$ and so $\displaystyle DC = m\cos \alpha$. We also have $\displaystyle BC = \cos \alpha$ and $AB = \sin \alpha$.
Now $\displaystyle AD = \sin \alpha = AB$ and so $\triangle ABD$ is isoceles and hence $\displaystyle \angle{ABD}  = \angle{ADB} = \pi/4 + \alpha/2$.
Thus we have that
$\displaystyle x = \angle{CDB} = 3\pi/4 - \alpha/2$ and $\displaystyle  y = \angle{CBD} = \pi/4-\alpha/2$
Now apply the law of tangents to $\displaystyle \triangle BCD$.
We get
$$\frac{\cos \alpha - m\cos\alpha}{\cos\alpha + m\cos\alpha} = \frac{\tan (x/2 - y/2)}{\tan(x/2 + y/2)}$$
$$ = \frac{\tan(\pi/4)}{\tan(\pi/2 - \alpha/2)} = \tan(\alpha/2)$$
Thus
$$\frac{1-m}{1+m} = \tan(\alpha/2)$$
A: Yet another approach, which is very specific to this problem:
$$
\begin{eqnarray}
1 - \sin\alpha &=& m \cos\alpha \\
\left( 1 - \sin\alpha \right)^2 &=& m^2 \cos^2\alpha \\
\left( 1 - \sin\alpha \right)^2 &=& m^2 ( 1 - \sin\alpha )( 1 + \sin\alpha ) \\
\left( 1 - \sin\alpha \right)\left((1 - \sin\alpha ) - m^2(1+\sin\alpha)\right) &=& 0 \\
\left( 1 - \sin\alpha \right)\left( (1-m^2) - ( 1 + m^2 )\sin\alpha \right) &=& 0
\end{eqnarray}
$$
So, $\sin\alpha=1$ or $\sin\alpha=\frac{1-m^2}{1+m^2}$.
Note that, if $\sin\alpha=1$, then your original equation reduces to the $m$-less tautology, "$0=0$".
In the second case, a little manipulation shows relations between $m$ and other trig functions of $\alpha$. For instance, you could substitute back into your original equation to get
$$1 = m\cos\alpha + \frac{1-m^2}{1+m^2} \;\;\; \Longrightarrow \;\;\; \cos\alpha=\frac{2m}{1+m^2}$$
from which you can get
$$\tan\alpha = \frac{\sin\alpha}{\cos\alpha} = \frac{1-m^2}{2m}$$
and
$$\tan\frac{\alpha}{2}=\frac{1-\cos\alpha}{\sin\alpha} = \frac{(1-m)^2}{1-m^2}=\frac{1-m}{1+m}$$
whichever you prefer.
A: Because you're familiar with complex exponentials, all you needed to succeed is to observe that by setting $w = m - i$ your equation becomes
$$w \exp(i \alpha) + \bar{w} \exp(-i \alpha) = 2.$$
(Edit What might motivate this choice of $w$?  Well, if you're thinking of complex numbers you're thinking that $\cos(\alpha) + i \sin(\alpha) = \exp(i \alpha)$.  To obtain $m \cos(\alpha) + \sin(\alpha)$ from this you need to multiply $\cos(\alpha)$ by $m$ and $i \sin(\alpha)$ by $-i$.  Thus it's automatic to set out by computing
$$(m - i)(\cos(\alpha) + i \sin(\alpha)) = \left(m \cos(\alpha) + \sin(\alpha)\right) + \left(\text{real stuff}\right) i.$$
The real part of this expression is exactly what you need, whence the original equation reads
$$1 = \mathbb{Re}\left(w \exp(i \alpha))\right) = \frac{w \exp(i \alpha) + \overline{w \exp(i \alpha)}}{2} = \frac{w \exp(i \alpha) + \bar{w} \exp(-i \alpha)}{2}.$$
Multiply by 2 to clear the fraction.  End of edit)
Setting $z = \exp(i \alpha)$ to simplify the notation yields
$$w z^2 - 2 z + \bar{w} = 0,$$
with two generic solutions by the quadratic formula:
$$z = \frac{1 + \sqrt{1 - |w|^2}}{w}, \quad z = \frac{1 - \sqrt{1 - |w|^2}}{w}.$$
Because $\sqrt{1 - |w|^2} = \pm m i$, the solutions simplify to
$$z = \frac{i + m}{1 + m i}, \quad z = i.$$
(Once again we see a connection to fractional linear transformations, as per @Qiaochu Yuan's comment.)
By definition, $\alpha$ is the argument (polar coordinate) of a solution $z$.  Writing $\tan(\theta) = m$ (which defines $\theta$ up to an integral multiple of $\pi$), the argument of the denominator is $\theta$ while the argument of the numerator is equal to $\pi/2 - \theta$.  Whence
$$\alpha = \pi/2 - 2\theta \quad \text{or} \quad \alpha = \pi/2$$
(both modulo an integral multiple of $2 \pi$).
If you prefer, in the first case you may write
$$\alpha = \pi/2 - 2\arctan(m).$$
The second case obviously gives the trivial solutions $1 = m \cos(\pi/2 + 2 n \pi) + \sin(\pi/2 + 2 n \pi)$ $= m 0 + 1.$
The first solution appears to be a new one, but it's equivalent to the others that have been obtained.  As a check, we may assume $\theta$ is not an odd multiple of $\pi/2$, whence $\alpha$ is not an odd multiple of $\pi/2$, and compute
$$m \cos(\alpha) + \sin(\alpha)$$
$$ = \tan(\theta) \cos(\pi/2 - 2 \theta) + \sin(\pi/2 - 2\theta) = \tan(\theta) \sin(2 \theta) + \cos(2 \theta)$$
$$= \frac{\sin(\theta)}{\cos(\theta)}\left(2 \sin(\theta) \cos(\theta)\right) + \left(\cos(\theta)^2 - \sin(\theta)^2\right)$$
$$= \sin(\theta)^2 + \cos(\theta)^2 = 1.$$

Although for a problem like this I would ordinarily take the route described by @Robin Chapman, I like this complex number approach because it produces a simpler solution (which actually is defined for $m = -1$, btw) by means of straightforward techniques and it explicitly produces all solutions.  When $m \lt -1$ and we use the standard branch of the arctangent it differs by $2 \pi$ from the one Mathematica obtained, but that's of no consequence.  (It's curious that Mathematica cannot tell these two solutions are the same, even when you restrict the domain to real nonnegative $m$.  A plot of their difference will remove any lingering doubts.)
A: Another:
$$
\begin{eqnarray}
\frac{1-\sin\alpha}{\cos\alpha} &=& m \\
\frac{1-\cos\left(\frac{\pi}{2}-\alpha\right)}{\sin\left(\frac{\pi}{2}-\alpha\right)} &=&m \\
\tan\frac{\frac{\pi}{2}-\alpha}{2} = \tan\left(\frac{\pi}{4}-\frac{\alpha}{2}\right) &=& m \\
\frac{\tan\frac{\pi}{4}-\tan\frac{\alpha}{2}}{1+\tan\frac{\pi}{4} \tan\frac{\alpha}{2}} = \frac{1-\tan\frac{\alpha}{2}}{1+\tan\frac{\alpha}{2}} &=& m \\
\Longrightarrow \tan\frac{\alpha}{2} &=& \frac{1-m}{1+m}
\end{eqnarray}
$$
A: Added: As explained in the comments, certain trigonometric equations such as the linear equations in $\sin x$ and $\cos x$ can be solved by a resolvent quadratic equation. One method is to write the $\sin x$ and $\cos x$ functions in terms of the same trigonometric function. Since all [direct] trigonometric functions of the simple angle can be expressed rationally as a function of the $\tan$ of the half-angle, such a conversion is adequate for these equations.

Since $$\cos \alpha =\frac{1-\tan ^{2}\frac{\alpha }{2}}{1+\tan ^{2}\frac{%
\alpha }{2}}$$
and 
$$\sin \alpha =\frac{2\tan \frac{\alpha }{2}}{1+\tan ^{2}%
\frac{\alpha }{2}}$$
your equation 
$$m\cos \alpha +\sin \alpha =1$$
is equivalent to 
$$m-m\tan ^{2}\frac{\alpha }{2}+2\tan \frac{\alpha }{2}=1+\tan ^{2}\frac{\alpha }{2}.$$
One may set $x=\tan \frac{\alpha }{2}$ ($\alpha =2\arctan x$), and thus get
the quadratic equation
$$\left( 1+m\right) x^{2}-2x+1-m=0.$$ 
Its solutions are: $x=\frac{1}{m+1}\left( -m+1\right) $ (if $m\neq -1$) or $%
x=1$ (if $m=-1$), which gives 
i) If $m\neq -1$, 
$$\alpha =2\arctan x=2\arctan \frac{1-m}{m+1},$$
ii) If $m=-1,$
$$\alpha =2\arctan 1=\frac{\pi }{2}.$$
A different technique to solve a linear equation in $\sin \alpha $ and $\cos
\alpha $ is to use an auxiliary angle $\varphi $. If you set $m=\tan \varphi 
$, your equation takes the form
$$\sin \alpha +\tan \varphi \cdot \cos \alpha =1$$ 
or
$$\sin (\alpha +\varphi )=\cos \varphi =\frac{1}{\pm \sqrt{1+\tan ^{2}\varphi 
}}=\pm \sqrt{\frac{1}{1+m^{2}}},$$
and obtain 
$$\alpha =\pm \arcsin \sqrt{\frac{1}{1+m^{2}}}-\arctan m.$$

Detailed derivation: from $m\cos \alpha +\sin \alpha =1$ and $m=\tan \varphi 
$, we get
$$\sin \alpha +\tan \varphi \cdot \cos \alpha =1\iff\sin \alpha +\dfrac{\sin \varphi }{\cos \varphi }\cdot \cos \alpha =1$$
$$\iff\dfrac{\sin \alpha \cdot \cos \varphi +\sin \varphi \cdot \cos \alpha }{\cos
\varphi }=1\iff\dfrac{\sin \left( \alpha +\varphi \right) }{\cos \varphi }=1$$
$$\iff\sin \left( \alpha +\varphi \right) =\cos \varphi .$$
The identity
$$\cos \varphi =\pm \sqrt{\dfrac{1}{1+\tan ^{2}\varphi }}$$ 
can be obtained as follows
$$\sin ^{2}\varphi +\cos ^{2}\varphi =1\iff\dfrac{\sin ^{2}\varphi }{\cos ^{2}\varphi }+1=\dfrac{1}{\cos ^{2}\varphi }$$
$$\iff\tan ^{2}\varphi +1=\dfrac{1}{\cos ^{2}\varphi }\iff\cos ^{2}\varphi =\dfrac{1}{1+\tan ^{2}\varphi }.$$
Therefore
$$\sin \left( \alpha +\varphi \right) =\pm \sqrt{\dfrac{1}{1+\tan ^{2}\varphi }}\iff\alpha +\varphi =\arcsin \left( \pm \sqrt{\dfrac{1}{1+\tan ^{2}\varphi }}\right) $$
$$\iff\alpha +\arctan m=\arcsin \left( \pm \sqrt{\dfrac{1}{1+m^{2}}}\right) \qquad (m=\tan \varphi,\ \varphi =\arctan m)$$
and finally
$$\alpha =\arcsin \left( \pm \sqrt{\dfrac{1}{1+m^{2}}}\right) -\arctan m.$$
A: Consider the equation
$$a\cos t+b\sin t=c$$
as an equation for $t$. Here $a$ and $b$ are real numbers, not both zero.
The trick to solve this is to divide by $\sqrt{a^2+b^2}$ to get
$$\frac{a}{\sqrt{a^2+b^2}}\cos t+\frac{b}{\sqrt{a^2+b^2}}\sin t
=\frac{c}{\sqrt{a^2+b^2}},$$
equivalently
$$a'\cos t+b'\sin t=c'$$
where now $a'^2+b'^2=1$. This means that $(a',b')$ lies on the unit circle.
There is then an angle $u$ so that $(a',b')=(\cos u,\sin u)$.
The equation becomes
$$\cos u\cos t+\sin u\sin t=c',$$
that is
$$\cos(t-u)=c'.$$
We see there is a solution for $t$ iff $|c'|\le1$. In general when $|c'|<1$
there are exactly two solutions for $t$ modulo $2\pi$.
(All of this is standard A-level maths.)
