Question: 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

Answer: 
Use the property that $$\sin(x-y)=\sin x\cos y-\cos x\sin y$$

We can rewrite the left side of the equation....

$$\begin{align}\sin x-\cos x&=1\\\sqrt 2\left(\sin x\cos\dfrac\pi4-\cos x\sin\dfrac\pi4\right)&=1\\\sin\left(x-\dfrac\pi4\right)&=\dfrac1{\sqrt2}\\x-\dfrac\pi4&=\dfrac\pi4+2k\pi,\pi-\dfrac\pi4+2k\pi\\x&=\boxed{\dfrac\pi2+2k\pi,(2k+1)\pi}\end{align}$$

Don't square both sides, it creates **extraneous solutions**

If you want, you can also use this property to start the solution....

$$\begin{align}a\cos x+b\sin x&\equiv R\cos(x-\alpha)\\\text{where }R=\sqrt{a^2+b^2},&\qquad\alpha=\tan^{-1}\left(\dfrac ba\right)\end{align}$$
Let $a:= \sin x -\cos x;$ $ b=1;$

You have $a = b.$

Squaring: $a^2 =b^2$ gives 

$(a-b)(a+b)=0. $

You find solutions for the squared equation:

$a=b$, or $a = -b.$

Need to be a bit careful:

$\sin 2x =0;$ or $x=0;$ implies:

1) $x = 2πk$, $k$ integer.

These are the solutions for $a = -b.$, I.e.

$\sin x - \cos x = -1$.

The solution to the original problem,

$\sin x - \cos x= +1:$

2) $2x = π$ ; or $x = π/2; $ or

$x = π/2 + 2πk.$