Factoring the Difference of Squares

Factoring the difference of squares means rewriting a square minus a square as a sum times a difference. The rule is a^2 - b^2 = (a + b)(a - b). Find what is squared in each term, then write one plus and one minus. For example, x^2 - 25 = (x + 5)(x - 5). It is a special product run backward.

Before this lesson: You should know special products of binomials, factoring out the GCF and square roots of perfect squares.

Extra practice: The Algebra 1 Unit 7 Practice Pack (Part 2) has printable problems, answer keys and a cheat sheet for this unit.

What Is a Difference of Squares?

A perfect square is a number or term that is something times itself. For example, 49 is 7^2, and 9x^2 is (3x)^2. A difference is the answer to a subtraction.

So a difference of squares is one perfect square minus another. x^2 - 9 is one. It has two terms, both are squares, and there is a minus sign between them.

In Special Products of Binomials, you saw that (x + 3)(x - 3) = x^2 - 9. The middle terms cancel. Factoring runs that pattern backward.

A square with side x has a small 3 by 3 square cut from one corner, leaving an L-shape with area x² − 9. The L-shape is split into two pieces. The green piece is moved to the side of the blue piece. Together they form a rectangle that is x + 3 wide and x − 3 tall, so x² − 9 = (x + 3)(x − 3).
Cut a 3 by 3 square from an x by x square. The piece that is left rearranges into an (x + 3) by (x − 3) rectangle.
Perfect squaresWhat is squared
1, 4, 9, 16, 25, 36, 49, 64, 81, 1001, 2, 3, 4, 5, 6, 7, 8, 9, 10
x^2x
4x^22x
25y^25y
x^4x^2

The Difference of Squares Formula

a^2 - b^2 = (a + b)(a - b)

Here a is what is squared in the first term, and b is what is squared in the second term. The two factors are the same except for the sign in the middle.

Steps for factoring a difference of squares

  1. Factor out the GCF, if there is one.
  2. Check the pattern: two terms, both perfect squares, and a minus sign between them.
  3. Find a and b. Take the square root of each term.
  4. Write (a + b)(a - b).
  5. Check if a factor can be factored again.
  6. Check by multiplying.

Worked Examples

Example 1: A basic difference of squares

Factor x^2 - 49.

Step 1. Check the form. There are two terms, and the sign between them is minus.

x^2 - 49 = (x)^2 - 7^2

Step 2. Both terms are perfect squares: x^2 = (x)^2 and 49 = 7^2. Write them that way.

= (x + 7)(x - 7)

Step 3. Use a^2 - b^2 = (a + b)(a - b) with a = x and b = 7.

Answer: (x + 7)(x - 7)

Check: Multiply (see multiplying binomials): (x + 7)(x - 7) = x^2 - 7x + 7x - 49 = x^2 - 49. The middle terms cancel.

Example 2: A coefficient in the first term

Factor 9x^2 - 16.

\sqrt{9} = 3

Step 1. Take the square root of the whole first term, coefficient and all.

9x^2 = (3x)^2

Write the first term as a square.

9x^2 - 16 = (3x)^2 - 4^2

Step 2. Write the second term as a square: 16 = 4^2.

= (3x + 4)(3x - 4)

Step 3. Use the pattern with a = 3x and b = 4.

Answer: (3x + 4)(3x - 4)

Check: (3x + 4)(3x - 4) = 9x^2 - 12x + 12x - 16 = 9x^2 - 16.

Example 3: Two variables

Factor 25a^2 - 36b^2.

25a^2 = (5a)^2

Step 1. Write the first term as a square.

25a^2 - 36b^2 = (5a)^2 - (6b)^2

Step 2. Write the second term as a square: 36b^2 = (6b)^2.

= (5a + 6b)(5a - 6b)

Step 3. Use the pattern, with 5a in place of a and 6b in place of b.

Answer: (5a + 6b)(5a - 6b)

Example 4: Factor out the GCF first

