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


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


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


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.


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$