Skip to content
Tutorials Center
My learning

Topics

Lesson 24 of 37 · Factoring

Factoring Out the GCF and Factoring by Grouping

Learn what factoring means, how to pull out the greatest common factor, and how to factor four-term polynomials by grouping, with checks in code.

Factoring is multiplication run backwards. When you multiply, you turn 3x(x + 2) into 3x² + 6x. When you factor, you start with 3x² + 6x and rewrite it as a product, 3x(x + 2).

Why bother? A product is easier to work with than a sum. If a product equals zero, one of its factors must be zero, and that idea will let you solve quadratic equations in Chapter 7. First you need the tools, and the first tool is always the same: look for something every term shares.

The greatest common factor

The greatest common factor (GCF) of several terms is the largest expression that divides every one of them.

To find it:

  1. Find the largest whole number that divides all the coefficients.
  2. For each variable that appears in every term, take the smallest exponent it has.
  3. Multiply these together.

Example 1. Find the GCF of 12x³, 18x² and 30x.

  • Numbers: the largest divisor of 12, 18 and 30 is 6.
  • Variable x: exponents are 3, 2 and 1, so the smallest is 1, giving x.
  • GCF = 6x.

To factor, write the GCF outside parentheses and divide each term by it:

12x³ + 18x² + 30x = 6x(2x² + 3x + 5)

Check by multiplying back: 6x · 2x² = 12x³, 6x · 3x = 18x², 6x · 5 = 30x. It works.

Always factor out the GCF first, before trying any other method. If the first term is negative, it is usually neater to factor out a negative GCF: −4x² + 8x = −4x(x − 2).

Example 2. Factor 10a³b² − 15a²b³. The numbers have GCF 5; a has smallest exponent 2; b has smallest exponent 2. So the GCF is 5a²b², and

10a³b² − 15a²b³ = 5a²b²(2a − 3b).

If a term equals the GCF itself, it becomes 1 inside the parentheses, not 0: x² + x = x(x + 1).

Python Find the GCF of a list of terms

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Factoring by grouping

Sometimes the GCF is a whole binomial. Take x(x + 3) + 5(x + 3). Both terms contain (x + 3), so

x(x + 3) + 5(x + 3) = (x + 3)(x + 5).

This gives a method for four-term polynomials: split into two pairs, factor the GCF out of each pair, and hope the same binomial appears in both.

Example 3. Factor x³ + 4x² + 3x + 12.

  1. Pair: (x³ + 4x²) + (3x + 12).
  2. Factor each pair: x²(x + 4) + 3(x + 4).
  3. Factor out the shared binomial: (x + 4)(x² + 3).

Example 4. Factor 2ax − 6a + x − 3.

  1. Pair: (2ax − 6a) + (x − 3).
  2. Factor: 2a(x − 3) + 1(x − 3). Note the 1: the second pair has GCF 1.
  3. Result: (x − 3)(2a + 1).

If the pairs show opposite binomials such as (x − 2) and (2 − x), factor out a −1 from one pair to make them match.

If grouping does not give a common binomial, try swapping the order of the middle terms before you decide the polynomial cannot be factored this way.

Python Check factored forms by expanding

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. What is the GCF of 8x² and 12x³?

    The largest common divisor of 8 and 12 is 4, and the smallest exponent of x is 2, so the GCF is 4x².
  2. 2. Factor 15x² − 10x.

    The GCF is 5x. Dividing each term by 5x gives 3x and 2.
  3. 3. Factor x² + x.

    Dividing the second term x by the GCF x leaves 1, not 0.
  4. 4. Factor by grouping: x³ + 2x² + 5x + 10.

    x²(x + 2) + 5(x + 2) = (x + 2)(x² + 5).

Summary

  • Factoring rewrites a sum as a product; always check by multiplying back.
  • The GCF takes the largest common number and the smallest exponent of each shared variable.
  • Factor the GCF out first, every time.
  • Four terms: group in pairs, factor each pair, then factor out the shared binomial.

Next: Factoring Trinomials