TITLE: What wolfram does to factor $x^6+x^2+2$?
QUESTION [5 upvotes]: I am learning polynomials and I am trying to understand what wolfram did to obtain $$(x^2+1)(x^4-x^2+2)$$ from $$x^6+x^2+2$$
It does not show me the step-by-step option in this case and I got confused. I only see $$x^2(x^4+1)+2$$ for this case.
Thank you.

REPLY [11 votes]: Notice that $x^6+x^2+2=(x^6+1) + (x^2+1)$.
 Since $x^6+1$ is a sum of cubes it factors like this: $$x^6+1=(x^2+1)(x^4-x^2+1).$$ Putting these together gives $$x^6+x^2+2=(x^2+1)(x^4-x^2+1)+(x^2+1)=(x^2+1)(x^4-x^2+2).$$
Not sure about Wolfram's actual algorithm though. For algorithms see Wikipedia. For an explanation of one algorithm that isn't too hard to follow, check out page 12 in 
Milne's course notes on fields and Galois theory, it is remark 1.17.

REPLY [8 votes]: You might substitute $x^2=u$ and look at the cubic $u^3+u+2=0$. Then a linear factor corresponds to a root, so we try the factors of $2$ and discover that $u=-1$ works. Thus, $u^3+u+2=(u+1)q(u)$ for some quadratic $q(u)$. Do synthetic division or long division to determine $q(u)$.