gizmobench

Polynomial Factoring Calculator

Type a polynomial and the page factors it over the rationals: the common factor first, then the highest power of the variable that divides everything, then the irreducible factors with the number of times each one appears. Coefficients are held as exact fractions rather than decimals, so a factor is always something you can multiply back by hand, and the page does exactly that before showing you anything: it multiplies the factors together and compares the result with the polynomial you typed. The part most calculators get wrong is the polynomial that does not factor. Here x^2 + 1 is left whole and labelled irreducible over the rationals, which is a statement about that field and not about the complex numbers, and a search that could not finish comes back partly factored and says so instead of pretending to be complete.

polynomialdegree 4
x^4 - 1

variable   x
field      rationals
factorscomplete over Q
(x - 1)(x + 1)(x^2 + 1)

x^2 + 1 is irreducible over the rationals

multiply back
  (x - 1)(x + 1)(x^2 + 1) = x^4 - 1
Factors
3
Degree
4
Field
Rationals
Check
Exact

x^2 + 1 is irreducible over the rationals, so the factorisation stops there.

  • x² - 5x + 6two rational roots
    (x - 2)(x - 3)
  • x² + 1no rational factors
    left whole, labelled irreducible over ℚ
  • x³ - xcommon factor first
    x(x - 1)(x + 1)
Accuracy. Factorisation is over the rationals, and the page multiplies the factors back and compares them with your polynomial before showing them. A factor it cannot break further is labelled irreducible over the rationals, which is a claim about that field and not about the complex numbers: x² + 1 stays whole here. A polynomial it could not fully factor is returned partly factored and said to be so, never dressed up as complete.

Every factor, one by one

A linear factor gives its root straight away, which is the number that makes it zero. A quadratic that stays whole carries its discriminant instead, and that is the number which decides the question: a perfect square would have split it into two rational roots, and anything else cannot.

FactorAppearsRational rootStatus
x - 1once1linear
x + 1once-1linear
x^2 + 1oncenoneirreducible over Q, discriminant -4

How this is worked out

Coefficients are held as whole-number pairs, a numerator over a denominator, so nothing is ever rounded and a fraction you type survives to the answer. The common factor comes out first, then the highest power of the variable that divides everything, then a squarefree split that separates a factor appearing once from one appearing twice. What is left is factored over the whole numbers. A quadratic is settled by its discriminant, because a perfect square there is exactly what a pair of rational roots means. Anything larger is factored modulo a small prime, that factorisation is lifted to a modulus larger than any coefficient a real factor could have, and every combination of the lifted pieces is tried against the polynomial by exact division.

Trying every combination is what makes the word irreducible mean something here. When no product of the pieces divides, there is no factorisation over the rationals to find, and the page says so rather than reaching for decimals. If the search runs out of steps before it can say that, what comes back is partly factored and marked as such. Either way the factors are multiplied back out and compared with what you typed, which is why the check cell reads Exact instead of quoting a percentage.

What you can type

One letter for the variable, whole numbers, fractions such as 2/3, decimals such as 0.75, the signs + - * / ^ and brackets. Multiplication can be left out where it is obvious, so 2x and (x - 1)(x + 2) read the way they are written, and pasted maths works too: superscripts such as x² and a typographic minus are read as the powers and signs they stand for. A power must be a whole number from 0 to 30, and the box is read up to 500 characters. A list separated by commas and holding no letter, such as 1, 0, 0, -1, is read as coefficients from the highest power down. Dividing inside the box only works by a number, because dividing by a polynomial does not give one back.

Common questions

How do I factor a quadratic like x^2 - 5x + 6?
Type it and the page returns (x - 2)(x - 3), with the roots 2 and 3 listed beside each linear factor. It finds them from the discriminant rather than by guessing pairs: b squared minus 4ac is 1 here, a perfect square, so two rational roots exist and the factors are whole. When the discriminant is not a perfect square, as it is for x^2 - 2, there are no rational factors at all and the quadratic is returned whole with its discriminant 8 shown.
What does irreducible over the rationals mean?
It means no product of lower-degree polynomials with rational coefficients gives you that factor back. x^2 + 1 is the standard example: over the complex numbers it splits, and over the rationals it does not, so this page leaves it whole and says which field it is talking about. The claim is checked rather than assumed. Every combination of the pieces the search found is tried by exact division first, which is why x^4 - 10x^2 + 1 is correctly called irreducible even though it splits modulo every prime.
Can it factor a polynomial with fractions or decimals in it?
Yes, and it keeps them exact. A decimal is read as the fraction it is, so 0.75 becomes 3/4 before anything happens, and the fraction is pulled out in front so the factors themselves stay whole: x^2 - 1/4 comes back as (1/4)(2x - 1)(2x + 1). That is the same factorisation as (x - 1/2)(x + 1/2), written the way a marker expects to see it, and it multiplies back to exactly what you typed.
How large a polynomial will it take?
Any degree up to 30, in a box read up to 500 characters. You can type it as an expression, as a product such as (x - 1)^2(x + 2), or as a list of coefficients separated by commas from the highest power down, so 1, 0, 0, -1 is read as x^3 - 1. Pasted maths works too: superscripts and a typographic minus sign are read as the powers and signs they stand for.
Does it show the steps, like factoring by grouping?
It shows the result and the evidence for it rather than one hand method, because the method that works for x^2 - 5x + 6 is not the method that works for degree 12. You get the factors in order, how many times each appears, the root of every linear factor, the discriminant of every quadratic, and the multiplication that puts them back together as the polynomial you typed. That last line is the part you can check without trusting the page.
Why is my answer written differently from my textbook?
The factors are the same, the order and the front constant may differ. This page writes factors with whole-number coefficients and pulls any fraction out in front, sorts them by degree and then by the size of the root, and writes a repeated factor as a power. So 6x^2 + 5x - 6 comes back as (3x - 2)(2x + 3) and x^2 - 2x + 1 as (x - 1)^2. Multiplying either version out gives the same polynomial.
What happens if it cannot finish factoring?
The search has a step limit, and a polynomial that reaches it comes back partly factored with the unfinished piece marked as not proven, alongside a line saying it may split further. Nothing is ever labelled irreducible because the search gave up. Every factorisation, complete or partial, still multiplies back to the polynomial you typed, and the page shows that multiplication.

Factorisation is over the rationals, and the page multiplies the factors back and compares them with your polynomial before showing them. A factor it cannot break further is labelled irreducible over the rationals, which is a claim about that field and not about the complex numbers: x² + 1 stays whole here. A polynomial it could not fully factor is returned partly factored and said to be so, never dressed up as complete.