How to Factor Polynomials: 7 Methods With Examples

Factoring polynomials: GCF, trinomial, difference of squares and grouping examples

Factoring a polynomial means writing it as a product of simpler polynomials, so x² + 5x + 6 becomes (x + 2)(x + 3). This guide shows how to factor polynomials step by step with every method you need: the greatest common factor (GCF), factoring by grouping, factoring trinomials, the ac method, perfect squares, the difference of squares, the sum and difference of cubes and higher-degree polynomials. It starts with a simple checklist that tells you which method to use.

In this guide
  1. What factoring means
  2. Which method to use
  3. GCF
  4. Factoring by grouping
  5. Trinomials x² + bx + c
  6. The ac method
  7. Perfect square trinomials
  8. Difference of squares
  9. Sum and difference of cubes
  10. Higher-degree polynomials
  11. Prime polynomials
  12. Solving by factoring
  13. Common mistakes
  14. Practice problems
  15. FAQ

What Does It Mean to Factor a Polynomial?

To factor a polynomial is to rewrite it as a multiplication of smaller polynomials, called factors. It is the reverse of multiplying out, which is also called expanding.

DirectionExampleName
Product → sum(x + 2)(x + 3) = x² + 5x + 6Expanding (multiplying)
Sum → productx² + 5x + 6 = (x + 2)(x + 3)Factoring

A polynomial is factored completely when no factor can be broken down any further. Factoring is used to simplify algebraic expressions and fractions and to find the roots of polynomials.

In short: Factoring turns a sum into a product. You can always check a factored answer by multiplying it back out.

How to Factor Polynomials: Which Method to Use

Follow these steps in order for any polynomial. They match the general factoring strategy taught in most algebra courses.

  1. Take out the GCF first, if the terms share one.
  2. Count the terms that are left.
  3. Two terms: look for a difference of squares, a sum of cubes or a difference of cubes.
  4. Three terms: check for a perfect square trinomial. If it is not one, use x² + bx + c factoring when the leading coefficient is 1, or the ac method when it is not.
  5. Four terms: factor by grouping.
  6. Check: make sure no factor can be factored again, then multiply out to confirm.
Flowchart for factoring polynomials: take out the GCF, count the terms, then use difference of squares or cubes for two terms, trinomial methods for three terms and grouping for four terms, and check by multiplying
The factoring checklist as a flowchart. Start at the top for any polynomial.
Number of termsPattern to look forMethod
AnyAll terms share a factorGCF
2a² − b²Difference of squares
2a³ + b³ or a³ − b³Sum or difference of cubes
3a² ± 2ab + b²Perfect square trinomial
3x² + bx + cTwo numbers that multiply to c and add to b
3ax² + bx + c, a ≠ 1ac method
4Two pairs with a common factorGrouping

In short: Always take out the GCF first, then let the number of terms choose the method: two terms means squares or cubes, three means a trinomial method, and four means grouping.

Method 1: Factor Out the Greatest Common Factor (GCF)

The greatest common factor is the largest number and highest power of each variable that divides every term. Divide each term by the GCF and write the GCF outside the brackets.

  1. Find the GCF of the coefficients.
  2. For each variable, take the lowest power that appears in every term.
  3. Divide every term by the GCF and write the result in brackets.

Example: 6x³ + 9x² − 3x. The GCF of 6, 9 and 3 is 3, and the lowest power of x is x¹, so the GCF is 3x. The result is 3x(2x² + 3x − 1).

Example: −4x² + 8x. When the leading term is negative, take out a negative GCF: −4x(x − 2).

Example: x(x + 2) + 5(x + 2). The common factor can be a whole bracket. Take out (x + 2) to get (x + 2)(x + 5).

In short: Find the largest number and the lowest power of each variable shared by every term, and write it outside the brackets. Do this before any other method.

Method 2: Factoring by Grouping (Four Terms)

Use grouping when a polynomial has four terms. Split it into two pairs, take the GCF out of each pair, then take out the common bracket.

Example: x³ + 3x² + 2x + 6 → (x³ + 3x²) + (2x + 6) → x²(x + 3) + 2(x + 3) → (x + 3)(x² + 2).

Example: 2xy + 6x − y − 3 → 2x(y + 3) − 1(y + 3) → (y + 3)(2x − 1). Take out −1 from the second pair so the brackets match.

If the two brackets do not match, try reordering the terms before you group them.

In short: Group four terms into two pairs, factor each pair, and the matching bracket becomes one factor.

Method 3: Factoring Trinomials of the Form x² + bx + c

When the leading coefficient is 1, find two numbers that multiply to c and add to b. Those two numbers go into the brackets: (x + m)(x + n).

