Solving $\sin x - \cos x = 1$ I have been trying to solve $\sin x - \cos x = 1$ by squaring both sides but has not been able to obtain the solution. Here is what I did:
$$\begin{align}(\sin x - \cos x)^2 &=1^2\\\sin^2x-2\sin x\cos x+\cos^2x&=1\\1-\sin 2x&=1\\\sin2x&=0\end{align}$$
Obviously $x=0$ is not a solution. May I ask why this is the case or where did things go wrong?
Thank You

Note that : $$\sin x - \cos x = \sqrt2 \sin(x - \frac{\pi}{4})$$ In this case, $$\sin x - \cos x = \sqrt2 \sin(x-\frac{\pi}{4})=1 \implies \sin(x-\frac{\pi}{4})=\frac{1}{\sqrt2}$$
Thus, two possible solutions are:


*

*$$x - \frac{\pi}{4}=\frac{\pi}{4} \implies x = \frac{\pi}{2}+2k\pi \, ,k \in \mathbb{Z}$$

*$$x -\frac{\pi}{4}=\frac{3\pi}{4} \implies x = \pi + 2k\pi \, , k \in \mathbb{Z}$$
