How to factor the polynomial $x^4-x^2 + 1$ How do I factor this polynomial: $$x^4-x^2+1$$
The solution is: $$(x^2-x\sqrt{3}+1)(x^2+x\sqrt{3}+1)$$
Can you please explain what method is used there and what methods can I use generally for 4th or 5th degree polynomials?
 A: The first to try would be to look for (rational) roots, but that is fruitless here (you need only test divisors of the constant term, but $\pm1$ is not a root). 
Next you might try to factor as $(x^2+ax+b)(x^2+a'x+b')$ with integer  coefficients, where once again you could conclude that $bb'=1$, so $b=b'=\pm1$. However, as the solutionm tells as, this won't work to produce integer values $a,a'$ - though if you still give it a try with $b=b'=1$, you might be led to $a,a'=\pm\sqrt 3$.
However, a "trick" works here: Try to add something simple (that is also a easy to take the square root of) in order to obtain a square. Here we have $x^4-x^2+1$, which almost looks like $x^4+2x^2+1=(x^2+1)^2$, so we have 
$$ x^4-x^2+1=(x^2+1)^2-3x^2 = (x^2+1)^2-(\sqrt3x)^2$$
and can apply the third binomial formula to obtain a factorization.
A: Actually you have:
$$x^4-x^2+1=x^4+2x^2+1-3x^2=(x^2+1)^2-(\sqrt3 x)^2 $$
and use the identity $a^2-b^2=(a-b)(a+b)$
A: You can get it by$$x^4-x^2+1=x^4+2x^2-2x^2-x^2+1=x^4+2x^2+1-3x^2=(x^2+1)^2-(\sqrt 3x)^2.$$
A: Take $x^2=t$, and then try to factor the polynomial $t^2-t+1$.
