How to Factor Polynomials

Updated · MathSolver

In 30 seconds

  • To factor a polynomial, write it as a product of simpler polynomials. Always take out the greatest common factor first.
  • Then match the shape: two terms suggest a difference of squares or cubes, three terms a trinomial, four terms grouping. For cubics, find one root with the rational root test and divide.
  • Check every answer by multiplying the factors back together.

What does it mean to factor a polynomial?

Factoring a polynomial means rewriting it as a product of polynomials of lower degree. For example, x² − 5x + 6 = (x − 2)(x − 3). The two sides are equal for every value of x; the factored form simply shows the structure of the polynomial.

Factoring is the reverse of multiplying. Expanding (x − 2)(x − 3) gives x² − 3x − 2x + 6 = x² − 5x + 6, which is why multiplying the factors back together is always the way to check your answer.

The factored form is useful because a product is zero only when one of its factors is zero. Once x² − 5x + 6 is written as (x − 2)(x − 3), the equation x² − 5x + 6 = 0 has solutions x = 2 and x = 3. Factoring also simplifies fractions and reveals where a graph crosses the x-axis.

x2−5x+6=(x−2)(x−3)x^2 - 5x + 6 = (x - 2)(x - 3)

Which factoring method should you use?

Look at the polynomial after removing the greatest common factor and count its terms. The number of terms, and whether they are perfect squares or cubes, tells you which method to try first.

Choosing a factoring method
What the polynomial looks likeMethodExample
Every term shares a factorGreatest common factor6x² − 15x = 3x(2x − 5)
Two squares with a minus signDifference of squaresx² − 9 = (x − 3)(x + 3)
Two cubesSum or difference of cubes8x³ − 27 = (2x − 3)(4x² + 6x + 9)
Three terms, degree 2Trinomial (ac method)2x² + 7x + 3 = (2x + 1)(x + 3)
Four termsGroupingx³ + 3x² + 2x + 6 = (x + 3)(x² + 2)

Step 1: Take out the greatest common factor

The greatest common factor (GCF) is the largest expression that divides every term. Find the largest number that divides all the coefficients and the lowest power of each variable that appears in every term. In 6x² − 15x, the coefficients 6 and 15 share 3, and both terms contain x, so the GCF is 3x and 6x² − 15x = 3x(2x − 5).

Always do this step first. It makes the remaining polynomial smaller and often reveals a pattern you would otherwise miss: 3x² − 12 does not look like a difference of squares, but 3x² − 12 = 3(x² − 4) = 3(x − 2)(x + 2). If you skip the GCF, your final answer is not completely factored.

6x2−15x=3x(2x−5)6x^2 - 15x = 3x(2x - 5)

Step 2: Factor trinomials

For a trinomial x² + bx + c with leading coefficient 1, look for two numbers that multiply to c and add to b. For x² − 5x + 6 you need a product of 6 and a sum of −5; the numbers −2 and −3 work, so x² − 5x + 6 = (x − 2)(x − 3). When c is positive both numbers have the sign of b; when c is negative they have opposite signs.

When the leading coefficient a is not 1, use the ac method. For 2x² + 7x + 3, multiply a and c: 2 · 3 = 6. Find two numbers that multiply to 6 and add to 7: 6 and 1. Split the middle term with them, 2x² + 6x + x + 3, and factor by grouping: 2x(x + 3) + 1(x + 3) = (2x + 1)(x + 3).

If no pair of integers works, the trinomial does not factor over the integers. You can still find its roots with the quadratic formula or by completing the square.

2x2+7x+3=2x2+6x+x+3=(2x+1)(x+3)2x^2 + 7x + 3 = 2x^2 + 6x + x + 3 = (2x + 1)(x + 3)

Step 3: Difference of squares and sum or difference of cubes

Two terms that are both perfect squares, separated by a minus sign, factor as a difference of squares: a² − b² = (a − b)(a + b). So x² − 9 = (x − 3)(x + 3) and 4x² − 25 = (2x − 5)(2x + 5). A sum of squares such as x² + 9 does not factor over the real numbers.

