In short

The identity a^2 - b^2 = (a+b)(a-b) comes from a single picture. Start with an a \times a square. Cut a small b \times b square out of one corner — what is left is an L-shape of area a^2 - b^2. Now slice the L along an inner edge into two rectangular pieces, swing one piece around, and the two pieces lock together into a single rectangle of width (a+b) and height (a-b). Same area, two ways of writing it: a^2 - b^2 = (a+b)(a-b). Why: cutting and rearranging a region never changes its area, so the L-shape and the new rectangle must have the same area.

You already know two square identities — (a+b)^2 and (a-b)^2 — as pictures of squares being cut into pieces. The third great identity in this family, a^2 - b^2 = (a+b)(a-b), has perhaps the most satisfying picture of all. Nothing is added back, nothing is over-counted. You just cut, fold, and the answer falls out as a clean rectangle.

This is also the most useful of the three. Unlike (a+b)^2 and (a-b)^2, which only let you square things, this identity lets you factor. Every time you stare at "something squared minus something else squared", the picture gives you a multiplication. That single trick powers mental arithmetic, school algebra, and — as you will see at the end — a 17th-century method that Pierre de Fermat used to factor large numbers and that still underlies parts of modern cryptography.

The picture

Draw a big square of side a. Inside it, in the bottom-right corner, mark off a smaller square of side b. Remove that small square. What is left is an L-shaped region — the big square minus the corner — and its area is a^2 - b^2.

The L-shape is awkward to measure directly. So slice it. Cut along the line that separates the top half (height a-b) from the bottom strip (height b). The L falls apart into two rectangles:

Now lift the bottom-left rectangle, rotate it 90°, and stick it on the right edge of the top rectangle. Its height b becomes a width b. Its width a-b becomes a height a-b — which exactly matches the height of the top rectangle. The two pieces fit together with no gap and no overlap.

What you have built is a single rectangle: width a + b (the original a plus the swung-around b), height a - b. Its area is (a+b)(a-b).

Geometric proof of a squared minus b squared as a rearranged rectangleThree-panel diagram. Panel 1 on the left shows a big square of side a with a small square of side b cut from the bottom-right corner, leaving an L-shaped region. Panel 2 in the middle shows the same L-shape sliced horizontally into two rectangles: a top rectangle of width a and height a minus b shaded blue, and a bottom-left rectangle of width a minus b and height b shaded green. Panel 3 on the right shows the two pieces rearranged into a single rectangle: the blue piece on the left and the green piece swung around and placed on the right, forming a rectangle of width a plus b and height a minus b. Step 1: cut the corner removed a a a² − b² L-shape, area $a^2 - b^2$ Step 2: slice along the dashed line width $a$, height $(a-b)$ width $(a-b)$, ht $b$ a a−b b rotate & swing Step 3: fold into one rectangle width $a$ width $b$ a + b a−b area = $(a+b)(a-b)$ Same shaded pieces, same area: $a^2 - b^2 = (a+b)(a-b)$ top piece — width $a$, height $(a-b)$ bottom-left piece — width $(a-b)$, height $b$ → rotated to width $b$, height $(a-b)$ corner removed — area $b^2$, the part that was thrown away
Three steps. **Cut** a $b \times b$ corner out of an $a \times a$ square. **Slice** the leftover L into two rectangles. **Swing** the smaller piece around and lock it onto the side of the larger piece. The final rectangle is $(a+b) \times (a-b)$, so $a^2 - b^2 = (a+b)(a-b)$.

Two measurements of the same set of pieces: before the rearrangement the area is a^2 - b^2 (the big square minus the small square); after the rearrangement the area is (a+b) \times (a-b) (the new rectangle). Since you only moved the pieces — never added or removed any material — the two numbers must be equal:

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

Why does the L-shape's area equal the sum of its two rectangular pieces? Because area adds for non-overlapping regions. The blue top rectangle and the green bottom-left rectangle share only an edge, not an area, so \text{area}(\text{L}) = a(a-b) + (a-b)b = (a-b)(a+b). The factoring out of (a-b) is exactly the rearrangement happening on paper.

Worked examples

Example 1 — the picture with real numbers

Take a = 10 and b = 3. The big square has area 100. The small corner has area 9. The L-shape has area 100 - 9 = 91.

Now the rearranged rectangle has width a + b = 13 and height a - b = 7. Its area is 13 \times 7 = 91. ✓ The two counts match.

a equals 10 b equals 3 worked exampleLeft: a 10 by 10 square with a 3 by 3 corner removed, sliced into a 10 by 7 blue rectangle on top and a 7 by 3 green rectangle on the bottom-left. Right: a 13 by 7 rectangle made of the same blue and green pieces. Both shapes have area 91. 10 × 7 = 70 7 × 3 = 21 3² gone L-shape: 70 + 21 = 91 10 × 7 = 70 3×7=21 13 7 Rectangle: 13 × 7 = 91
Same two coloured pieces, two arrangements. $100 - 9 = 91 = 13 \times 7$.

