MathemagiciansLibraryExplorationsDeep Dives
← Mathematics · Upper Secondary
MathematicsUpper Secondary

Difference of two squares — the shortcut

U2 — Algebra Advancing › U2.1 — Expanding and FactorisingLecture 4 of 5~2000 words

A multiplication you can do in your head

Work out without a calculator. Most people reach for long multiplication. There is a faster way. Notice that 103 is 3 more than 100, and 97 is 3 less. So:

A calculator agrees: 9991. In the same way, . This is not a trick about these particular numbers. It is an algebra pattern, and it has been in front of you for three lectures. The last lecture promised one more clue for factorising, in quadratics with no middle term. This is it.

The middle terms that vanish

In the lecture on expanding double brackets, one example behaved strangely. When you expanded , the two middle terms were and , and they cancelled. That lecture said the pattern would get its own lecture. Here is why it always happens.

Expand for any two terms and . The four products are:

The two middle products are and . They are the same size with opposite signs, so they always cancel. Only the two square terms remain:

Now read it backwards. Any expression that is one square minus another square can be factorised at once into a sum times a difference. Mathematicians call a difference of two squares, because that is exactly what it is.

The same idea came from the last lecture's method too. To factorise , think of it as . You need two numbers with product −25 and sum 0. Numbers with sum 0 are opposites, so the pair is 5 and −5: . A difference of two squares is simply the case where the two numbers are opposites.

A picture of a² − b²

Why should a difference of two squares be a product at all? Draw it. Take a square of side , and cut a smaller square of side from one corner. What is left has area . It is an L-shape, and it splits into two rectangles: a strip along the bottom and a block on top.

b² removed strip block side a b a − b strip block width a + b a − b
Top: a square of side a with a square of side b removed from its corner leaves a strip (a by a − b) and a block (a − b by b). Bottom: turn the block and place it beside the strip. Together they make one rectangle, a + b wide and a − b tall. So a² − b² = (a + b)(a − b). The drawing uses a = 7 and b = 3: 49 − 9 = 40 = 10 × 4.

Both pieces have one side of length . So turn the block round and place it next to the strip. The two pieces now make a single rectangle. Its height is , and its width is . Nothing was added and nothing was thrown away, so its area is still . That is it. That is the whole idea. One square minus another rearranges into a rectangle whose sides are their sum and their difference.

Change the two squares below and check that the areas always agree.

Explore — from L-shape to rectangle

Choose a and b. The top drawing is a² with b² removed. The bottom drawing uses the same two pieces as a rectangle. Compare the two areas.

The L-shape and the rectangle for four choices of a and b. The areas always match.

aba² − b²(a + b)(a − b)
7349 − 9 = 4010 × 4 = 40
101100 − 1 = 9911 × 9 = 99
5425 − 16 = 99 × 1 = 9
6036 − 0 = 366 × 6 = 36

Why the head-arithmetic works

Return to the opening calculation. Any two numbers that sit the same distance either side of a round number can be written as and . Their product is . So the hard multiplication becomes one easy square and one small square. For , the round number is 100 and the distance is 4: .

The pattern also works the other way, for squaring a number in your head. To find , use . Then add the back: . The trick is to choose the small square so that one of the two factors becomes a round number. This is not a party trick to memorise. It is the same rectangle as in the picture above, with numbers instead of letters.

Difference of two squares

It applies when there are exactly two terms, both are squares, and one is subtracted from the other.

Spotting a square

The skill is recognising squares quickly. Numbers first: 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144. Then terms with letters. A term is a square when its number is a square and every power is even: , , . So and in the pattern need not be single letters. They can be any terms at all, even whole brackets.

For larger numbers, one quick test helps. A square number never ends in 2, 3, 7 or 8, because no digit squared ends in those digits. So 72 and 147 are not squares, and cannot be a difference of two squares with whole numbers. But look for a common factor before giving up: , and 36 is a square. A test that says "no" is final. A test that says "maybe" still needs checking: 26 ends in 6 but is not a square.

Stop and think

Does factorise into two brackets?

Show the answer

Not with real numbers. Use the last lecture's method: think of it as . You need two numbers with product +25 and sum 0. A sum of 0 needs opposite signs, but opposite signs give a negative product. So no pair exists. A sum of two squares does not factorise into brackets like these. Only a difference does. (Students who have met complex numbers will see more; at this level, stays as it is.)

