Solving trigonometric equations of the form $a\sin x + b\cos x = c$
Suppose that there is a trigonometric equation of the form $a\sin x + b\cos x = c$, where $a,b,c$ are real and $0 < x < 2\pi$. An example equation would go the following: $\sqrt{3}\sin x + \cos x = 2$ where $0<x<2\pi$.
How do you solve this equation without using the method that moves $b\cos x$ to the right side and squaring left and right sides of the equation?
And how does solving $\sqrt{3}\sin x + \cos x = 2$ equal to solving $\sin (x+ \frac{\pi}{6}) = 1$
Solution 1:
The idea is to use the identity $\sin(\alpha+\beta)=\sin\alpha\cos\beta+\cos\alpha\sin\beta$. You have $a\sin x+b\cos x$, so you’d like to find an angle $\beta$ such that $\cos\beta=a$ and $\sin\beta=b$, for then you could write
$$a\sin x+b\cos x=\cos\beta\sin x+\sin\beta\cos x=\sin(x+\beta)\;.$$
The problem is that $\sin\beta$ and $\cos\beta$ must be between $-1$ and $1$, and $a$ and $b$ may not be in that range. Moreover, we know that $\sin^2\beta+\cos^2\beta$ must equal $1$, and there’s certainly no guarantee that $a^2+b^2=1$.
The trick is to scale everything by $\sqrt{a^2+b^2}$. Let $A=\dfrac{a}{\sqrt{a^2+b^2}}$ and $B=\dfrac{b}{\sqrt{a^2+b^2}}$; clearly $A^2+B^2=1$, so there is a unique angle $\beta$ such that $\cos\beta=A$, $\sin\beta=B$, and $0\le\beta<2\pi$. Then
$$\begin{align*} a\sin x+b\cos x&=\sqrt{a^2+b^2}(A\sin x+B\cos x)\\ &=\sqrt{a^2+b^2}(\cos\beta\sin x+\sin\beta\cos x)\\ &=\sqrt{a^2+b^2}\sin(x+\beta)\;. \end{align*}$$
If you originally wanted to solve the equation $a\sin x+b\cos x=c$, you can now reduce it to $$\sqrt{a^2+b^2}\sin(x+\beta)=c\;,$$ or $$\sin(x+\beta)=\frac{c}{\sqrt{a^2+b^2}}\;,$$ where the new constants $\sqrt{a^2+b^2}$ and $\beta$ can be computed from the given constants $a$ and $b$.
Solution 2:
Using complex numbers, and setting $z=e^{i\theta}$,
$$a\frac{z-z^{-1}}{2i}+b\frac{z+z^{-1}}2=c,$$ or
$$(b-ia)z^2-2cz+(b+ia)=0.$$
The discriminant is $c^2-b^2-a^2:=-d^2$, assumed negative, then the solution
$$z=\frac{c\pm id}{b-ia}.$$
Taking the logarithm, the real part $$\ln\left(\dfrac{\sqrt{c^2+d^2}}{\sqrt{a^2+b^2}}\right)=\ln\left(\dfrac{\sqrt{c^2+a^2+b^2-c^2}}{\sqrt{a^2+b^2}}\right)=\ln(1)$$ vanishes as expected, and the argument is
$$\theta=\pm\arctan\left(\frac dc\right)+\arctan\left(\frac ab\right).$$
The latter formula can be rewritten with a single $\arctan$, using
$$\theta=\arctan\left(\tan(\theta)\right)=\arctan\left(\frac{\pm\dfrac dc+\dfrac ab}{1\mp\dfrac dc\dfrac ab}\right)=\arctan\left(\frac{\pm bd+ac}{bc\mp ad}\right).$$