Two cubes factor with the sum and difference of cubes formulas. For 8x³ − 27, write it as (2x)³ − 3³, so a = 2x and b = 3. Then a³ − b³ = (a − b)(a² + ab + b²) gives (2x − 3)(4x² + 6x + 9). The quadratic factor in a sum or difference of cubes never factors further over the real numbers.

a2−b2=(a−b)(a+b),a3±b3=(a±b)(a2∓ab+b2)a^2 - b^2 = (a - b)(a + b),\quad a^3 \pm b^3 = (a \pm b)(a^2 \mp ab + b^2)

Perfect square trinomials

Some trinomials are the square of a binomial. A trinomial is a perfect square when its first and last terms are perfect squares and the middle term is twice the product of their square roots. In x² + 10x + 25, the first term is x², the last is 5², and the middle term is 2 · x · 5 = 10x, so x² + 10x + 25 = (x + 5)². If the middle term is negative, the binomial has a minus sign: 4x² − 12x + 9 = (2x − 3)², because 2 · 2x · 3 = 12x.

Spotting this pattern saves time, but the trinomial method gives the same answer. For x² + 10x + 25 you need two numbers with product 25 and sum 10; the pair 5 and 5 works, giving (x + 5)(x + 5). Perfect square trinomials are also the reason completing the square works: adding the right constant turns x² + bx into a perfect square.

Watch the sign of the last term. x² + 10x − 25 is not a perfect square, because −25 is not a square of a real number. It does not factor over the integers at all, since no pair of integers multiplies to −25 and adds to 10.

a2±2ab+b2=(a±b)2a^2 \pm 2ab + b^2 = (a \pm b)^2

Step 4: Factor by grouping

A polynomial with four terms can often be factored by grouping the terms in pairs. In x³ + 3x² + 2x + 6, group the first two and the last two terms: x²(x + 3) + 2(x + 3). Both groups now contain the same factor, x + 3, which you take out: (x + 3)(x² + 2).

If the two groups do not share a factor, try rearranging the terms before grouping. Grouping is also the second half of the ac method for trinomials, so it is worth practising on its own.

x3+3x2+2x+6=x2(x+3)+2(x+3)=(x+3)(x2+2)x^3 + 3x^2 + 2x + 6 = x^2(x + 3) + 2(x + 3) = (x + 3)(x^2 + 2)

How to factor a cubic polynomial

When a cubic has no common factor and does not group, find one root with the rational root theorem. Any rational root p/q has p dividing the constant term and q dividing the leading coefficient. For x³ − 6x² + 11x − 6, the candidates are ±1, ±2, ±3 and ±6.

Test the candidates by substitution. At x = 1: 1 − 6 + 11 − 6 = 0, so x = 1 is a root and x − 1 is a factor. Divide the cubic by x − 1, using long or synthetic division, to get x² − 5x + 6, then factor that trinomial. The full factorization is (x − 1)(x − 2)(x − 3).

x3−6x2+11x−6=(x−1)(x2−5x+6)=(x−1)(x−2)(x−3)x^3 - 6x^2 + 11x - 6 = (x - 1)(x^2 - 5x + 6) = (x - 1)(x - 2)(x - 3)

Factoring completely: putting the steps together

Real exercises often need several methods in a row. The rule is to keep going until no factor can be factored again. Take 2x⁴ − 32. First take out the GCF, 2, to get 2(x⁴ − 16). The bracket is a difference of squares, (x²)² − 4², so it becomes 2(x² − 4)(x² + 4). The factor x² − 4 is again a difference of squares, giving 2(x − 2)(x + 2)(x² + 4). The last factor, x² + 4, is a sum of squares and stops there.

Another example combines the GCF with a trinomial. In 3x³ − 3x² − 18x, every term contains 3x, so the expression is 3x(x² − x − 6). For the trinomial, look for a product of −6 and a sum of −1: the numbers −3 and 2 work. The complete factorization is 3x(x − 3)(x + 2). Expanding confirms it: (x − 3)(x + 2) = x² − x − 6, and multiplying by 3x returns 3x³ − 3x² − 18x.

A useful habit is to write down which method you used at each step, as the worked examples below do. It makes your work easy to check and shows a teacher that you recognised each pattern.

