How to solve the trigonometric equation $\sin x + \cos x=\sin 2x + \cos 2x$? 
Question: Solve the trigonometric equation: $\sin x + \cos x=\sin 2x + \cos 2x$.

My attempt: 
$\sin x + \cos x=\sin 2x + \cos 2x$
$\implies \sin x + \cos x=2\sin x \cos x + \cos^2 x - \sin^2 x$
$\implies \sin x + \cos x=2\sin x \cos x + \cos^2 x - (1-\cos^2 x)$
$\implies \sin x + \cos x=2\sin x \cos x + 2\cos^2 x - 1$
$\implies \sin x - 2\sin x \cos x + \cos x - 2\cos^2 x= - 1$
$\implies \sin x(1-2\cos x)+\cos x(1-2\cos x)=-1$
$\implies (1-2\cos x)(\sin x+\cos x)=-1$
$\implies (1-2\cos x)=-1$ or $(\sin x +\cos x)=-1$
$\implies \cos x=1$ or $\sin^2 x +\cos^2 x + 2\sin x\cos x=1$ 
$\implies x=2n\pi$ or $\sin 2x=0$
$\implies x=2n\pi$ or $2x=n\pi$
$\therefore x=2n\pi$ or $x=\frac{n\pi}{2}$ 
But the answers given in my book are $x=2n\pi$ and $x=\frac{(4n+1)\pi}{6}$. Where have I gone wrong? Please help. 

To expand on @gribouillis 's comment, the error in your argument is this step:
$(1-2\cos x)(\sin x+\cos x)=-1$
$\implies (1-2\cos x)=-1$ or $(\sin x +\cos x)=-1$
This is an incorrect implication.
$ab=c$ only implies $a=c$ or $b=c$ when $c=0$.
For $c=-1$ as in this case, you could have $a=1,b=-1$ or $a=5,b=-0.2$ or $a=-1000,b=0.001$ or an infinite number of other combinations.
