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$

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