Skip to content
K Knidox Search…
Math · Algebra

Factoring Calculator

Factor a polynomial with integer coefficients and see which method did the work.

Integer coefficients, one variable. Type x^2 or x² — both work.
Try one
Factored
x² + x − 6 = (x − 2)(x + 3)
Roots from the linear factors

x = 2 · x = −3

  1. 1x = 2 is a root.Substituting gives 0, so (x − 2) divides in exactly, leaving x + 3.
  2. 2x = −3 is a root.Substituting gives 0, so (x + 3) divides in exactly and nothing is left to factor.

Factoring rewrites a polynomial as a product. Always pull out the greatest common factor first, then match a pattern: x² + x − 6 factors to (x − 2)(x + 3), because −2 and 3 multiply to −6 and add to 1. Setting each factor to zero gives the roots.

Why factoring is worth the trouble

A factored polynomial hands you its roots for free. Because a product is zero only when one of its parts is zero, (x − 2)(x + 3) = 0 immediately gives x = 2 or x = −3 — no formula needed. That zero-product property is the reason factoring appears in every topic that follows: solving equations, sketching curves, simplifying rational expressions, and finding where a function changes sign.

It also exposes structure the expanded form hides. Written as x³ − 6x² + 11x − 6 a cubic tells you almost nothing; written as (x − 1)(x − 2)(x − 3) it tells you where it crosses the axis, how it behaves between those points, and that it has no repeated roots.

The order to try things in

Start with the greatest common factor, every time — it is the step most often skipped and it makes everything after it smaller. Then count the terms. Two terms suggest a difference of squares or a sum or difference of cubes. Three terms suggest a trinomial method. Four terms suggest grouping. Only then reach for the rational root theorem, which handles whatever is left.

ax² + bx + c = a(x − r₁)(x − r₂)

r₁ and r₂ are the roots; they exist as fractions exactly when b² − 4ac is a perfect square

  1. 1
    Take out the greatest common factor. For 2x³ − 4x² − 16x every term shares 2x, leaving 2x(x² − 2x − 8).
  2. 2
    Count the terms to pick a method. Two terms point to a difference of squares or cubes; three to a trinomial; four to grouping.
  3. 3
    For a trinomial, find the pair that multiplies and adds. In x² − 2x − 8 you need two numbers multiplying to −8 and adding to −2: those are −4 and 2.
  4. 4
    Write the factors and check by expanding. x² − 2x − 8 = (x + 2)(x − 4), so the full factorisation is 2x(x + 2)(x − 4).
  5. 5
    Read off the roots if you need them. Setting each factor to zero gives x = 0, x = −2, and x = 4.

The patterns worth recognising on sight

Each identity read right to left is the factoring move; read left to right it is the expansion.

PatternFactors asExample
a² − b²(a + b)(a − b)x² − 16 = (x + 4)(x − 4)
a² + 2ab + b²(a + b)²x² + 6x + 9 = (x + 3)²
a² − 2ab + b²(a − b)²x² − 10x + 25 = (x − 5)²
a³ − b³(a − b)(a² + ab + b²)x³ − 8 = (x − 2)(x² + 2x + 4)
a³ + b³(a + b)(a² − ab + b²)x³ + 27 = (x + 3)(x² − 3x + 9)
a² + b²Does not factor over the realsx² + 9 stays as it is

When a polynomial simply will not factor

Plenty of perfectly ordinary polynomials have no factorisation with integer coefficients. For a quadratic the test is quick: if b² − 4ac is not a perfect square, no pair of whole numbers will work, and x² + 2x + 5 with a discriminant of −16 is a standard example. That is not a failure of method — it is a fact about the polynomial, and the quadratic formula is the right next step.

Two habits keep the rest honest. Check every factorisation by expanding it back, which catches a wrong sign in seconds. And remember that a difference of squares factors while a sum of squares does not: x² − 9 splits into (x + 3)(x − 3), but x² + 9 has no real roots to split at.

What should I always do first when factoring?
Take out the greatest common factor, including any shared power of x. Factoring 2x³ − 4x² − 16x into 2x(x² − 2x − 8) makes the remaining trinomial far easier, and skipping it is the most common reason an answer comes out incomplete.
How do I factor a trinomial when the leading coefficient is not 1?
Multiply the first and last coefficients, then find two numbers with that product whose sum is the middle coefficient. For 6x² + 11x − 35 the product is −210 and the pair is 21 and −10; split the middle term and factor by grouping.
How can I tell whether a quadratic factors at all?
Compute the discriminant b² − 4ac. It factors over the integers exactly when that value is a perfect square — 0, 1, 4, 9, 16 and so on. A negative or non-square discriminant means no integer factorisation exists.
Why does a difference of squares factor but a sum of squares not?
a² − b² = (a + b)(a − b) because the cross terms cancel when you expand. A sum of squares has no real roots, so there is no pair of real linear factors to write it as — it only factors if you allow complex numbers.
What is factoring by grouping?
With four terms, split them into two pairs, factor each pair separately, and hope the two results share a bracket. For x³ + 3x² + 2x + 6 that gives x²(x + 3) + 2(x + 3), which becomes (x + 3)(x² + 2).
How does the rational root theorem help?
For a polynomial with integer coefficients, any rational root p/q has p dividing the constant term and q dividing the leading coefficient. That turns an infinite search into a short list you can test, and each root found gives a linear factor to divide out.
How do I check my factoring is right?
Expand it back and compare with the original, or substitute a convenient number such as x = 1 or x = 2 into both forms. If the two disagree at any value, the factorisation is wrong — usually a sign.