Solve $z\cdot |z|-2z-i+1=0$ I have an equation with complex numbers that I can't solve
$$z\cdot |z|-2z-i+1=0$$
My problem is that $z$ appears not only as an unknown quantity but also its modulus.
 A: Let $z=a+bi$, where $a$ and $b$ are reals. 
Thus, $$(a+bi)\sqrt{a^2+b^2}-2(a+bi)-i+1=0,$$
which gives
$$a\sqrt{a^2+b^2}=2a-1$$ and
$$b\sqrt{a^2+b^2}=2b+1$$ or
$$\sqrt{a^2+b^2}=\frac{2a-1}{a}$$ and
$$\sqrt{a^2+b^2}=\frac{2b+1}{b},$$
which gives
$$\frac{2a-1}{a}=\frac{2b+1}{b}$$ or
$$a=-b.$$
Thus, $\sqrt2a|a|=2a-1$ and the rest is smooth.
A: First we find $|z|$:
$$z(|z|-2)=-1+i\implies |z|(|z|-2)=|-1+i|=\sqrt{2}\Leftrightarrow (|z|-1)^2=1+\sqrt{2},$$
which implies $|z|=1\pm\sqrt{1+\sqrt{2}}$. Since $|z|\geq 0$ then $|z|=1+\sqrt{1+\sqrt{2}}$. 
Then, going back to the original equation, we obtain the unique solution
$$z=\frac{-1+i}{|z|-2}=\frac{1-i}{1-\sqrt{1+\sqrt{2}}}=-\frac{1+\sqrt{1+\sqrt{2}}}{\sqrt{2}}\cdot(1-i).$$
A: Let $z=re^{i\theta}$ then
$$z|z|-2z-(i-1)=r^2e^{i\theta}-2re^{i\theta}-\sqrt{2}e^{i\frac{3\pi}{4}}=0$$
and
$$r^2-2r=\sqrt{2}e^{i(\frac{3\pi}{4}-\theta)}$$
then
$$r^2-2r=\sqrt{2}\cos(\frac{3\pi}{4}-\theta)+i\sqrt{2}\sin(\frac{3\pi}{4}-\theta)$$
so with equations
$$r^2-2r=\sqrt{2}\cos(\frac{3\pi}{4}-\theta)~~~,~~~\sin(\frac{3\pi}{4}-\theta)=0$$
we find the answer.
A: If we multiply the equation by $\bar z$, we get
$$|z|^3-2|z|^2=\bar z(i-1)$$ which means that $\bar z(i-1)\in\mathbb R$. By letting $z = a+ib$, we get that the imaginary part of $\bar z(i-1)$ is $a + b$, which must be equal to $0$.
Thus, $z = r(i-1)$, for some real $r$. Returning to the original equation, we get $$r|r|(i-1)\sqrt 2-2r(i-1)-(i-1) = 0\implies r|r|\sqrt 2-2r-1=0.$$
Now, if $r\geq 0$, then the equation becomes $r^2\sqrt 2-2r-1 = 0$ and the only non-negative root is $$r = \frac{1+\sqrt{1+\sqrt 2}}{\sqrt 2}\implies z =\frac{1+\sqrt{1+\sqrt 2}}{\sqrt 2}(i-1). $$
The solution is unique since the case $r<0$ gives us equation $-r^2\sqrt 2 - 2r-1 = 0$, which has no real roots.
