# Factoring question

Question: Factor $$z^4 + 4z^2 + 6 - z.$$

Here is the solution: Rewrite the given equation as $$\left(z^2+2\right)^2 + 2 = z$$. Observe that a solution to $$z^2 + 2 = z$$ is a solution of the quartic by substitution of the left hand side into itself. This means $$z^2-z+2$$ divides into $$\left(z^2+2\right)^2-z+2 = z^4 + 4z^2 - z + 6$$. Factoring it out, we obtain $$\boxed{\left(z^2-z+2\right)\left(z^2+z+3\right)}.$$

I have a question on this solution, specifically the 2nd line. What does it mean? Can anybody clarify? Thanks!

It means that if $$z^2+2=z$$, then $$(z^2+2)^2+2 = (z)^2+2 = z^2+2 = z$$. So any solution of $$z^2+2=z$$ is also a solution of $$(z^2+2)^2+2 = z$$.
Let $$z^2+2=w$$ or $$2=w-z^2$$.
Thus, $$w^2+2=z,$$ which gives the needed factorization: $$z^4+4z^2+6-z=(z^2+2)+2-z=w^2+w-z^2-z=$$ $$=(w-z)(w+z)+w-z=(w-z)(w+z+1)=(z^2-z+2)(z^2+z+3).$$