Difference of Squares and the Perfect Square Formula — Explained 7+

Save your child's achievements An account keeps every bit of progress safe. No newsletters — your email is used for progress only.

Create account
A knight faces cartoon monsters with his shield, keeping a child safe behind him New from Dad4Kids Clean YouTube for kids For families with traditional values, hand-picked by parents. Open →

The difference of squares is the identity a² − b² = (a − b)(a + b). It says that any square with a smaller square cut out of its corner can be rearranged into a plain rectangle whose sides are (a − b) and (a + b) — same area, tidier shape. That is why x² − 9 factors instantly into (x − 3)(x + 3), and why 43 · 37 is 1600 − 9 = 1591 without a calculator.

It belongs to a small family of algebraic identities that all come from the same picture. The perfect square formula (a + b)² = a² + 2ab + b² is a square wall paved with four slabs: one big square, two identical rectangles and one small square. Forget the two rectangles and the wall has two holes — that missing 2ab is the single most common mistake in algebra. Below is every identity with worked examples, and above is Square Masons, where a child lays those slabs by hand.

Difference of squares, seen as tiles

Take a square with side a and cut a smaller square of side b out of one corner. What is left is an L-shaped piece with area a² − b². Now make one straight cut across the L and slide the piece you cut off around to the other end: the parts fit together into a rectangle with sides (a − b) and (a + b). Nothing was added or thrown away, so the areas must be equal:

a² − b² = (a − b)(a + b)

Factoring: x² − 9 = (x − 3)(x + 3) · x² − 25 = (x − 5)(x + 5) · 4x² − 49 = (2x − 7)(2x + 7).

Mental arithmetic: 43 · 37 = (40 + 3)(40 − 3) = 1600 − 9 = 1591, and 101 · 99 = 10,000 − 1 = 9999.

Solving: x² − 16 = 0 becomes (x − 4)(x + 4) = 0, so x = 4 or x = −4.

Two warnings. First, a sum of squares, a² + b², does not factor over the real numbers — that is a property of the expression, not a gap in your memory. Second, "difference of squares" (a² − b²) and "square of a difference" ((a − b)²) are different animals; the names are nearly identical and the expressions are not.

The perfect square formula: why the middle term is 2ab

Draw a square with side a + b and split each side into a piece of length a and a piece of length b. The square falls apart into four tiles:

Check it with numbers: side 3 + 2 = 5, total area 25, and the tiles give 9 + 6 + 6 + 4 = 25. This is also why the classic error (a + b)² = a² + b² is so easy to catch: 9 + 4 = 13, not 25. Two rectangles are missing.

Binomial square examples: (x + 4)² = x² + 8x + 16 · (2x + 3)² = 4x² + 12x + 9. Mental arithmetic: 51² = (50 + 1)² = 2500 + 100 + 1 = 2601.

Square of a difference: where the +b² comes from

The formula (a − b)² = a² − 2ab + b² looks odd — you subtract twice and then suddenly add. The picture explains it. Start from a square of side a. To shrink it to side a − b you shave a strip of width b off the top and another off the side: that is the −2ab. But the little b × b corner lies where the two strips overlap, so it has been removed twice. Putting it back once is the +b².

Examples: (x − 5)² = x² − 10x + 25 · 99² = (100 − 1)² = 10,000 − 200 + 1 = 9801.

Note the sign pattern: only the middle term flips sign with the bracket. The outer terms stay positive, because a square is never negative.

Cube of a binomial

(a + b)³ = a³ + 3a²b + 3ab² + b³, and it has a picture too, just a solid one: a cube of side a + b splits into eight blocks — one cube a³, three flat slabs a²b, three bars ab², and one small cube b³. The 3s in the formula are simply "three of that block."

The cube of a difference alternates signs: (a − b)³ = a³ − 3a²b + 3ab² − b³.

Example: (x + 2)³ = x³ + 6x² + 12x + 8.

Sum and difference of cubes

These two factor where you might not expect it:

The first bracket carries the same sign as the original; the middle term of the second bracket carries the opposite one. The second factor looks like a perfect square but has a single ab rather than 2ab, which is why it is called an incomplete square. Example: x³ − 8 = (x − 2)(x² + 2x + 4).

The algebraic identities worth knowing

They earn their keep in three places: expanding brackets in one step, factoring so that fractions cancel — (x² − 4) / (x + 2) = (x − 2)(x + 2) / (x + 2) = x − 2 — and squaring awkward numbers in your head. In the US curriculum they turn up in Algebra 1 and stay useful all the way through calculus.

How the game teaches them

In the game above the child is the master mason of a fortress. Every section runs in three phases. Order: pick slabs at the depot — that is expanding the brackets, written as an invoice. Laying: place the slabs with no overlaps and no gaps, checked by a real tiling algorithm rather than by eye. Assault: solid masonry holds; any open cell becomes the breach, and the debrief names the missing piece and its exact size.

The trap that makes the lesson stick is the depot's "Beginner's kit": just two squares, the big one and the small one. Order it and the wall keeps two rectangular holes — and the raiders climb through those holes and nowhere else. Those holes are 2ab. The child does not get a red cross; the child watches the consequence.

A hundred sections across ten regions follow the same order as this page:

Time is paused while the child thinks. There is no way to lose — only to rebuild the wall.

How to play

Every section runs in three phases. Order: pick slabs at the depot — this is expanding the brackets, only as an invoice. Laying: place the slabs on the wall with no overlaps and no gaps; the game checks the covering with a real tiling algorithm, not by eye. Assault: the raiders arrive. Solid masonry holds them off; any open cell becomes the breach, and the game shows exactly which piece was missing and how big it was.

The cart holds a fixed number of slabs, so ordering “a few extra just in case” does not work either — surplus stone is dumped at the foot of the wall and the raiders climb the heap. The invoice has to balance exactly, because a formula has no spare terms.

What your child learns

Square of a sum as a tiling of a square: (a+b)² = a² + 2ab + b², with the two middle rectangles you can literally count. Difference of two squares as reforging: a damaged slab with a corner knocked out is cut and folded into a clean rectangle, so a² − b² = (a−b)(a+b) happens on screen. Square of a difference as shrinking a wall, where the corner gets removed twice and has to be put back — that is the +b². Cube of a sum as a donjon assembled from eight blocks. 100 sections across 10 regions, ten story assaults with siege engines.

The science behind the games

Every Dad4Kids game is built on one simple truth: children want to play, not study — so we turn learning into a game worth replaying. The method draws on peer-reviewed research in game-based learning, motivation, and how memory works.

FAQ

What is the difference of squares formula?

a² − b² = (a − b)(a + b). For example x² − 9 = (x − 3)(x + 3), and it also turns 43 · 37 into 1600 − 9 = 1591.

Can you factor a sum of squares, a² + b²?

Not with real numbers — a² + b² has no factorisation of that kind. Only the difference of two squares splits into (a − b)(a + b).

What is the perfect square formula?

(a + b)² = a² + 2ab + b², and (a − b)² = a² − 2ab + b². The middle term comes from the two identical a × b rectangles inside the square.

Why isn't (a + b)² equal to a² + b²?

Because squaring produces two extra a × b rectangles. Numbers settle it: (3 + 2)² = 25 while 3² + 2² = 13 — the missing 12 is exactly 2ab.

What is the difference between a difference of squares and a square of a difference?

A difference of squares is a² − b², which factors into (a − b)(a + b). A square of a difference is (a − b)², which expands to a² − 2ab + b². Similar names, unrelated expressions.

Is the game free and does it work on a tablet?

Yes — free, no ads, straight in the browser. Tap a slab, then tap the wall. The scene draws nothing while the child is thinking, so the tablet stays cool.

More free games for kids

What game should we build next?

Tell us what game your kid would love — describe it in a sentence or two, and we’ll build it. Free, right here on Dad4Kids.

Leave your email and we’ll send you the link when the game is ready.

Got it! We read every idea — thank you!

Check back in a couple of weeks — your game might be here.

By Evgeny Arsentiev, PhD · Last updated: July 2026