Allday Education

Difference of Squares

A difference of squares is any expression that looks like a2b2a^2 - b^2 — one perfect square minus another. Expressions like x225x^2 - 25, x249x^2 - 49, and 9x249x^2 - 4 all fit. They matter because they follow one clean pattern: a2b2=(a+b)(ab)a^2 - b^2 = (a + b)(a - b). Learn that one identity and you can multiply these binomials instantly and factor them instantly, no FOIL required.

The pattern shows up everywhere in Algebra 1 — factoring, solving quadratics, simplifying fractions with variables. It's also the fastest pattern on any test, because once you recognize it there's nothing left to compute except two square roots.

Why the middle terms cancel

Multiply (a+b)(ab)(a + b)(a - b) with FOIL and watch what happens: aa=a2a \cdot a = a^2, then a(b)=aba \cdot (-b) = -ab, then ba=+abb \cdot a = +ab, then b(b)=b2b \cdot (-b) = -b^2. The two middle terms, ab-ab and +ab+ab, are opposites — they cancel completely. What's left is just a2b2a^2 - b^2.

That cancellation is the whole trick. It only happens because the two binomials have the same two terms with opposite signs between them. (x+4)(x4)(x + 4)(x - 4) cancels; (x+4)(x3)(x + 4)(x - 3) does not.

How to recognize one

An expression is a difference of squares when it passes three checks: exactly two terms, a subtraction between them, and both terms are perfect squares. x225x^2 - 25 passes: x2x^2 is a square and 25=5225 = 5^2. So does 9x2169x^2 - 16, because 9x2=(3x)29x^2 = (3x)^2 and 16=4216 = 4^2.

To factor, take the square root of each term and write the answer twice — once with a plus, once with a minus: x225=(x+5)(x5)x^2 - 25 = (x + 5)(x - 5). The order of the factors doesn't matter.

Watch for a common factor first. 3x2483x^2 - 48 doesn't look like two perfect squares, but pulling out the 33 gives 3(x216)3(x^2 - 16), and now the inside factors: 3(x+4)(x4)3(x + 4)(x - 4). Always check for a greatest common factor before checking the pattern.

A sum of squares does not factor

The pattern needs the minus sign. x2+25x^2 + 25 is a sum of squares, and it does not factor over the real numbers — there is no pair of binomials with real coefficients that multiplies to it. If you try (x+5)(x+5)(x + 5)(x + 5) you get x2+10x+25x^2 + 10x + 25, which has a middle term. On a multiple-choice question, x2+b2x^2 + b^2 staying unfactored is often the point being tested.

Worked examples

Example 1: multiplying with the pattern

Multiply (x+5)(x5)(x + 5)(x - 5).

Recognize the pattern — same terms, opposite signs(a+b)(ab)=a2b2(a + b)(a - b) = a^2 - b^2
Here a=xa = x and b=5b = 5x252x^2 - 5^2
Simplifyx225x^2 - 25
Check with FOIL: x25x+5x25=x225x^2 - 5x + 5x - 25 = x^2 - 25

Answer: x225x^2 - 25

Example 2: factoring a basic difference of squares

Factor x249x^2 - 49.

Both terms are perfect squares with a minus between themx249=x272x^2 - 49 = x^2 - 7^2
Square root of each term: xx and 77
Write one factor with plus, one with minus(x+7)(x7)(x + 7)(x - 7)
Check: (x+7)(x7)=x249(x + 7)(x - 7) = x^2 - 49

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

Example 3: a coefficient on the squared term

Factor 9x2169x^2 - 16.

Rewrite each term as a square9x216=(3x)2429x^2 - 16 = (3x)^2 - 4^2
Square roots are 3x3x and 44
Apply the pattern(3x+4)(3x4)(3x + 4)(3x - 4)
Check: (3x)(3x)=9x2(3x)(3x) = 9x^2 and (4)(4)=16(4)(-4) = -16; the middle terms 12x+12x-12x + 12x cancel ✓

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

Example 4: pull out the common factor first

Factor 3x2483x^2 - 48 completely.

Factor out the greatest common factor, 333(x216)3(x^2 - 16)
The inside is now a difference of squaresx216=(x+4)(x4)x^2 - 16 = (x + 4)(x - 4)
Write the complete factorization3(x+4)(x4)3(x + 4)(x - 4)
Check: 3(x216)=3x2483(x^2 - 16) = 3x^2 - 48

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

Try one yourself

Common questions

How do I know a number is a perfect square?

It's the square of a whole number: 1,4,9,16,25,36,49,64,81,100,1, 4, 9, 16, 25, 36, 49, 64, 81, 100, \ldots For variable terms, any even exponent is a perfect square — x6=(x3)2x^6 = (x^3)^2. If both terms pass this check and there's a minus between them, the pattern applies.

Does (x5)(x+5)(x - 5)(x + 5) give the same answer as (x+5)(x5)(x + 5)(x - 5)?

Yes. Multiplication order doesn't matter, so both equal x225x^2 - 25. When you factor, you can write the plus factor or the minus factor first.

Can I factor x220x^2 - 20?

Not with this pattern, because 2020 is not a perfect square. In Algebra 1, a two-term expression only factors this way when both terms are perfect squares. x220x^2 - 20 stays as it is (you'd need square roots of non-perfect squares to break it down, which comes later).

Want the video version?

Allday Everyday Math has video lessons, practice, and an AI tutor for every topic, Pre-Algebra through Algebra 2.

Try it for $1