2x4−32=2(x2−4)(x2+4)=2(x−2)(x+2)(x2+4)2x^4 - 32 = 2(x^2 - 4)(x^2 + 4) = 2(x - 2)(x + 2)(x^2 + 4)

How factoring helps you solve equations

Factoring turns an equation into a set of simpler ones. To solve 3x³ − 3x² − 18x = 0, factor the left side to 3x(x − 3)(x + 2) = 0. A product is zero only when one of its factors is zero, so x = 0, x = 3 or x = −2. This is the zero product property, and it only works when one side of the equation is zero.

Make sure the equation is set equal to zero before factoring. x² − 5x = −6 must first become x² − 5x + 6 = 0, which factors to (x − 2)(x − 3) = 0 and gives x = 2 or x = 3. Factoring x² − 5x into x(x − 5) and setting each factor equal to −6 would give wrong answers.

Worked examples

Each example shows the method chosen, the steps, and the final factored form. Multiply the factors back together to check them.

  1. 1. Factor x² − 5x + 6.

    • Leading coefficient 1: find two numbers with product 6 and sum −5.
    • The pair −2 and −3 works.

    Answer: (x − 2)(x − 3)

  2. 2. Factor 2x² + 7x + 3.

    • ac = 6; the numbers 6 and 1 multiply to 6 and add to 7.
    • Split the middle term: 2x² + 6x + x + 3.
    • Group: 2x(x + 3) + 1(x + 3).

    Answer: (2x + 1)(x + 3)

  3. 3. Factor x² − 9.

    • Both terms are squares: x² and 3².
    • Apply a² − b² = (a − b)(a + b).

    Answer: (x − 3)(x + 3)

  4. 4. Factor 8x³ − 27.

    • Write as (2x)³ − 3³, so a = 2x and b = 3.
    • Apply a³ − b³ = (a − b)(a² + ab + b²).

    Answer: (2x − 3)(4x² + 6x + 9)

  5. 5. Factor 6x² − 15x.

    • The GCF of 6x² and 15x is 3x.
    • Divide each term by 3x.

    Answer: 3x(2x − 5)

Common mistakes and how to check your answer

Most factoring errors come from a few habits. Multiplying the factors back together catches all of them, because the expanded product must match the original polynomial term by term.

  • Forgetting the GCF, or leaving it out of the final answer: 3x² − 12 is 3(x − 2)(x + 2), not (x − 2)(x + 2).
  • Applying the difference of squares to a sum: x² + 9 is not (x + 3)(x − 3).
  • Choosing numbers with the right product but the wrong sum, especially with negative signs.
  • Stopping too early: x⁴ − 16 = (x² − 4)(x² + 4) still factors to (x − 2)(x + 2)(x² + 4).
  • Confusing factoring with solving: the factored form is an expression; solutions come only after setting it equal to zero.

Practice problems with answers

Try each problem before reading the answer, then check by expanding.

  1. 1. x² + 7x + 12

    Show answer

    (x + 3)(x + 4)

  2. 2. 3x² − 12

    Show answer

    3(x − 2)(x + 2)

  3. 3. x³ + 27

    Show answer

    (x + 3)(x² − 3x + 9)

  4. 4. 2x² − x − 6

    Show answer

    (2x + 3)(x − 2)

  5. 5. x³ − 2x² − 9x + 18

    Show answer

    (x − 2)(x − 3)(x + 3)

Frequently asked questions

What is the first step in factoring any polynomial?

Take out the greatest common factor. It simplifies the rest of the work and is required for a complete factorization.

How do you know when a polynomial is completely factored?

When no factor can be factored further over the numbers you are working with, usually the integers. Check each factor: a difference of squares, a trinomial or a common factor means you can keep going.

Can every polynomial be factored?

Not over the integers. x² + x + 1, for example, has no integer factors. Over the complex numbers every polynomial factors into linear factors, but in most algebra courses you stop at integer or real factors.

How do you factor a polynomial with four terms?

Try grouping: split the terms into two pairs, factor each pair, and take out the common binomial. For example x³ + 3x² + 2x + 6 = (x + 3)(x² + 2).

Stuck on a different problem? Try the AI math solver with steps or browse more math guides.