Solving $ \sin x + \sqrt 3 \cos x = 1 $ - is my solution correct? I have an equation that I'm trying to solve:
$$ \sin x + \sqrt 3 \cos x = 1 $$
After pondering for a while and trying different things out, this chain of steps is what I ended up with:
$$ \sin x + \sqrt 3 \cos x = 1 $$
$$ \sin x = 1 - \sqrt 3 \cos x $$
$$ \left(\sin x \right)^2 = \left(1- \sqrt 3 \cos x\right)^2 $$
$$ \sin^2 x = 1 - 2 \sqrt 3 \cos x + 3 \cos^2 x $$
$$ 2 \sqrt 3 \cos x - 3 \cos^2 x = 1 - \sin^2 x $$
$$ 2 \sqrt 3 \cos x - 3 \cos^2 x = \cos^2 x $$
$$ 2 \sqrt 3 \cos x = \cos^2 x + 3 \cos^2 x $$
$$ 4 \cos^2 x = 2 \sqrt 3 \cos x $$
$$ \frac{4 \cos^2 x}{\cos x} = 2 \sqrt 3 $$
$$ 4 \cos x = 2 \sqrt 3 $$
$$ \cos x = \frac{2 \sqrt 3}{4} $$
$$ \cos x = \frac{\sqrt 3}{2} $$
The fraction $ \frac{\sqrt 3}{2} $ can be rewritten as $ \cos \left(\pm \frac{\pi}{6}\right) $, so my solutions are:
$$ \cos x = \cos \left(\frac{\pi}{6}\right) \quad \text{or} \quad \cos x = \cos \left(-\frac{\pi}{6}\right) $$
$$ x = \frac{\pi}{6} + 2\pi n \quad \text{or} \quad x = -\frac{\pi}{6} + 2\pi n $$
Since I earlier on exponentiated both sides I have to check my solutions:
$$ x = \frac{\pi}{6} + 2\pi \Rightarrow \text{LHS} = \sin \left(\frac{\pi}{6} + 2\pi\right) + \sqrt 3 \cos \left(\frac{\pi}{6} + 2\pi\right) = 2 \not = \text{RHS} $$
$$ x = -\frac{\pi}{6} + 2\pi \Rightarrow \text{LHS} = \sin \left(-\frac{\pi}{6} + 2\pi\right) + \sqrt 3 \cos \left(-\frac{\pi}{6} + 2\pi\right) = 1 = \text{RHS} $$
Leaving $ x = -\frac{\pi}{6} + 2\pi n $ as the answer since its positive counterpart was not equal to $ 1 $.
$$ \text{Answer:} \: x = -\frac{\pi}{6} + 2\pi n $$
Have I done anything wrong or does this look good? I haven't really done this before so I feel uncertain not just about the solution, but also my steps and notation...

There is a standard method for solving equations of the form:
$$
A \sin x + B \cos x = C
$$
Divide both sides by $\sqrt{A^2 + B^2}$:
$$
\frac{A}{\sqrt{A^2 + B^2}} \sin x + \frac{B}{\sqrt{A^2 + B^2}} \cos x = \frac{C}{\sqrt{A^2 + B^2}}
$$
Find $\theta \in [0, 2\pi)$ so that:
$$
\sin \theta = \frac{B}{\sqrt{A^2 + B^2}} \\
\cos \theta = \frac{A}{\sqrt{A^2 + B^2}} \\
$$
And $\phi \in [-\frac{\pi}{2}, \frac{\pi}{2}]$ so that:
$$
\sin \phi = \frac{C}{\sqrt{A^2 + B^2}}
$$
If you cannot find such a $\phi$, then the equation doesn't have any solutions. (For example, if $\frac{C}{\sqrt{A^2 + B^2}} > 1$.
Thus:
$$
\cos \theta \sin x + \sin \theta \cos x = \sin \phi
$$
Using the angle sum identity, we have:
$$
\sin(x + \theta) = \sin \phi
$$
Therefore:
\begin{align*}
x_1 &= \phi - \theta + 2 \pi n \\
x_2 &= \pi - \phi - \theta + 2 \pi n
\end{align*}
(Where $n \in \mathbb{Z}$)

Now, let's apply this method to your question. We have:
$$
A = 1, B = \sqrt{3}, C = 1 \\
\sqrt{A^2 + B^2} = 2 \\
\sin \theta = \frac{\sqrt{3}}{2},
\cos \theta = \frac{1}{2}, \theta = \frac{\pi}{3} \\
\sin \phi = \frac{1}{2}, \phi = \frac{\pi}{6}
$$
Thus:
$$
x_1 = -\frac{\pi}{6} + 2 \pi n \\
x_2 = \frac{\pi}{2} + 2 \pi n \\
$$