Example 2 — mental maths: $102 \times 98$ in three seconds

Someone asks you for 102 \times 98. Reach for a pen? Don't. Look at the two numbers: they sit symmetrically around 100. So write them as (100 + 2) and (100 - 2), and the identity a^2 - b^2 = (a+b)(a-b) — read right to left — gives you:

102 \times 98 = (100 + 2)(100 - 2) = 100^2 - 2^2 = 10000 - 4 = 9996

Done. No long multiplication. The same trick crushes any pair that hugs a round number:

  • 97 \times 103 = 100^2 - 3^2 = 10000 - 9 = 9991
  • 48 \times 52 = 50^2 - 2^2 = 2500 - 4 = 2496
  • 19 \times 21 = 20^2 - 1 = 399
  • 995 \times 1005 = 1000^2 - 25 = 999975

Cricket-scoring fans, rangoli pattern designers, and shopkeepers totalling up \textsf{₹}48 \times 52 kilos of rice all use this without ever calling it "the difference of squares". The picture is doing the work: the two numbers became the width and height of a rectangle, and you measured its area by removing a tiny corner from a clean square.

Example 3 — turning subtraction into multiplication

Look at 49 - 16. As a subtraction: 33. Boring.

But notice 49 = 7^2 and 16 = 4^2. So 49 - 16 = 7^2 - 4^2, and the identity says:

7^2 - 4^2 = (7 + 4)(7 - 4) = 11 \times 3 = 33

A subtraction of two squares became a multiplication of two integers. That is the magic of this identity: it lets you factor.

Why care? Because factoring is what unlocks every divisibility question in algebra. If a problem hands you the expression x^2 - 25, you do not have to leave it as a subtraction. You can write it as (x+5)(x-5) and suddenly you can see its roots (x = \pm 5), divide it by (x-5), and use it inside other equations.

A few more, all the same picture:

  • x^2 - 1 = (x+1)(x-1)
  • 9y^2 - 4 = (3y)^2 - 2^2 = (3y+2)(3y-2)
  • a^4 - b^4 = (a^2)^2 - (b^2)^2 = (a^2 + b^2)(a^2 - b^2) = (a^2 + b^2)(a+b)(a-b) — the picture inside the picture!

Every "minus" between two squares becomes a "times" between two simpler things. Why is that powerful? Subtraction tells you only one number — the difference. Multiplication splits the same number into factors, which carry information about divisors, roots, and structure. Factoring is the operation mathematicians do when they want to understand an expression, not just evaluate it.

Why this is the most useful of the three identities

(a+b)^2 and (a-b)^2 are nice for squaring things in your head. a^2 - b^2 = (a+b)(a-b) is the one that carries weight in real mathematics, because it goes the other direction: it factors. And in maths, factoring is almost always harder — and almost always more useful — than expanding.

Pierre de Fermat, in 17th-century France, turned this single identity into a method for factoring large integers. Suppose you want to factor a big odd number N. If you can find two whole numbers a and b with N = a^2 - b^2, then by the identity, N = (a+b)(a-b) — you have just split N into a product of two smaller integers. Fermat's recipe: try a = \lceil \sqrt{N} \rceil, \lceil \sqrt{N} \rceil + 1, \lceil \sqrt{N} \rceil + 2, \ldots in turn, and check whether a^2 - N is a perfect square. If it is, you are done.

For example, factor 5959. Start with \lceil \sqrt{5959} \rceil = 78. Try 78^2 - 5959 = 6084 - 5959 = 125. Not a square. Try 79^2 - 5959 = 6241 - 5959 = 282. Not a square. Try 80^2 - 5959 = 6400 - 5959 = 441 = 21^2. Yes! So 5959 = 80^2 - 21^2 = (80+21)(80-21) = 101 \times 59. The picture you drew at the start of this article — with a = 80 and b = 21 — has just factored a four-digit number.

Variants of Fermat's factoring method are still part of how cryptanalysts probe weak RSA keys: when the two prime factors of an RSA modulus are too close together, the difference-of-squares trick rips the modulus open. The same picture you would draw on graph paper in Class 8 sits, slightly disguised, inside modern number theory.

References

  1. Algebraic identities — the parent article.
  2. Wikipedia: Difference of two squares — algebraic and geometric treatments, with the same dissection diagram.
  3. Wikipedia: Fermat's factorization method — the historical use of a^2 - b^2 = (a+b)(a-b) for integer factoring.
  4. NCERT Class 8 Mathematics, Chapter 9: Algebraic Expressions and Identities — the Indian school textbook section that introduces this identity with a near-identical picture.
  5. Cut the Knot: Difference of squares — proofs without words — gallery of dissection proofs.
  6. Euclid, Elements, Book II, Proposition 5 — the 2300-year-old geometric statement that, decoded, says a^2 - b^2 = (a+b)(a-b).