Solving a complex equation So I've got a complex equation to resolve, but actually I can't really understand how to do it. So I went to WolframAlpha which is always very helpful, which told me how to resolve it with the steps, which is great but I don't understand how it's done. The equation I need to solve is 
$$
\frac{z^2}{z+1}=\frac{2+4i}{5}
$$
WolframAlpha tells me to do this : http://www4b.wolframalpha.com/Calculate/MSP/MSP1128204255g0bd35d5he0000674612e93i7dc9b2?MSPStoreType=image/png&s=62&w=382&h=1869
Though, I don't understand how it goes from 
$$
5z^2+(-2-4i)z-2-4i=0
$$
(which I had done by myself) to
$$
(2-i)[z+(-1-i)][(1+i)+(2+i)z]=0
$$
It's not in the lesson and I couldn't find info about this anywhere. Could anyone help me out and explain me how I'm supposed to do this and based on what ?
Thank you very much
 A: You can compute the roots of the polynomial equation with the quadratic formula in terms of $z$ from your equation. If $a,b \in \mathbb{C}$ are roots of the polynomial equation given, then wolphram has put them into the form
$$ (z - a)(z - b) = 0$$
So in order to get the same equation as wolphram has simply compute the roots of the polynomial equation, and set them into the equation above! 
A: First we substitute $w=\frac{2+4i}{5}$
$$\frac{z^2}{z+1}=w$$
$$z^2=wz+w$$
$$0=z^2-wz-w$$
We need to complete the square:
$$0=z^2-2\frac{w}{2}z+(\frac{w}{2})^2-(\frac{w}{2})^2-w$$
$$z^2-2\frac{w}{2}z+(\frac{w}{2})^2=(\frac{w}{2})^2+w$$
$$(z-\frac{w}{2})^2=\frac{w^2}{4}+w$$
Lets introduce a substitution $s=z-\frac{w}{2}$ to get the following equation:
$$s^2=\frac{w^2}{4}+w$
Now resubsitute $w$:
$$s^2=\frac{w^2}{4}+w=\frac{7}{25}+\frac{24i}{25}$$
The last step is applying the complex root. I leave it to you from here. 
If you have found the roots $s_{1/2}$ you just have to resubstitute them into $s=z-\frac{w}{2}$ to get your final solution (after also plugging in $\frac{w}{2}$.
$$z_{1/2}=s_{1/2}+\frac{w}{2}$$
Comment if you still got problems to proceed 
A: HINT: Given $$\frac{z^2}{z+1}=\frac{2+4i}{5}$$
$$\frac{(z^2-1)+1}{z+1}=\frac{2+4i}{5}$$
$$\frac{(z-1)(z+1)+1}{z+1}=\frac{2+4i}{5}$$
$$z-1+\frac{1}{z+1}=\frac{2+4i}{5}$$
$$z+\frac{1}{z+1}=\frac{7}{5}+i\frac{4}{5}$$
A: $$\frac{z^2}{z+1} = \frac{2+4i}{5} \Longleftrightarrow$$
$$\frac{z^2}{z+1} = \frac{2}{5}+\frac{4}{5}i \Longleftrightarrow$$
$$5z^2 = (2+4i)(z+1) \Longleftrightarrow$$
$$5z^2 = (2+4i)+(2+4i)z \Longleftrightarrow$$
$$(-2-4i)+(-2-4i)z+5z^2 = 0 \Longleftrightarrow$$
$$(2-i)(z+(-1-i))((1+i)+(2+i)z) = 0 \Longleftrightarrow$$
$$(z+(-1-i))((1+i)+(2+i)z) = 0 \Longleftrightarrow$$
$$z+(-1-i))= 0 \vee (1+i)+(2+i)z = 0 \Longleftrightarrow$$
$$z=1+i \vee (2+i)z = -1-i \Longleftrightarrow$$
$$z=1+i \vee z = \frac{-1-i}{2+i} \Longleftrightarrow$$
$$z=1+i \vee z = -\frac{3}{5}-\frac{1}{5}i $$
