<s>[INST] Solving a complex equation with $z=x \pm iy$ I'm trying to solve part of the question below:

The solution is below: 
I managed to get to the line $x-y=\pm 2$ , $y=\pm x$ but I can't understand how you can deduce $y=-x$ from these equations. I tried substituting them into each other but got nothing.
 [/INST] The equation (b) becomes
$$
x^2-y^2+2xyi=(x^2+y^2-4)i
$$
translates into the system
$$
\begin{cases}
x^2-y^2=0 \\[6px]
2xy=x^2+y^2-4
\end{cases}
$$
and both equations should be satisfied. From the second one you get $(x-y)^2=4$, so $x-y\ne0$. The first equation tells us
$$
(x-y)(x+y)=0
$$
so we get $x+y=0$. Now we have two linear systems
$$
\begin{cases}
x+y=0 \\[6px]
x-y=2
\end{cases}
\qquad\text{or}\qquad
\begin{cases}
x+y=0 \\[6px]
x-y=-2
\end{cases}
$$
that you can easily solve.
For (a) we get instead
$$
\begin{cases}
x^2-y^2=x^2+y^2-4\\[6px]
2xy=0
\end{cases}
$$
The first equation is $y^2=2$; the second equation now gives $x=0$.

A different approach. We have, for equation (a), $z^2=z\bar{z}-4$, so also $\bar{z}^2=\bar{z}z-4$. In particular, $z^2=\bar{z}^2$, so either
$z=\bar{z}$ or $z=-\bar{z}$. In the first case we obtain $z^2=z^2-4$, which has no solution, in the second case $z^2=-z^2-4$, so $z^2=-2$.
</s>