Example: x² + 7x + 12. Pairs that multiply to 12 are 1 and 12, 2 and 6, and 3 and 4. Only 3 + 4 = 7, so the answer is (x + 3)(x + 4).

Example: x² − x − 12. You need a product of −12 and a sum of −1, which gives −4 and 3. The answer is (x − 4)(x + 3).

The signs of b and c tell you the signs of the two numbers:

Sign of cSign of bThe two numbersExample
++Both positivex² + 7x + 12 = (x + 3)(x + 4)
+−Both negativex² − 8x + 15 = (x − 3)(x − 5)
−+Opposite signs, bigger one positivex² + 2x − 15 = (x + 5)(x − 3)
−−Opposite signs, bigger one negativex² − x − 12 = (x − 4)(x + 3)

In short: For x² + bx + c, list the factor pairs of c and pick the pair that adds to b. The signs of b and c tell you which signs to use.

Method 4: The ac Method for ax² + bx + c

When the leading coefficient a is not 1, use the ac method, which is also called splitting the middle term.

  1. Multiply a × c.
  2. Find two numbers that multiply to ac and add to b.
  3. Split bx into two terms using those numbers.
  4. Factor the four terms by grouping.

Example: 6x² + 7x − 3. Here ac = 6 × (−3) = −18. The numbers 9 and −2 multiply to −18 and add to 7. Split the middle term: 6x² + 9x − 2x − 3 = 3x(2x + 3) − 1(2x + 3) = (2x + 3)(3x − 1).

Check by multiplying: (2x + 3)(3x − 1) = 6x² − 2x + 9x − 3 = 6x² + 7x − 3. ✓

In short: For ax² + bx + c, find two numbers that multiply to a × c and add to b, split the middle term with them, then factor by grouping.

Method 5: Perfect Square Trinomials

A trinomial is a perfect square when the first and last terms are squares and the middle term is twice the product of their roots.

PatternExample
a² + 2ab + b² = (a + b)²x² + 10x + 25 = (x + 5)²
a² − 2ab + b² = (a − b)²4x² − 12x + 9 = (2x − 3)²

In 4x² − 12x + 9, the roots of the end terms are 2x and 3, and 2 × 2x × 3 = 12x. The middle sign is minus, so the answer is (2x − 3)².

Method 6: Difference of Squares

A binomial of the form a² − b² always factors as (a + b)(a − b).

Example: 9x² − 49 = (3x)² − 7² = (3x + 7)(3x − 7).

Example: x⁴ − 16 = (x² + 4)(x² − 4) = (x² + 4)(x + 2)(x − 2). The factor x² − 4 is another difference of squares, so keep going.

A sum of squares such as x² + 4 does not factor using real numbers.

In short: a² − b² = (a + b)(a − b). Keep factoring if a bracket is still a difference of squares. A sum of squares does not factor.

Method 7: Sum and Difference of Cubes

PatternFormulaExample
Sum of cubesa³ + b³ = (a + b)(a² − ab + b²)x³ + 8 = (x + 2)(x² − 2x + 4)
Difference of cubesa³ − b³ = (a − b)(a² + ab + b²)27x³ − 1 = (3x − 1)(9x² + 3x + 1)

To remember the signs, use SOAP: the first sign is the Same as in the original, the second is the Opposite, and the last is Always Positive.

Example: 8x³ + 27 = (2x)³ + 3³ = (2x + 3)(4x² − 6x + 9).

In short: Write both terms as cubes, then use a³ ± b³ = (a ± b)(a² ∓ ab + b²). The signs follow SOAP: same, opposite, always positive.

Factoring Completely and Higher-Degree Polynomials

Many polynomials need more than one method. Start with the GCF, then keep factoring each bracket.

Example: 2x³ − 18x = 2x(x² − 9) = 2x(x + 3)(x − 3). GCF first, then the difference of squares.

Example: 3x² − 12x + 12 = 3(x² − 4x + 4) = 3(x − 2)². GCF first, then the perfect square.

Quadratic form. If the exponents are 4 and 2, treat x² as one unknown. x⁴ − 5x² + 4 factors like u² − 5u + 4 = (u − 1)(u − 4), so x⁴ − 5x² + 4 = (x² − 1)(x² − 4) = (x − 1)(x + 1)(x − 2)(x + 2).

Cubics with no pattern. Test small whole numbers that divide the constant term. If P(a) = 0, then (x − a) is a factor (the Factor Theorem). For x³ − 6x² + 11x − 6, P(1) = 1 − 6 + 11 − 6 = 0, so (x − 1) is a factor. Dividing leaves x² − 5x + 6, which gives (x − 1)(x − 2)(x − 3).

