# Factor a polynomial

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?

• Specifically with the problem above, you could use the quadratic formula on $y^2-y+1$ where $y=x^2$. – Paul Sundheim May 1 '15 at 17:38
• – egreg May 1 '15 at 17:44
• Sorry A6Tech for my unhelpful idea! – Jordan Glen May 1 '15 at 17:44
• See also: Factoring $x^4 - x^2 + 1$ – Martin Sleziak Dec 9 '18 at 7:51

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.

Key Idea $$\$$ Completing the square leads to a difference of squares

$$\begin{eqnarray} \overbrace{\color{#0a0}{x^4+1}}^{\rm incomplete\ \large \Box\!\!}\!\! -x^2 &\,=\,& \overbrace{\color{#0a0}{(x^2\!+1)^2}}^{\rm\!\!\! completed\ \large \Box \!\!\!}-\ \color{#c00}{3\, x^2}\ \ \text{so, factoring this} \it\text{ difference of squares}\\ &\,=\,& (x^2+1\color{#c00}\ \ {-\ \ \color{#c00}{\sqrt3 x}})\ (x^2+1\, + \color{#c00}{\sqrt3 x})\\ \end{eqnarray}$$

Another example

$$\begin{eqnarray} \overbrace{n^4+4k^4}^{\rm incomplete\ \large \Box}\!\! &=\,& \overbrace{(n^2\!+2k^2)^2}^{\rm\!\!\! completed\ \large \Box\!\!\!}\!\!\!-\!(\color{#c00}{2nk})^2\ \ \text{so, factoring this} \it\text{ difference of squares}\\ &\,=\,& (n^2\!+2k^2\ -\,\ \color{#c00}{2nk})\,(n^2\!+2k^2+\,\color{#c00}{2nk})\\ &\,=\,&(\underbrace{(n-k)^2}_{\rm\!\!\!\!\!\!\!\!\!\!\! complete\ the\ square\!\!\!\!\!\!\!\!}\ +\ \,k^2)\ \ \underbrace{((n+k)^2}_{\rm\!\!\!\!\!\!\!\!\!\!\! complete\ the\ square\!\!\!\!\!\!\!\!\!\!\!\!\!\!} +\,k^2)\\ \end{eqnarray}$$

This generalizes to completing a product, using the AC-method, viz.

$$\begin{eqnarray} &&axy + bx + cy\, =\, d,\ \ a\ne 0\\ \overset{\times\,a}\iff\, &&\!\! (ax+c)(ay+b)\, =\, ad+bc\end{eqnarray}\qquad\qquad$$

• always answers well wrote and well explained using colors – Elaqqad May 1 '15 at 18:25
• The latter factorization is called Sophie Germain Identity. – user26486 May 1 '15 at 18:50
• @user31415 But it's older than her. – Bill Dubuque May 1 '15 at 19:04

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)$

• How did you come up with that? Were you just lucky or there is a method of "fast thinking" :D ? – A6SE May 1 '15 at 17:42
• This is just from my experience other examples are well known for example $x^4+1$ when we have a polynomial of the form $x^4+ax^2+b$ can be factord using the same method "by completing the square" – Elaqqad May 1 '15 at 17:45

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.$$

Take $x^2=t$, and then try to factor the polynomial $t^2-t+1$.