Why raising both sides of this equation yields incorrect results? I was solving a simple trigonometric equation and found two ways to solve it: one is correct and pretty straightforward, and the other one is a bit more complicated and is really close to being correct, but has extra solutions that came out of nowhere (or at least I think so). 
We started doing trigonometry about 3 months ago, so don't be too mad at me if I do some silly mistakes :)
Here's the equation (we need to find $x$): $\sqrt2\sin(x) - \sqrt2\cos(x) = \sqrt3$
Here's the incorrect solution:
$\sqrt2\sin(x) - \sqrt2\cos(x) = \sqrt3$
$\sin(x) - \cos(x) = \frac{\sqrt3}{\sqrt2}$
$1 - 2\sin(x)\cos(x) = 1.5$
$2\sin(x)\cos(x) = -0.5$
$\sin(2x) = -0.5$
$2x = (-1)^{n+1}\arcsin(\frac{1}{2}) + \pi n$
$x = (-1)^{n+1}\frac{\pi}{12}+\frac{\pi n}{2}$, where $n \in\mathbb {Z}$
I don't know why, but after I raise both sides of 
$\sin(x) - \cos(x) = \frac{\sqrt3}{\sqrt2}$ to the power of 2 (lines 2-3), extra solutions for $x$ appeared.
Here's what I mean:
This is the graph before I raised both sides of my equation to the power of 2
And this is after
As you can see, after I've risen both sides of my equation to the power of 2 extra solutions for $x$ have appeared. And I don't know why that happened. Can somebody please explain this?
Thanks in advance.
P.S.
Here's the correct solution:
$\sqrt2\sin(x) - \sqrt2\cos(x) = \sqrt3$
$\frac{\sqrt2}{2}\sin(x) - \frac{\sqrt2}{2}\cos(x) = \frac{\sqrt3}{2}$
$\cos(\frac{\pi}{4} + x) = -\frac{\sqrt3}{2}$
$x = \pm\frac{5\pi}{6} - \frac{\pi}{4} + 2\pi n$, where $n \in\mathbb {Z}$

When you have $f(x)=g(x)$ and you raise them to the power of $2$, then note that the solutions of $f(x)=-g(x)$ are also solutions of the new equation $[f(x)]^2=[g(x)]^2$. That's why new solutions appear.