In short: Factor in layers: take out the GCF, apply a pattern, then check every bracket again. For cubics, find one root by testing divisors of the constant term.

Prime Polynomials: When a Polynomial Cannot Be Factored

A polynomial that cannot be factored using whole numbers is called prime, or irreducible. Examples are x² + 4 (a sum of squares) and x² + x + 1, because no two whole numbers multiply to 1 and add to 1.

For a trinomial ax² + bx + c, work out b² − 4ac. If it is not a perfect square (0, 1, 4, 9, 16 and so on), the trinomial will not factor with whole numbers. For x² + x + 1, b² − 4ac = 1 − 4 = −3, so it is prime.

How to Solve Polynomial Equations by Factoring

Factoring is the fastest way to solve many polynomial equations. Move every term to one side so the equation equals 0, factor, then set each factor equal to 0. This works because if a product is 0, at least one factor must be 0.

Example: x² − 5x − 14 = 0 → (x − 7)(x + 2) = 0 → x − 7 = 0 or x + 2 = 0 → x = 7 or x = −2.

For the full method, see our guide on how to solve for x. To check your answers, the free equation solver solves linear, quadratic and cubic equations with every step shown. The solutions are also the zeros of the function.

In short: Set the equation equal to 0, factor it, and set each factor equal to 0 to get the solutions.

Common Factoring Mistakes

  • Forgetting the GCF. 2x² + 10x + 12 is easier as 2(x² + 5x + 6) = 2(x + 2)(x + 3).
  • Stopping too early. x⁴ − 16 = (x² + 4)(x² − 4) is not finished, because x² − 4 still factors.
  • Factoring a sum of squares. x² + 9 is not (x + 3)(x + 3). That product equals x² + 6x + 9.
  • Mixing up signs. x² − x − 12 is (x − 4)(x + 3), not (x + 4)(x − 3).
  • Losing the 1 in grouping. x(x + 2) + (x + 2) is (x + 2)(x + 1), not (x + 2)x.
  • Not checking. Multiply your factors back out. If you do not get the original polynomial, something is wrong.

Factoring Practice Problems (With Answers)

1. 12x² − 8x

4x(3x − 2). The GCF is 4x.

2. x² + 9x + 20

(x + 4)(x + 5). 4 × 5 = 20 and 4 + 5 = 9.

3. x² − 2x − 35

(x − 7)(x + 5). −7 × 5 = −35 and −7 + 5 = −2.

4. 2x² + 5x − 3

(2x − 1)(x + 3). ac = −6, and the numbers are 6 and −1.

5. 25x² − 16

(5x + 4)(5x − 4). A difference of squares.

6. x³ − 27

(x − 3)(x² + 3x + 9). A difference of cubes.

7. x³ + 2x² − 4x − 8

(x + 2)²(x − 2). Grouping gives x²(x + 2) − 4(x + 2) = (x + 2)(x² − 4), then the difference of squares.

8. 5x³ − 20x

5x(x + 2)(x − 2). GCF first, then the difference of squares.

Factoring Polynomials: Frequently Asked Questions

What is the first step in factoring a polynomial?

Always look for a greatest common factor (GCF) first and take it out. This makes every other method easier and is the step most often forgotten.

How do you factor a polynomial with 4 terms?

Use factoring by grouping. Split the four terms into two pairs, factor the GCF out of each pair, then take out the bracket they share. For example, x³ + 3x² + 2x + 6 = (x + 3)(x² + 2).

How do you factor a trinomial when a is not 1?

Use the ac method. Multiply a × c, find two numbers that multiply to ac and add to b, split the middle term with them, then factor by grouping. For example, 6x² + 7x − 3 = (2x + 3)(3x − 1).

Can every polynomial be factored?

No. Some polynomials are prime, meaning they cannot be factored using whole numbers. Examples are x² + 4 and x² + x + 1. If b² − 4ac is not a perfect square, a trinomial will not factor with whole numbers.

What is the difference of squares formula?

a² − b² = (a + b)(a − b). For example, x² − 49 = (x + 7)(x − 7). A sum of squares such as x² + 49 does not factor with real numbers.

How do you check if you factored correctly?

Multiply the factors back together. If the result is the original polynomial, the factoring is correct. Also check that no factor can be factored again.

Sources and Further Reading

Every answer in this guide was checked by multiplying the factors back out on the CalcSolver calculator. New to the topic? Read what a polynomial is first, keep the basic algebra formulas close, or browse all our algebra guides.

Factoring is the key step when you simplify algebraic fractions: factor the top and bottom, then cancel.

Check your working in seconds

Type any problem from this guide into the free CalcSolver calculator and see the answer, with fractions, instantly.