Skip to content
CornerTools

Factoring & Polynomial Calculator

Factor polynomials step by step, with each technique named, or expand them and divide by long or synthetic division.

Mode

Powers ^ or ², brackets such as 3x(x + 1), fractions and decimals. Letters a to z.

Type a polynomial and the calculator factors it over the rational numbers the way it is done by hand, naming the technique behind each factor: the greatest common factor, grouping, the difference of squares, the sum and difference of cubes, perfect-square trinomials, the AC method, and the rational root theorem with a synthetic division for every root it finds. It also multiplies a polynomial out, and divides one polynomial by another by long or synthetic division, with the tableau written out.

It calls a polynomial irreducible over the rationals only when it has proved it; where it cannot, it says no further factor was found. Where a quadratic factor has roots that are surds, it also gives the factored form over the real numbers. All of it is worked out in your browser.

How to use it

Polynomial is typed as written, with powers as ^ or ², and multiplication by juxtaposition: 3x(x + 1) is 3x × (x + 1). Fractions and decimals are exact, so 0.5x² is x²/2. Every letter is a variable, and capitals read as lower case. A function, a root or a letter under a fraction bar is not a polynomial, and is refused with the reason.

Factor multiplies the input out first if it is not already, then factors it. Expand multiplies out products and powers and collects like terms. Divide adds a Divide by field and a Method: Long, or Synthetic for a divisor such as x − 2 or 2x − 1. Both polynomials are in one letter.

How it works

The greatest common factor comes out first: the largest number that divides every coefficient (a fraction, if the coefficients are fractions), the letters every term shares, and −1 when the leading coefficient is negative. What is left has whole coefficients with no common factor, and each part is tried, in turn, against the patterns its number of terms allows: two terms, a difference of squares and then cubes; three, a perfect square and then the AC method, which also takes x⁴ − 5x² + 4 and x² + 5xy + 6y²; four, grouping in pairs. Each factor found is tried again, until none of them splits.

A polynomial in one letter that no pattern fits goes to the rational root theorem: a rational root p/q, in lowest terms, has p dividing the constant term and q dividing the leading coefficient. Each candidate is tried; for a root r the factor theorem says x − r is a factor, and synthetic division by x − r gives the other factor, which is factored in turn. A factor that appears more than once is found from the factors the polynomial shares with its derivative.

Irreducible over the rationals means no factorisation into polynomials of lower degree with rational coefficients. A quadratic is irreducible when its discriminant is not a perfect square, and a cubic when it has no rational root. Above degree 3 the calculator reduces the polynomial modulo small primes: a factor with whole coefficients keeps its degree there, so a degree that no prime allows cannot occur. For the degrees still possible, up to degree 12, Kronecker's method tries every factor whose values at a few whole numbers divide the polynomial's values there, up to 300,000 choices. A search that finishes proves the polynomial irreducible; one that cannot finish leaves it as “no further factor was found”.

With several letters, the common factor, grouping and special products work on any letters, and a polynomial in two letters whose terms all have the same degree, such as x⁴ + 4y⁴, is factored as the one-letter polynomial with y = 1, then y goes back in. A polynomial of degree 1 in one letter whose two parts share no factor, such as x² + x + y, is proved irreducible. Anything else is left as no further factor found.

Rational root theorem: a root p/q of aₙxⁿ + … + a₀ has p | a₀ and q | aₙ
Factor theorem: P(r) = 0 exactly when x − r is a factor of P(x)
Remainder theorem: P(x) ÷ (x − r) leaves the remainder P(r)
Division: P(x) = D(x)·Q(x) + R(x), with R of lower degree than D

Examples

The AC method

Polynomial
6x^2 + 11x - 10

In the AC method, 15 and −4 multiply to ac = −60 and add to b = 11. They split the middle term, and the four terms group in pairs: (2x + 5)(3x − 2).

  1. AC method: 15 and −4 multiply to ac = −60 and add to b = 11, so the middle term splits in two and the terms group in pairs: 6x² + 11x − 10 = 6x² + 15x − 4x − 10 = 3x(2x + 5) − 2(2x + 5) = (3x − 2)(2x + 5) ​

x⁴ − 16, twice a difference of squares

Polynomial
x^4 - 16

x⁴ − 16 is (x²)² − 4², and x² − 4 is again a difference of squares, so it factors as (x − 2)(x + 2)(x² + 4). x² + 4, a sum of squares, does not factor over the rationals or the real numbers.

  1. Difference of squares: a² − b² = (a − b)(a + b): x⁴ − 16 = (x²)² − 4² = (x² − 4)(x² + 4) ​
  2. Difference of squares: a² − b² = (a − b)(a + b): x² − 4 = x² − 2² = (x − 2)(x + 2) ​
  3. Discriminant: b² − 4ac = −16 is negative, so x² + 4 has no rational root, and a quadratic without one is irreducible over the rationals

Synthetic division by x − 1

Mode
Divide
Polynomial
x^3 - 2x^2 - 5x + 6
Divide by
x - 1
Method
Synthetic

The root of x − 1 is 1. Bring down the first coefficient, then multiply by 1 and add to the next, column by column. The last number is the remainder, 0, so x − 1 is a factor, and the others are the coefficients of the quotient, x² − x − 6. Remainder theorem: R = P(1) = 0, so x − 1 is a factor of P (factor theorem).

Grouping

Polynomial
x^3 + 2x^2 - 4x - 8

The first pair has x² in common and the second −4, leaving x + 2 in both, so it is (x² − 4)(x + 2); x² − 4 is a difference of squares, and the result is (x − 2)(x + 2)², with x + 2 twice.

  1. Grouping: take the common factor out of each pair, then the common bracket: x³ + 2x² − 4x − 8 = x²(x + 2) − 4(x + 2) = (x² − 4)(x + 2) ​
  2. Difference of squares: a² − b² = (a − b)(a + b): x² − 4 = x² − 2² = (x − 2)(x + 2) ​

Special products

Each pattern with an example the calculator factors by it
PatternFormulaExample
Difference of squaresa² − b² = (a − b)(a + b)x² − 9 = (x − 3)(x + 3)
Perfect squarea² + 2ab + b² = (a + b)²x² + 10x + 25 = (x + 5)²
Perfect squarea² − 2ab + b² = (a − b)²4x² − 12x + 9 = (2x − 3)²
Sum of cubesa³ + b³ = (a + b)(a² − ab + b²)x³ + 27 = (x + 3)(x² − 3x + 9)
Difference of cubesa³ − b³ = (a − b)(a² + ab + b²)8x³ − 1 = (2x − 1)(4x² + 2x + 1)

Frequently asked questions

Over the rationals, every factor has rational coefficients, so x² − 2 does not factor. Over the real numbers, coefficients may be surds, and x² − 2 is (x − √2)(x + √2). The calculator factors over the rationals, and adds the real form when a quadratic factor has surd roots.
A factor of a quadratic would be of degree 1, and give a root; x² + 1 is at least 1 for every real x, so it has no real root, and no factor over the rationals or the real numbers. Its discriminant, 0 − 4 = −4, is negative. Over the complex numbers it is (x − i)(x + i).
Synthetic division is shorter, but works only for a divisor of degree 1, x − c, or ax − c after dividing by a. Long division works for any divisor, such as x² + 1, and gives the same quotient and remainder. Choosing Synthetic with a longer divisor shows long division, with a note.

See also