How to solve $a = \cos x - b\sin x$ where $a$ and $b$ are real numbers? I found this equation when solving a physics problem related to finding an angle when entering a river, that has a known current, and trying to get to a specific point on the other side.  I'm not sure how to solve this equation explicitly for the angle $x$.

Method 1:


*

*$a=\cos x - b\sin x$

*$\cos x = a+b\sin x$

*$\cos^2x = a^2+2ab\sin x+b^2\sin^2x$

*$1-\sin^2x = a^2+2ab\sin x+b^2\sin^2x$

*$(a^2-1)+2ab\sin x+(b^2+1)\sin^2x=0$


Then quadratic.

Method 2:
$$\sin(\alpha-x)=\sin\alpha\cos x-\cos\alpha\sin x$$
$$\frac{\sin(\alpha-x)}{\sin\alpha}=\cos x-\frac1{\tan\alpha}\sin x$$
Let $\frac1{\tan\alpha}=b$, then $\frac1{\sin\alpha}=\sqrt{b^2+1}$.
The equation becomes:


*

*$a=\sqrt{b^2+1}\sin(\alpha-x)$

*$\sin(\alpha-x)=\dfrac{a}{\sqrt{b^2+1}}$

