Difference of squares

Multiply 4747 by 5353 in your head. It looks like a hard, two-digit multiplication — until you notice both numbers sit exactly 33 away from 5050. Write them as (50+3)(50−3)(50+3)(50-3) and the answer drops out instantly as 502−32=2500−9=249150^2-3^2=2500-9=2491, no long multiplication needed. That shortcut works because of one of the four core identities of Class 8 algebra: the difference of squares, (a+b)(a−b)=a2−b2(a+b)(a-b)=a^2-b^2. This identity says that a sum times a difference of the same two terms always collapses to just the difference of their squares — no middle term survives. It is the fastest of all the algebraic identities to expand, the standard trick for mental arithmetic on numbers equally spaced around a round number, and — read backwards — the single most useful factorising tool in the very next chapter, where an expression like 9x2−169x^2-16 is instantly seen as (3x)2−42(3x)^2-4^2 and rewritten as (3x+4)(3x−4)(3x+4)(3x-4). It sits alongside (a+b)2=a2+2ab+b2(a+b)^2=a^2+2ab+b^2 and (a−b)2=a2−2ab+b2(a-b)^2=a^2-2ab+b^2 as one of the four standard identities every Class 8 student is expected to know cold, but it behaves differently from the other two: their expansions keep a middle 2ab2ab term, while this one loses it entirely. That single difference is what makes it worth studying on its own, separately from the two square identities.

The core insight

A product of a sum and a difference of the same two terms, (a+b)(a−b)(a+b)(a-b), always collapses to a2−b2a^2-b^2 because the two middle terms of the expansion, −ab-ab and +ab+ab, are equal and opposite and cancel exactly.

The core idea

It comes straight from the distributive law. Expand (a+b)(a−b)(a+b)(a-b) term by term, the same way you would expand any product of two binomials, and watch what happens to the middle terms.

(a+b)(a−b)=a(a−b)+b(a−b)=a2−ab+ab−b2(a+b)(a-b)=a(a-b)+b(a-b)=a^2-ab+ab-b^2

where: aa and bb are any two terms — numbers, variables, or expressions — and −ab-ab, +ab+ab are the cross terms produced by expanding the brackets. Because −ab-ab and +ab+ab are equal in size and opposite in sign, they cancel completely, leaving only

a2−b2=(a+b)(a−b)a^2-b^2=(a+b)(a-b)

Only two terms survive, not three. This is what makes the identity special. Compare it with the two square identities from earlier in the chapter, where the middle term does not cancel:

(a+b)2=a2+2ab+b2(a−b)2=a2−2ab+b2(a+b)^2=a^2+2ab+b^2 \qquad (a-b)^2=a^2-2ab+b^2

where: in both square identities the two middle terms are the same sign, so they add up to 2ab2ab or −2ab-2ab instead of cancelling. Difference of squares is the only one of the three identities whose product has just two terms, both perfect squares, joined by a minus sign — that "two terms, both squares, minus in between" shape is the fastest way to recognise where the identity applies, whether you are expanding a product or, later, factorising an expression.

It runs in both directions. Read left to right, (a+b)(a−b)=a2−b2(a+b)(a-b)=a^2-b^2 lets you expand a product without multiplying term by term. Read right to left, a2−b2=(a+b)(a−b)a^2-b^2=(a+b)(a-b) lets you factorise any expression that is one perfect square minus another: the answer is always (sum of the square roots) times (difference of the square roots). Both readings are the same fact, and both are tested constantly in Class 8 — expansion in this chapter, factorisation in the very next one.

It is the reason "equally spaced" multiplication tricks work. Whenever two numbers being multiplied are the same distance above and below some convenient middle value aa, write them as a+ba+b and a−ba-b and the product becomes a2−b2a^2-b^2, which is usually far easier to compute than the original multiplication.

