Complex numbers: to what equals $\Im z$? I have an exercise. I tried several times to solve the problem and I got a wrong answer.
$$z^2+(\Im z)^2=i(z-18)$$
Is this true?
$$z =a+bi$$
$$z^2=(a+bi)^2$$
$$\Im z=b\to(\Im z)^2=b^2$$
Thanks.
 A: You get two equations, one in the reals, and one in $i$.
Expanding the equation:
$$a^2+2abi-b^2+b^2=-b-18i+ai$$
So $a^2=-b$ and $2ab=a-18$.
Inserting the first equation into the second gives:
$$2a^3=18-a\to 2a^3+a-18=0$$
which has roots $a=2,-1\pm i\sqrt{\frac72}$.
A: Note that
$$
z^2=(a+ib)^2=a^2+2iab-b^2
$$
thus your equation turns into
$$
a^2+2iab-b^2+b^2=i(a+ib-18)\\
a^2+2iab=ia-b-i18
$$
so you get
$$
a^2=-b\\
2ab=a-18
$$
form which
$$
2a^3+a-18=0
$$
one of its solution is $a=2$, then by $a^2=-b$ you get $b=-4$.
A: Generalize the problem, when $\text{z}\in\mathbb{C}$ and $\text{n}\in\mathbb{R}$:
$$\text{z}^2+\left(\Im\left[\text{z}\right]\right)^2=\left(\text{z}-\text{n}\right)i$$
Now, use:


*

*$$\text{z}=\Re\left[\text{z}\right]+\Im\left[\text{z}\right]i$$

*$$\text{z}^2=\left(\Re\left[\text{z}\right]+\Im\left[\text{z}\right]i\right)^2=\Re^2\left[\text{z}\right]-\Im^2\left[\text{z}\right]+2\Re\left[\text{z}\right]\Im\left[\text{z}\right]i$$

*$$\left(\text{z}-\text{n}\right)i=\left(\Re\left[\text{z}\right]+\Im\left[\text{z}\right]i\right)i-\text{n}i=-\Im\left[\text{z}\right]+\Re\left[\text{z}\right]i-\text{n}i=-\Im\left[\text{z}\right]+\left(\Re\left[\text{z}\right]-\text{n}\right)i$$


So, you get:
$$\text{z}^2+\left(\Im\left[\text{z}\right]\right)^2=\left(\text{z}-\text{n}\right)i\Longleftrightarrow\Re^2\left[\text{z}\right]-\Im^2\left[\text{z}\right]+2\Re\left[\text{z}\right]\Im\left[\text{z}\right]i+\Im^2\left[\text{z}\right]=-\Im\left[\text{z}\right]+\left(\Re\left[\text{z}\right]-\text{n}\right)i$$
Simplify the right part:
$$\Re^2\left[\text{z}\right]+2\Re\left[\text{z}\right]\Im\left[\text{z}\right]i=-\Im\left[\text{z}\right]+\left(\Re\left[\text{z}\right]-\text{n}\right)i$$
So, you need to solve:
$$
\begin{cases}
\Re^2\left[\text{z}\right]=-\Im\left[\text{z}\right]\\
2\Re\left[\text{z}\right]\Im\left[\text{z}\right]=\Re\left[\text{z}\right]-\text{n}
\end{cases}\Longleftrightarrow
\begin{cases}
-\Re^2\left[\text{z}\right]=\Im\left[\text{z}\right]\\
2\Re\left[\text{z}\right]\left(-\Re^2\left[\text{z}\right]\right)=\Re\left[\text{z}\right]-\text{n}
\end{cases}
$$

So, you will get when $\text{n}=18$:
$$
\color{red}{\begin{cases}
\Re^2\left[\text{z}\right]=-\Im\left[\text{z}\right]\\
2\Re\left[\text{z}\right]\Im\left[\text{z}\right]=\Re\left[\text{z}\right]-18
\end{cases}\Longleftrightarrow
\begin{cases}
-\Re^2\left[\text{z}\right]=\Im\left[\text{z}\right]\\
2\Re\left[\text{z}\right]\left(-\Re^2\left[\text{z}\right]\right)=\Re\left[\text{z}\right]-18
\end{cases}\Longleftrightarrow
\begin{cases}
\Im\left[\text{z}\right]=-4\\
\Re\left[\text{z}\right]=2
\end{cases}}
$$
So, for your problem:
$$\text{z}=2-4i$$
A: Let $z=x+iy$, then
$$z^2+(\Im z)^2=i(z-18)\implies x^2-y^2+2ixy+y^2=i(x-18)-y,$$
which implies $x^2+y=0$ and $2xy-x=-18$.
Substituting gives $2x^3+x=18$, from which it is not difficult to see that $x=2$ is a solution. This implies $y=-4$. Hence, $x=2-4i$ is a solution.
