How do we solve $\sin x+\cos x=1$?
I have solved it easily by making the substitution, $\sin x+\cos x=1=R\sin(x+a)$ which gives the solutions $x=2n\pi, 2n\pi+\pi/2$. But when I do as follows $$ (\sin x+\cos x)^2=1\implies 2\sin x\cos x=0\implies \sin 2x=0\implies2x=n\pi $$ For even and odd $$ 2x=2m\pi\text{ or }2x=(2m+1)\pi\\x=m\pi\text{ or } x=m\pi+\frac{\pi}{2} $$ What am I missing here ?