It also works when aa or bb is itself an algebraic expression, not just a single letter. For instance, taking a=3xa=3x and b=4b=4 in a2−b2=(a+b)(a−b)a^2-b^2=(a+b)(a-b) gives 9x2−16=(3x+4)(3x−4)9x^2-16=(3x+4)(3x-4) immediately, with no need to guess factor pairs by trial. The identity does not care whether aa and bb are whole numbers, decimals, fractions, or expressions containing a variable — the only requirement is that the two brackets being multiplied (or the two terms being subtracted) genuinely share the same aa and the same bb.

Figure
Two rectangles showing that a sum times a difference always leaves a plain difference of two squares with no leftover strip
(a+b)(a-b) = a squared minus b squared a big square of side a a squared strip of width b along two sides remove strip what remains after removing width b side (a-b) this leftover square is exactly a squared minus b squared The two thin strips removed correspond to the plus ab and minus ab terms, which cancel and leave no extra sliver.
Derivation ADeriving the difference of squares identity

Show, starting only from the distributive law applied twice, that the product of a sum and a difference of the same two terms (a+b)(a−b)(a+b)(a-b) always reduces to exactly two terms, a2−b2a^2-b^2, with the cross terms cancelling completely regardless of what aa and bb stand for.

Step 1. Treat (a−b)(a-b) as a single quantity and distribute the first bracket over it, the same way you would expand (x)(a−b)(x)(a-b) for any xx:

(a+b)(a−b)=a(a−b)+b(a−b)(a+b)(a-b)=a(a-b)+b(a-b)

Step 2. Distribute aa over (a−b)(a-b) and bb over (a−b)(a-b) separately, multiplying each term inside the brackets:

a(a−b)=a2−abandb(a−b)=ab−b2a(a-b)=a^2-ab \qquad\text{and}\qquad b(a-b)=ab-b^2

Step 3. Add the two results from Step 2 back together, keeping every term:

(a+b)(a−b)=a2−ab+ab−b2(a+b)(a-b)=a^2-ab+ab-b^2

Step 4. Identify the two middle terms, −ab-ab and +ab+ab. They involve the exact same product a×ba\times b with opposite signs, so they cancel identically, for any values of aa and bb:

−ab+ab=0-ab+ab=0

Step 5. What remains after cancellation is the final identity, valid for every choice of aa and bb — numbers, variables, or larger expressions substituted in their place:

(a+b)(a−b)=a2−b2(a+b)(a-b)=a^2-b^2

Worked example

Expand (2x+7)(2x−7)(2x+7)(2x-7), and then use the identity to evaluate 652−35265^2-35^2 without squaring either number.

Step 1. Match (2x+7)(2x−7)(2x+7)(2x-7) against the pattern (a+b)(a−b)(a+b)(a-b), taking a=2xa=2x and b=7b=7 — both brackets share exactly the same two terms, 2x2x and 77, with only the sign before the 77 different.

Step 2. Compute a2a^2 and b2b^2 separately: a2=(2x)2=4x2a^2=(2x)^2=4x^2 and b2=72=49b^2=7^2=49.

Step 3. Apply the identity directly: (2x+7)(2x−7)=a2−b2=4x2−49(2x+7)(2x-7)=a^2-b^2=4x^2-49.

Step 4. Check by full expansion, to confirm the middle terms really do cancel: (2x+7)(2x−7)=2x(2x−7)+7(2x−7)=4x2−14x+14x−49=4x2−49(2x+7)(2x-7)=2x(2x-7)+7(2x-7)=4x^2-14x+14x-49=4x^2-49. The −14x-14x and +14x+14x cancel, matching Step 3.

Step 5. Now run the identity backwards on 652−35265^2-35^2. Treat it as a2−b2a^2-b^2 with a=65a=65, b=35b=35, so 652−352=(a+b)(a−b)=(65+35)(65−35)=100×30=300065^2-35^2=(a+b)(a-b)=(65+35)(65-35)=100\times30=3000. This avoids computing 652=422565^2=4225 and 352=122535^2=1225 and subtracting them separately. The two results, worked in opposite directions of the same identity, are (2x+7)(2x−7)=4x2−49\mathbf{(2x+7)(2x-7)=4x^2-49} and 652−352=3000\mathbf{65^2-35^2=3000}.