Factor 3x^2 - 75.

3x^2 - 75 = 3(x^2 - 25)

Step 1. Neither 3 nor 75 is a perfect square. But both terms share a factor of 3. Take it out first (see factoring out the GCF).

= 3[(x)^2 - 5^2]

Step 2. The part inside is a difference of squares: x^2 - 25 = (x)^2 - 5^2.

= 3(x + 5)(x - 5)

Step 3. Use the pattern with a = x and b = 5. Keep the 3 in front. It is one of the factors.

Answer: 3(x + 5)(x - 5)

Example 5: Word problem

A square garden is x feet on each side. A square patio, 4 feet on each side, takes up one corner. Write the area of the garden that is left in factored form. Then find it when x = 10.

Step 1. Find the whole area. A square with side x has area x^2 square feet.

4^2 = 16

Step 2. Find the patio’s area.

x^2 - 16

Step 3. Subtract to find the area left.

x^2 - 16 = (x + 4)(x - 4)

Step 4. It is a difference of squares with a = x and b = 4.

(10 + 4)(10 - 4) = 14 \cdot 6

Step 5. Substitute 10 for x in each factor.

14 \cdot 6 = 84

Step 6. Multiply.

Answer: The area left is (x + 4)(x - 4) square feet. When x = 10, there are 84 square feet left.

Check: 10^2 - 16 = 100 - 16 = 84.

Common Mistakes

MistakeExample of the errorFix
Writing a square of a binomialx^2 - 25 = (x - 5)^2(x - 5)^2 = x^2 - 10x + 25. Use one plus and one minus: (x + 5)(x - 5).
Not taking the root of the coefficient9x^2 - 16 = (9x + 4)(9x - 4)The root of 9x^2 is 3x. The answer is (3x + 4)(3x - 4).
Factoring a sum of squaresx^2 + 25 = (x + 5)(x - 5)(x + 5)(x - 5) = x^2 - 25. A sum of squares like x^2 + 25 is prime.
Skipping the GCF2x^2 - 18 is not a difference of squaresTake out 2 first: 2(x^2 - 9) = 2(x + 3)(x - 3).
Stopping too soonx^4 - 81 = (x^2 + 9)(x^2 - 9)x^2 - 9 factors again: (x^2 + 9)(x + 3)(x - 3).

More Ways to Use the Pattern

Higher powers

Any even power is a perfect square. For example, x^4 = (x^2)^2 and y^6 = (y^3)^2. So x^6 - 4 = (x^3 + 2)(x^3 - 2).

Sometimes the minus factor is another difference of squares. Then factor again, as in x^4 - 81 above.

Mental math

The pattern also makes some products easy. To find 52 \cdot 48, write it as (50 + 2)(50 - 2). That is 50^2 - 2^2 = 2{,}500 - 4 = 2{,}496.

Which binomials do not work

BinomialDifference of squares?Why
x^2 - 64YesBoth are squares, with a minus
x^2 + 64NoIt is a sum, not a difference
x^2 - 8No8 is not a perfect square
x^3 - 9Nox^3 is not a perfect square

If none of the rules fit, check the other methods in this unit, like factoring trinomials or factoring by grouping.

Practice Problems

  1. Factor x^2 - 36.
  2. Factor y^2 - 1.
  3. Factor 4x^2 - 9.
  4. Factor 49 - m^2.
  5. Factor 16a^2 - 25b^2.
  6. Factor 5x^2 - 20.
  7. Factor x^2 + 64, or write prime.
  8. Factor 2x^3 - 50x completely.
  9. Factor x^4 - 16 completely.
  10. A square tile is x centimeters on each side. A square hole, 5 centimeters on each side, is cut out of it. Write the area left in factored form. Then find it when x = 12.
Show answers

1.

Write each term as a square: x^2 = (x)^2 and 36 = (6)^2: x^2 - 36 = (x)^2 - (6)^2

