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 ?

converting the given equation in $$\tan$$ we get
$${\frac { \left( 1+\sqrt {3} \right)  \left( 1- \left( \tan \left( x/2
 \right)  \right) ^{2} \right) }{1+ \left( \tan \left( x/2 \right) 
 \right) ^{2}}}+2\,{\frac { \left( \sqrt {3}-1 \right) \tan \left( x/2
 \right) }{1+ \left( \tan \left( x/2 \right)  \right) ^{2}}}-2=0
$$
simplifying and factorizing we obtain
$$-1/3\,{\frac { \left( \sqrt {3}+3 \right)  \left( \tan \left( x/2
 \right) +2-\sqrt {3} \right)  \left( 3\,\tan \left( x/2 \right) -
\sqrt {3} \right) }{1+ \left( \tan \left( x/2 \right)  \right) ^{2}}}
=0$$
thus you have to solve
$$- \left( \sqrt {3}+3 \right)  \left( -\tan \left( x/2 \right) -2+
\sqrt {3} \right)  \left( -3\,\tan \left( x/2 \right) +\sqrt {3}
 \right) 
=0$$