Competitive stretch

For 6.8×7.26.8\times7.2, write the numbers as equally spaced around 77: 6.8=7−0.26.8=7-0.2 and 7.2=7+0.27.2=7+0.2. Then 6.8×7.2=(7+0.2)(7−0.2)=72−0.22=49−0.04=48.966.8\times7.2=(7+0.2)(7-0.2)=7^2-0.2^2=49-0.04=48.96, found mentally in two steps instead of a full decimal multiplication. The same trick handles 19×2119\times21: the two numbers sit 11 away from 2020, so 19×21=(20−1)(20+1)=202−12=400−1=39919\times21=(20-1)(20+1)=20^2-1^2=400-1=399, computed in seconds without ever multiplying 1919 by 2121 directly. Recognising the "equally spaced around a round number" shape is the whole skill — once you spot it, the identity does the rest of the work.

Common traps

  • Applying the shortcut to a2+b2a^2+b^2 — a sum of two squares has no such simple factorisation over ordinary numbers; the identity works only for a difference.
  • Forgetting that both brackets must share exactly the same two terms; (2x+7)(2x−3)(2x+7)(2x-3) is an ordinary product of two different binomials, not a difference-of-squares pattern, because the second terms are not the same.
  • Sign errors when reading off aa and bb from a subtraction like 652−35265^2-35^2: the factorisation is (a+b)(a−b)(a+b)(a-b), never (a−b)(a−b)(a-b)(a-b).
  • Trying to force the identity onto non-square terms, such as treating x2−5x^2-5 as x2−(5)2x^2-(\sqrt5)^2 — surds are outside the Class 8 syllabus, so only use this identity when both terms are recognisable perfect squares.
  • Skipping the check step when a question asks you to "verify" or "expand and confirm" — always be ready to re-expand (a+b)(a−b)(a+b)(a-b) term by term as a quick sanity check, since a single sign slip while identifying aa and bb silently produces the wrong answer.

Ask the tutor: Want to see how this same identity turns 998×1002998\times1002 or 19×2119\times21 into an instant mental calculation, or try a few more factorisation problems from the next chapter?

Why does the middle term disappear only in this identity and not in the square identities?

In (a+b)(a−b)(a+b)(a-b) the two cross terms produced by expansion are −ab-ab and +ab+ab — same size, opposite sign, so they cancel to zero. In (a+b)2=(a+b)(a+b)(a+b)^2=(a+b)(a+b) both cross terms come out as +ab+ab, so they add to 2ab2ab instead of cancelling; the same happens with a −2ab-2ab in (a−b)2(a-b)^2. The sign pattern of the two brackets is what decides whether the middle term survives or vanishes.

How do I know whether to expand forwards or factorise backwards when I see an expression?

Look at what you are given. If you already have two brackets that look like (a+b)(a−b)(a+b)(a-b) — the same two terms with opposite signs on the second — expand forwards to a2−b2a^2-b^2. If instead you are given a single expression that is one perfect square minus another, like 9x2−169x^2-16 or 652−35265^2-35^2, factorise backwards into (a+b)(a−b)(a+b)(a-b) using the square roots of the two terms.

Does this identity work if a or b is negative, or a decimal, or a whole expression like 3x?

Yes — the derivation never assumes aa and bb are positive whole numbers; it only relies on the distributive law, which holds for any real numbers or algebraic expressions. That is why it applies equally to (2x+7)(2x−7)(2x+7)(2x-7), to decimals like (7+0.2)(7−0.2)(7+0.2)(7-0.2), and to larger algebraic terms such as (3x+4)(3x−4)(3x+4)(3x-4). If bb is negative, simply substitute its negative value in and let the signs work out on their own — you never need a separate rule for that case.

Before this

Where this leads