Skip to content

Polynomial Factoring Calculator

Whole numbers separated by commas. 2x^3 – 8x becomes 2, 0, -8, 0 (write 0 for a missing power). Degree 1 to 10.

Factored form —
Polynomial entered
—
Degree
—
Rational roots
—
Common factor taken out
—
Irreducible part over the rationals
—

To factor a polynomial with integer coefficients, take out the greatest common factor, then test the candidates p/q from the Rational Root Theorem and divide out each root found. For example, x^3 – 6x^2 + 11x – 6 has roots 1, 2 and 3, so it factors as (x – 1)(x – 2)(x – 3). Whatever has no rational root is left as an irreducible factor.

About this tool

Algebra students checking homework, tutors preparing worked solutions and anyone simplifying a rational expression need a polynomial written as a product of simpler pieces. Type the coefficients from the highest power down and the tool returns the factored form, the list of rational roots with their multiplicities, the common factor it pulled out, and any part that cannot be split further over the rationals. Each division is listed in the working so the reasoning can be copied line by line. The method is exact: candidates come from the Rational Root Theorem and every division is done in integers, so no rounding creeps in. One limit: a leftover factor of degree four or more with no rational roots, such as x^4 + 4, may still split into two quadratics, and the tool reports it whole with a note.

How to use it

  1. Type the coefficients

    List them from the highest power to the constant, separated by commas. Write 0 for each missing power, so x^3 – 1 is 1, 0, 0, -1.

  2. Read the factored form

    The headline shows the product of factors, with a repeated factor written as a power such as (x – 1)^2.

  3. Check the roots and leftover

    The rational roots, the common factor and any irreducible remainder are listed beneath, with a note on why a quadratic remainder will not split.

  4. Follow the working

    Each step names the root found and the quotient left after dividing it out, ending with the full factorisation.

Examples

x^2 – 5x + 6

Coefficients, highest power first
1, -5, 6

Result Factored form: (x – 2)(x – 3)
Polynomial entered: x^2 – 5x + 6
Degree: 2
Rational roots: 2, 3
Common factor taken out: 1
Irreducible part over the rationals: none

  1. Polynomial: x^2 – 5x + 6
  2. x = 2 is a root (Rational Root Theorem), so divide by (x – 2): quotient x – 3
  3. Factored form: (x – 2)(x – 3)

Two integers that multiply to 6 and add to -5 are -2 and -3, so the quadratic splits into two linear factors with roots 2 and 3.

x^3 – 6x^2 + 11x – 6

Coefficients, highest power first
1, -6, 11, -6

Result Factored form: (x – 1)(x – 2)(x – 3)
Polynomial entered: x^3 – 6x^2 + 11x – 6
Degree: 3
Rational roots: 1, 2, 3
Common factor taken out: 1
Irreducible part over the rationals: none

  1. Polynomial: x^3 – 6x^2 + 11x – 6
  2. x = 1 is a root (Rational Root Theorem), so divide by (x – 1): quotient x^2 – 5x + 6
  3. x = 2 is a root (Rational Root Theorem), so divide by (x – 2): quotient x – 3
  4. Factored form: (x – 1)(x – 2)(x – 3)

The candidate roots are the divisors of 6. Trying them finds 1, then 2, then 3, each removed by synthetic division.

x^4 – 1

Coefficients, highest power first
1, 0, 0, 0, -1

Result Factored form: (x + 1)(x – 1)(x^2 + 1)
Polynomial entered: x^4 – 1
Degree: 4
Rational roots: -1, 1
Common factor taken out: 1
Irreducible part over the rationals: x^2 + 1

  1. Polynomial: x^4 – 1
  2. x = -1 is a root (Rational Root Theorem), so divide by (x + 1): quotient x^3 – x^2 + x – 1
  3. x = 1 is a root (Rational Root Theorem), so divide by (x – 1): quotient x^2 + 1
  4. Quadratic x^2 + 1: discriminant b² – 4ac = -4, negative, so no real roots; it is irreducible over the rationals.
  5. Factored form: (x + 1)(x – 1)(x^2 + 1)

Two rational roots, 1 and -1, come out; x^2 + 1 has a negative discriminant and stays as an irreducible quadratic.

How it is calculated

P(x) = g · x^k · (q1x - p1)(q2x - p2)…R(x)

g
greatest common divisor of the coefficients, signed to make the leading coefficient positive
k
the lowest power of x present in every term
p/q
a rational root: p divides the constant term and q divides the leading coefficient
R(x)
the remaining factor with no rational roots

After removing g and x^k the polynomial is primitive. The Rational Root Theorem says any rational root p/q in lowest terms has p dividing the constant and q dividing the leading coefficient, so the candidate list is finite. Each candidate is tested by synthetic division by (qx – p); by Gauss's lemma a true root leaves an integer quotient with zero remainder. The search repeats on the quotient, so repeated roots are caught. A quadratic left over is checked with the discriminant b^2 – 4ac: negative or not a perfect square means it is irreducible over the rationals.

When not to use it

  • It factors over the rationals only, so x^2 – 2 stays whole instead of splitting with square roots of 2.
  • Coefficients must be whole numbers; scale fractional ones first.
  • Expressions in two variables are outside its scope.

Common mistakes

  • The usual slip is skipping a missing power: x^3 – 8 must be typed as 1, 0, 0, -8.
  • A negative leading coefficient is pulled out with the common factor, so -x^2 + 1 shows as -(x + 1)(x – 1).

Frequently asked questions

How are the candidate roots chosen?

By the Rational Root Theorem. For 2x^2 + 7x + 3 the numerators are the divisors of 3 (±1, ±3) and the denominators are the divisors of 2 (1, 2), giving ±1, ±3, ±1/2 and ±3/2. Only -3 and -1/2 divide evenly, which yields (x + 3)(2x + 1).

Why does x^2 + 1 stay unfactored?

Its discriminant is 0 – 4 = -4, which is negative, so it has no real roots at all, let alone rational ones. Over the integers and rationals it is irreducible. Over the complex numbers it would be (x – i)(x + i), which this calculator does not produce.

How is a repeated root shown?

The search continues on each quotient, so a root that divides out twice is found twice and written as a power. For example, 1, -2, 1 gives (x – 1)^2, and the roots line reads 1 (×2).

What happens to a factor like 2x – 4?

The common factor 2 is taken out first, so 2x – 4 becomes 2(x – 2). Pulling the greatest common divisor out at the start keeps the remaining polynomial primitive, which is what guarantees every later division gives whole-number coefficients.

Can it factor x^4 + 4?

Not completely. x^4 + 4 has no rational roots, yet it equals (x^2 + 2x + 2)(x^2 – 2x + 2) by the Sophie Germain identity. Because the root search only finds linear factors, the tool returns it whole and adds a warning that a split into quadratics may exist.

What is the largest polynomial it accepts?

Degree 10, entered as 11 coefficients, each a whole number between -1,000,000 and 1,000,000. That covers textbook exercises comfortably; larger constants mean more divisors to test but the search is still exact.