Skip to content
Tutorials Center
My learning

Topics

Lesson 26 of 37 · Factoring

Factoring Special Patterns

Recognize and factor the difference of squares, perfect square trinomials, and the sum and difference of cubes, with worked examples and checks.

Some polynomials have a shape you can spot at a glance. They come from the special products you met in Multiplying Polynomials, now read in reverse. Recognizing them lets you factor in one step, with no searching.

Difference of squares

a² − b² = (a + b)(a − b)

You need two perfect squares with a minus between them.

  • x² − 49 = (x + 7)(x − 7)
  • 25y² − 4 = (5y + 2)(5y − 2)
  • x⁴ − 16 = (x² + 4)(x² − 4) = (x² + 4)(x + 2)(x − 2)

In the last one, the factor x² − 4 is itself a difference of squares, so factor again. Always check whether a factor can be factored further.

A sum of squares such as x² + 9 cannot be factored over the real numbers. The pattern only works with a minus sign.

Perfect square trinomials

a² + 2ab + b² = (a + b)² and a² − 2ab + b² = (a − b)²

To test a trinomial, check three things: the first term is a perfect square, the last term is a perfect square, and the middle term is twice the product of their square roots.

Example 1. x² + 10x + 25. Here a = x, b = 5, and 2ab = 10x. It matches, so it equals (x + 5)².

Example 2. 9x² − 12x + 4. Here a = 3x, b = 2, and 2ab = 12x. The middle term is negative, so it equals (3x − 2)².

Example 3. 4x² + 20x + 9. Here a = 2x, b = 3, but 2ab = 12x, not 20x. It is not a perfect square. Try ordinary trinomial factoring: (2x + 9)(2x + 1), since ac = 36 and 18 + 2 = 20.

Python Detect a perfect square trinomial

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.

Sum and difference of cubes

Two more patterns involve cubes. They are less common in Algebra 1, but worth knowing.

Text
a³ + b³ = (a + b)(a² − ab + b²)
a³ − b³ = (a − b)(a² + ab + b²)

A memory aid is "SOAP": the signs in the factored form are Same, Opposite, Always Positive. For a³ + b³ the binomial has the Same sign (+), the trinomial's middle has the Opposite sign (−), and its last term is Always Positive.

Example 4. x³ + 8: here a = x, b = 2 since 2³ = 8.

x³ + 8 = (x + 2)(x² − 2x + 4)

Example 5. 27y³ − 1: a = 3y, b = 1.

27y³ − 1 = (3y − 1)(9y² + 3y + 1)

The trinomial factor in these formulas does not factor further over the integers.

Python Verify the patterns 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. Factor x² − 81.

    Difference of squares with a = x and b = 9.
  2. 2. Which is the factored form of x² − 14x + 49?

    a = x, b = 7, and 2ab = 14x with a minus sign, so it is (x − 7)².
  3. 3. Which expression can NOT be factored over the real numbers?

    A sum of two squares has no real factors. A difference of squares and a difference of cubes both factor.
  4. 4. Factor x³ − 8.

    a³ − b³ = (a − b)(a² + ab + b²) with a = x and b = 2.

Summary

  • a² − b² = (a + b)(a − b); a sum of squares does not factor over the reals.
  • a² ± 2ab + b² = (a ± b)²; check that the middle term is exactly 2ab.
  • a³ ± b³ = (a ± b)(a² ∓ ab + b²) (use SOAP for the signs).
  • Always look for a further factorization after applying a pattern.

Next: A Factoring Strategy