The difference of squares is a factoring pattern: a squared minus b squared always factors as (a minus b) times (a plus b). Learn why the pattern works, how to spot it (two perfect squares separated by subtraction), and see worked examples.
The difference of squares
The difference of squares is a special factoring pattern: whenever you see one perfect square subtracted from another, a² − b², it always factors as (a − b)(a + b). Recognizing this pattern lets you skip the usual trial-and-error of factoring.
a²−b² always factors as (a−b)(a+b), shown here with x²−25.
Why it works
Multiply (a − b)(a + b) out with binomial multiplication: a² + ab − ab − b². The middle terms (+ab and −ab) cancel, leaving exactly a² − b² — which is why the pattern always holds.
Spotting the pattern
Look for two things: both terms must be perfect squares, and they must be separated by subtraction (never addition — a² + b² does not factor this way). For x² − 25, both x² and 25 are perfect squares (of x and 5), so it factors as (x − 5)(x + 5).
More examples
4x² − 9 = (2x)² − 3² = (2x − 3)(2x + 3)
16 − y² = 4² − y² = (4 − y)(4 + y)
This pattern comes up often alongside factoring by grouping and other special factoring cases.