= (x + 6)(x - 6)

Use a^2 - b^2 = (a + b)(a - b), with x in place of a and 6 in place of b.

2.

Write each term as a square: y^2 = (y)^2 and 1 = (1)^2: y^2 - 1 = (y)^2 - (1)^2

= (y + 1)(y - 1)

Use a^2 - b^2 = (a + b)(a - b), with y in place of a and 1 in place of b.

3.

Write each term as a square: 4x^2 = (2x)^2 and 9 = (3)^2: 4x^2 - 9 = (2x)^2 - (3)^2

= (2x + 3)(2x - 3)

Use a^2 - b^2 = (a + b)(a - b), with 2x in place of a and 3 in place of b.

4.

Write each term as a square: 49 = (7)^2 and m^2 = (m)^2: 49 - m^2 = (7)^2 - (m)^2

= (7 + m)(7 - m)

Use a^2 - b^2 = (a + b)(a - b), with 7 in place of a and m in place of b.

Keep the order: 49 comes first.

5.

Write each term as a square: 16a^2 = (4a)^2 and 25b^2 = (5b)^2: 16a^2 - 25b^2 = (4a)^2 - (5b)^2

= (4a + 5b)(4a - 5b)

Use a^2 - b^2 = (a + b)(a - b), with 4a in place of a and 5b in place of b.

6.

5(x^2 - 4)

Factor out the GCF, 5.

5[(x)^2 - 2^2]

Write the inside as a difference of squares.

5(x + 2)(x - 2)

Use the pattern.

7.

x^2 + 64 is a sum of squares, not a difference. The pattern needs a minus sign
There is no GCF to take out either
It is prime.

8.

2x(x^2 - 25)

Factor out the GCF, 2x.

2x[(x)^2 - 5^2]

Write the inside as a difference of squares.

2x(x + 5)(x - 5)

Use the pattern.

9.

Write each term as a square: x^4 = (x^2)^2 and 16 = 4^2: (x^2)^2 - 4^2

(x^2 + 4)(x^2 - 4)

Use the pattern.

(x^2 + 4)[(x)^2 - 2^2]

x^2 - 4 is another difference of squares.

(x^2 + 4)(x + 2)(x - 2)

Use the pattern again.

x^2 + 4 is a sum of squares, so it is prime.

10.

x^2 - 25

The tile’s area is x squared, and the hole’s area is 5 squared, or 25. Subtract.

(x + 5)(x - 5)

Factor the difference of squares.

(12 + 5)(12 - 5) = 17 \cdot 7

Substitute 12 for x.

119

Multiply.

Check: 12^2 - 25 = 144 - 25 = 119
The area left is 119 square centimeters.

Want more practice? The Algebra 1 Unit 7 Practice Pack (Part 2) has 38 pages of problems on this and the other lessons in the unit, with step-by-step answers and a cheat sheet.

FAQ

How do you know if something is a difference of squares?

Check three things. It has exactly two terms, both terms are perfect squares, and they are subtracted. Take out any GCF first, because it can hide the pattern.

Can you factor a sum of squares?

Not with real numbers. A sum like x^2 + 16 is prime in Algebra 1. Its factors would need complex numbers, which come in Algebra 2.

What is the difference of squares formula?

It is a^2 - b^2 = (a + b)(a - b). The factors are a sum and a difference of the same two terms.

Does the order of the factors matter?

No. (x + 7)(x - 7) and (x - 7)(x + 7) are the same, because you can multiply in any order.

Summary

  • A difference of squares is one perfect square minus another, like x^2 - 49.
  • Use a^2 - b^2 = (a + b)(a - b).
  • Take the square root of each whole term, including the coefficient.
  • Factor out the GCF first, and factor again if a factor is still a difference of squares.
  • A sum of squares is prime. Check every answer by multiplying.

Previous lesson: Factoring by Grouping

Next lesson: Perfect Square Trinomials

Back to the Algebra 1 Index