<s>[INST] how to solve this Complex Equation? I have a doubt about the resolution of this equation: 
$z^2 +|z^2 -1|=\frac{1}{2}(z+\bar{z})$ 
I tried to replace $z$ by $x+iy$ and $\bar{z}$ by $x-iy$.
From theory, I know that $|z|^2=z \cdot \bar{z}$, but I do not think this is the case .. 
My question is: how do I evaluate $|z^2 -1|$ ?
After that, can I continue with the substitutions to solve the equation? 
Thanks in advance: D
 [/INST] $\left| z^2-1\right|\equiv \left| (x+yi)^2-1 \right|\equiv\left| x^2+2xyi-y^2-1\right|\equiv \left|[\color{green}{x^2-y^2-1}]+[\color{red}{2xy}]i\right|\equiv\sqrt{(\color{green}{x^2-y^2-1})^2+(\color{red}{2xy})^2}\equiv\sqrt{x^4+2x^2y^2-2x^2+y^4+2y^2+1}\equiv\sqrt{(x^2-2x+y^2+1)(x^2+2x+y^2+1)}$.
</s>