General solution to $(\sqrt{3}-1)\cos x+(\sqrt{3}+1)\sin x=2$ $(\sqrt{3}-1)\cos x+(\sqrt{3}+1)\sin x=2$ is said to have a general solution of $x=2n\pi\pm\frac{\pi}{4}+\frac{\pi}{12}$.
My Approach:
Considering the equation as 
$$
a\cos x+b\sin x=\sqrt{a^2+b^2}\Big(\frac{a}{\sqrt{a^2+b^2}}\cos x+\frac{b}{\sqrt{a^2+b^2}}\sin x\Big)=\sqrt{a^2+b^2}\big(\sin y.\cos x+\cos y.\sin x\big)=\sqrt{a^2+b^2}.\sin(y+x)=2
$$
$\frac{a}{\sqrt{a^2+b^2}}=\sin y$ and $\frac{b}{\sqrt{a^2+b^2}}=\cos y$.
$$
{\sqrt{a^2+b^2}}=\sqrt{8}=2\sqrt{2}\\\tan y=a/b=\frac{\sqrt{3}-1}{\sqrt{3}+1}=\frac{\frac{\sqrt{3}}{2}.\frac{1}{\sqrt{2}}-\frac{1}{2}.\frac{1}{\sqrt{2}}}{\frac{\sqrt{3}}{2}.\frac{1}{\sqrt{2}}+\frac{1}{2}.\frac{1}{\sqrt{2}}}=\frac{\sin(\pi/3-\pi/4)}{\sin(\pi/3+\pi/4)}=\frac{\sin(\pi/3-\pi/4)}{\cos(\pi/3-\pi/4)}=\tan(\pi/3-\pi/4)\implies y=\pi/3-\pi/4=\pi/12
$$
Substituting for $y$,
$$
2\sqrt{2}.\sin(\frac{\pi}{12}+x)=2\implies \sin(\frac{\pi}{12}+x)=\frac{1}{\sqrt{2}}=\sin{\frac{\pi}{4}}\\\implies \frac{\pi}{12}+x=n\pi+(-1)^n\frac{\pi}{4}\implies x=n\pi+(-1)^n\frac{\pi}{4}-\frac{\pi}{12}
$$
What's going wrong with the approach ?

You can consider system \begin{align} (\sqrt 3 - 1)\cos x+(\sqrt 3+ 1)\sin x &= 2\\ \cos^2 x + \sin^2 x &= 1\end{align} Geometrically, you are looking for intersection of a line and unit circle, so we are expecting at most two solutions (see this plot). Thus, we can safely square the first equation and eliminate extra solutions later. Doing this we get: \begin{align}(4-2\sqrt 3)\cos^2x+4\cos x\sin x+(4+2\sqrt 3)\sin^2 x &= 4\\ 2\sin 2x -2\sqrt 3\cos 2x &= 0\\ \tan 2x &= \sqrt 3\\ 2x &= \pi/3+k\pi,\ k\in\Bbb Z\\ x &= \pi/6+k\pi/2,\ k\in\Bbb Z\end{align} Now, we eliminate solutions not in first or second quadrant to finally get $$x = \pi/6+2k\pi,\ x = 2\pi/3+2k\pi,\ k\in\Bbb Z$$