Stop and think

A student writes . Is that right?

Show the answer

No. means , which expands to . Its middle terms do not cancel, because both are , with the same sign. The middle terms cancel only when one bracket has and the other has . So . A quick number check catches the mistake: with , , but .

Worked examples

Worked Example 1 — Two letters

Factorise .

and . So and .

Answer: . Check by expanding: the middle products and cancel, leaving .

Worked Example 2 — A common factor first

Factorise completely.

Neither 2 nor 18 is a square, so the pattern is hidden. Take out the common factor: . Now is a difference of two squares.

Answer: . Check with : , and .

Worked Example 3 — Factorising twice

Factorise completely.

and . So .

The second bracket is again a difference of two squares: . The first bracket is a sum of two squares, so it stays.

Answer: . Check with : , and .

Worked Example 4 — The square comes second

Factorise .

Here the first square is and the second is . So and .

Answer: . Keep the order: the bracket with the minus sign is , because is the term being subtracted. Check with : , and .

Worked Example 5 — A squared bracket minus a number

Factorise .

Take and . Then .

Check by expanding the original: . The last lecture's method agrees: product −8 and sum 2 give 4 and −2. Expressions shaped like "a squared bracket minus a number" are exactly what the next lecture produces, so this example is worth remembering.

The pattern also explains something from the surds lectures. To rationalise , you multiplied top and bottom by , and the bottom became . That was with . The square root disappeared because squaring it removes it. It also means that does factorise if you allow surds: . Whether you "can" factorise depends on which numbers you allow.

Now sort some expressions.

Sorter — is it a difference of two squares?

Put each expression in a box. Check for two terms, two squares and a minus sign. Look for a common factor too.

Nine expressions sorted, each with its reason.

  • A difference of two squares now: x² − 49 = (x + 7)(x − 7); 4x² − 1 = (2x + 1)(2x − 1); 9 − y² = (3 + y)(3 − y); x⁴ − 16 = (x² + 4)(x² − 4).
  • After taking out a common factor: 3x² − 75 = 3(x² − 25); 2x² − 8 = 2(x² − 4).
  • Not a difference of two squares: x² + 49 (a sum); x² − 10 (10 is not a square of a whole number); x³ − 4 (x³ is not a square).

Three classic mistakes

Trap 1 — Factorising a sum of squares

is not , which expands to , and not , which gives . A sum of two squares does not factorise with real numbers.

Trap 2 — Stopping too early

is not complete, because factorises again. And needs its common factor taken out before the pattern shows. Always ask: can any bracket be factorised further?

Trap 3 — Swapping the order

, not . The second of these equals , which has the opposite sign. The term that is subtracted goes after the minus sign in the second bracket.

Try it yourself

Work each one on paper first. Check by expanding, or with a number.

  1. Factorise completely.

    Hint 1

    Look for a common factor before anything else.

    Hint 2

    .

    Full answer

    . Check with : , and .

  2. Use the difference of two squares to work out and without a calculator.

    Hint 1

    98 and 102 are each 2 away from 100.

    Hint 2

    .

    Full answer

    . And , so . Check: .

  3. Factorise completely.

    Hint 1

    .

    Hint 2

    One of the brackets you get is again a difference of two squares.

    Full answer

    . The bracket is a sum of squares and stays. Check with : , and .

  4. Factorise without expanding the squares first. Then check by expanding.

    Hint 1

    Use and . The pattern works for whole brackets.

    Hint 2

    and .

    Full answer

    . Check by expanding: . The pattern turned two squared brackets into one short line, because the terms never needed to appear.

The bigger idea

The difference of two squares turns up far beyond quadratics. It is why conjugates remove surds from denominators. It turns hard multiplications such as into easy ones. It also runs in reverse to find factors of whole numbers: if a number can be written as , it equals . That is how splits into . A method for factorising numbers built on this idea is named after the French mathematician Pierre de Fermat.

The next lecture uses squares in a different way. Instead of spotting a square that is already there, it builds one: completing the square, which rewrites any quadratic as a squared bracket plus a number.

Key concepts in this lesson