The Difference of Two Squares

Multiply 43 \times 37 in your head — faster than reaching for a calculator. The two numbers sit either side of 40, and a single pattern collapses the whole thing to 40^2 - 3^2 = 1591. That shortcut is the difference of two squares, and the very same pattern runs quietly through simplifying fractions, solving equations and even calculus.

Expand (x + 3)(x - 3) and watch closely. Using FOIL — first, outer, inner, last — you get four terms:

(x + 3)(x - 3) = x^2 \;\underbrace{-\,3x + 3x}_{\text{annihilate!}}\; - 9 = x^2 - 9

The two middle terms are -3x and +3x — equal and opposite, so they annihilate each other and vanish without trace. What's left is strangely clean: a square minus a square, with no x-term in the middle at all. That "missing middle" is the fingerprint of this pattern.

Here's why it matters: you can run the trick backwards. Any time you spot one square subtracted from another square — x^2 - 9, 4x^2 - 25, even the plain number 51 \times 49 in disguise — it factorises instantly, in a single step, no trial and error:

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

This is quite possibly the most-recycled identity in all of algebra. It reappears when you simplify fractions, rationalise surds, solve equations, integrate in calculus, and even in the mental-arithmetic tricks stage performers use. Learn to spot it on sight and it will pay you back for years.

Watch the middle vanish — in general

One example could be a fluke, so let's do it with letters and see that the cancellation always happens. Expand (x + a)(x - a) term by term:

\begin{aligned} (x + a)(x - a) &= x \cdot x \;+\; x \cdot (-a) \;+\; a \cdot x \;+\; a \cdot (-a) \\ &= x^2 - ax + ax - a^2 \\ &= x^2 - a^2 \end{aligned}

The outer term -ax and the inner term +ax are always equal and opposite — one bracket has +a, the other -a, and that sign difference is precisely what kills the middle. Compare this with (x + a)(x + a) = x^2 + 2ax + a^2, where both middles have the same sign and pile up instead of cancelling. The minus sign is doing all the work.

So the identity cuts both ways, and you should be fluent in both directions:

Why it works — an area picture

Algebra says the middle terms cancel; geometry shows you the identity with scissors and paper. Start with a square of side a — its area is a^2 — and snip a small square of side b out of one corner. The L-shaped piece left over has area exactly a^2 - b^2: that's the difference of two squares, made of actual squares.

Now cut the L into two rectangles and slide the thin one round to the end. The pieces fit together perfectly into a single rectangle that is (a + b) wide and (a - b) tall. Nothing was added and nothing was thrown away — the same two pieces, rearranged — so the two areas must be equal: a^2 - b^2 = (a + b)(a - b). Step through the dissection below and watch it happen.

The Greeks knew this picture over two thousand years ago — a version of it appears in Euclid's Elements (Book II), written around 300 BC, long before anyone wrote algebra with letters. You are learning one of the oldest tricks in mathematics.

Factorising: three levels of disguise

Factorising with this pattern is a recognition game: can you see both terms as perfect squares? Take the square root of each term to find a and b, then write the two brackets. The disguises get progressively sneakier.

Level 1 — plain sight. x^2 - 49. Both terms are obviously squares: x^2 = (x)^2 and 49 = 7^2. So:

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

Level 2 — a coefficient in front. 4x^2 - 25. The first term isn't just x^2, but it is still a perfect square: 4x^2 = (2x)^2, because (2x)^2 = 2x \times 2x = 4x^2. And 25 = 5^2. So here a = 2x and b = 5:

4x^2 - 25 = (2x)^2 - 5^2 = (2x + 5)(2x - 5)

The key move at this level is recognising the whole first term as a square — coefficient and all. 9x^2 = (3x)^2, 16x^2 = (4x)^2, 100x^2 = (10x)^2. Check by squaring: (3x)^2 = 9x^2 ✓.

Level 3 — a square hiding inside a square. x^4 - 16. At first glance neither term looks like the familiar pattern — but x^4 = (x^2)^2 (a power with an even exponent is always a perfect square) and 16 = 4^2. Apply the identity with a = x^2, b = 4:

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

Done? Not yet! Look at that second bracket: x^2 - 4 is itself a difference of two squares. Factorise again:

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

Two layers, peeled one at a time. The first bracket x^2 + 4 is a sum of squares, so it stays put — three factors, and now it's fully factorised. Whenever you finish a factorising pass, glance back at each bracket and ask: can any of these split again?

These three mistakes catch students out year after year:

The arithmetic party trick

The identity isn't just for algebra homework — it turns certain multiplications into mental arithmetic. Try 51 \times 49. It looks like long-multiplication territory, until you notice the two numbers sit symmetrically around 50:

51 \times 49 = (50 + 1)(50 - 1) = 50^2 - 1^2 = 2500 - 1 = 2499

In your head, in two seconds. It works whenever two numbers straddle an easy middle:

73 \times 67 = (70 + 3)(70 - 3) = 4900 - 9 = 4891

It also runs the other way — subtracting big squares without squaring anything. Asked for 102^2 - 98^2, do not compute 102^2 = 10404 and 98^2 = 9604 and subtract. Factorise instead:

102^2 - 98^2 = (102 + 98)(102 - 98) = 200 \times 4 = 800

A sum, a difference, one easy multiplication. Examiners love setting these precisely because the "long way" is slow and error-prone while the factorised way is instant — a question like 7.5^2 - 2.5^2 = 10 \times 5 = 50 takes longer to read than to solve.

With this very identity! Before cheap calculators (well into the 20th century), engineers and accounting clerks used books of quarter-square tables. The trick: rearrange the difference of two squares into a multiplication machine,

a \times b = \frac{(a + b)^2 - (a - b)^2}{4}

(expand the two squares and check it — everything cancels except 4ab, divided by 4). So to multiply any two numbers, you looked up the quarter-square \tfrac{n^2}{4} of their sum and of their difference in the table, and subtracted. One subtraction instead of a whole long multiplication — and lookup tables of squares are easy to print. Stage "lightning calculators" used the same idea live: asked for 996 \times 1004, they'd silently compute 1000^2 - 4^2 = 1{,}000{,}000 - 16 = 999{,}984 and answer before the audience finished writing the question down.

See it explained

Sal Khan walks through the same pattern from the expanding side — multiply (a + b)(a - b), watch the middle cancel, then use the result to factorise examples. A good second voice if the idea hasn't clicked yet: