<s>[INST] How can I find the roots of this complex equation? I have to find the domain of
$\frac{z^2-1}{z^2+z+1}$
So, there can't be any $z$ that makes null the denominator,
$z^2+z+1$ = 0
and after decomposing $z$,
$x^2-y^2+x+2xyi+yi=0$
How to solve that quadratic complex equation?
 [/INST] Three points:

*

*You did the computation wrong. Writing $z=x+iy$, then
$$z^2+z+1 = (x+iy)^2 + (x+iy) + 1 = (x^2-y^2 + x + 1) + i(2xy+y).$$


*If $(x^2-y^2+x+1) + i(2xy+y) = 0$, with $x,y$ real numbers, then you need $x^2-y^2+x+1=0$ and $2xy+y=0$. You solve these the way you usually solve equations for real numbers.
So, for example, you have $0=2xy+y = (2x+1)y$. So either $y=0$ or $2x+1=0$. If $y=0$, then the first equation reduces to $x^2+x+1=0$, which has no real solutions, so there are no solutions with $y=0$. If $y\neq 0$, then $2x+1=0$, so $x=-\frac{1}{2}$. Plugging into the first equation, we get
$$0 = \frac{1}{4}-y^2 -\frac{1}{2} + 1 = -y^2 +\frac{3}{4},$$
so you get that $y^2 = \frac{3}{4}$, or $y = \pm\frac{\sqrt{3}}{2}$. So the two solutions are $z=-\frac{1}{2}+i\frac{\sqrt{3}}{2}$ and $z=-\frac{1}{2}-i\frac{\sqrt{3}}{2}$.


*The acrobatics from step 2 are unnecessary. You don't have to decompose into real and imaginary parts, because the quadratic formula works for complex numbers! (Provided you take complex square roots). Since
$$z^2 + z + 1 = \left(z+\frac{1}{2}\right)^2 + \frac{3}{4}$$
(by completing the square), then this is zero if and only if
$$z+\frac{1}{2} = \sqrt{-\frac{3}{4}},$$
if and only if
$$z = -\frac{1}{2} + \frac{\sqrt{-3}}{2}.$$
You may recognize this as exactly what you get from the quadratic formula applied to $z^2+z+1$, and you may also recognize them as the solutions you get if you go through the contorsions of step 2 above. So just find the two complex square roots of $-3$, and rejoice! (The quadratic formula works even if the coefficients of the quadratic are complex numbers, instead of real numbers).
</s>