I'm having problems solving the equation:
$$\cos(x)-3\sin(x)=1$$
My attempt
$$\begin{align}&\cos(x)= 1+3\sin(x)\\ &\cos(x)-1 = 3\sin(x)& \text{With: }\sin(x)=\sqrt{1-\cos^2(x)}\\ &\cos(x)-1= 3\sqrt{1-\cos^2(x)} \\ &(\cos(x)-1)^2=9-9\cos^2(x)\end{align}$$
Is this right?
Your idea is OK, but I recommend squaring the equation first before using $\sin^2x+\cos^2x=1$ to avoid problems with plus and minus signs (see dxiv's comment). As you have obtained:
$$ \begin{split} (\cos x - 1)^2 &= 9\sin^2x \\ \cos^2x-2\cos x + 1 &= 9-9\cos^2x \\ 10\cos^2x - 2\cos x - 8 &=0 \\ 5\cos^2x - \cos x - 4 &=0\\ (5\cos x + 4)(\cos x -1)&=0 \end{split}$$
Which, gives $\cos x = -4/5$ or $1$. Assuming $x\in[-\pi,\pi)$, then $x=0$ or $\pm \cos^{-1}(-4/5)$.
Edit: checking solutions, we see that $x=\cos^{-1}(-4/5)$ is not a solution. So the two correct solutions are $x=0,-\cos^{-1}(-4/5)$.
A more direct approach can be using the R-formula:
$$ \sqrt{3^2+1^2}\cos({x-\tan^{-1}(-3)}) = 1 $$
Which gives you $$x=-\tan^{-1}3 \pm \cos^{-1}\left(\frac{1}{\sqrt{10}}\right).$$
This is equivalent to the previous solution, as $\cos^{-1}(1/\sqrt{10})=\tan^{-1}3$ .