Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Square of a Difference (a-b)²

Speed




Visualizing (a-b)² as a Sum-Minus-Overlap

This visualizer turns the identity (ab)2=a22ab+b2(a-b)^2 = a^2 - 2ab + b^2 into a geometric argument you can step through. Starting from a square of side aa, two abab strips are laid down to cover most of it. The strips overlap on a small b2b^2 corner, which has been counted twice and must be subtracted. What remains uncovered is the (ab)2(a-b)^2 square — and the equation falls out of summing the pieces correctly.



The (a-b)² Identity at a Glance

The square of a difference identity reads:

(ab)2=a22ab+b2(a-b)^2 = a^2 - 2ab + b^2


The right-hand side has the same outer terms a2a^2 and b2b^2 as the square-of-a-sum identity, but the middle term is negative. The minus sign is the only difference, and tracking where it comes from is exactly what the visual proof clarifies.

Forgetting the minus sign or mishandling it is a frequent source of error. Seeing the geometry behind it — overlapping strips that cover the same patch twice — turns a sign rule into a counting argument that is hard to misremember.

Reading the Starting Square

Step 1 of the animation shows a square of side aa, labelled a2a^2 in the centre. Dimension marks on the top and left edges read "aa". The visual is identical to the starting frame of the difference-of-squares proof, and that is intentional: many algebraic identities begin from the same plain square and then take it apart in different ways.

The square's area is a×a=a2a \times a = a^2. This is the quantity we will decompose. Unlike the square-of-a-sum proof, where the goal was to expand (a+b)2(a+b)^2 into pieces, here we begin from a2a^2 and work toward an expression involving (ab)2(a-b)^2.
aa
Step 1: the a² square, frozen

The plain a-square (a = 7, b = 3): the quantity about to be covered and corrected rather than cut cleanly.

The direction of the argument is the thing to fix in mind at this frame: the target quantity (ab)2(a-b)^2 is smaller than what is on screen, so the proof will proceed by covering and correcting rather than by cutting cleanly. The visualizer draws the square with a=7a = 7 and b=3b = 3 units, leaving a 4×44 \times 4 target square comfortably visible inside.

The next frame, marking the b² corner, sets the split that everything else references.

Marking the b² Corner

Step 2 marks a small pink square of side bb in the upper-right corner. The dimension labels on the top edge and left edge update to show the split: the top edge becomes "aba-b" then "bb"; the left edge becomes "bb" then "aba-b". The original "aa" labels remain, slid further out to indicate the total side length.

The marked b2b^2 corner is not yet doing any work in the proof — it is a reference. The point of marking it is to label the split in a way that lets the upcoming strips be described precisely. Each side of the square is now seen as two segments: one of length aba-b and one of length bb.

The b2b^2 patch will reappear in the next step as the place where two strips overlap. Its role is structural, not decorative.
ba − baa − bba
Step 2: the b² corner, frozen

The pink reference corner with the split labels b and a − b on both edges — the same marked square two proofs share.

The frozen frame is worth comparing against the same step in the difference-of-squares proof: an identical pink corner in an identical position, about to play a completely different role. There the corner is removed; here it stays put and becomes the overlap witness. Two proofs, one marked square, two destinies — a good reminder that a diagram's meaning lives in the argument, not the picture.

The double edge-labelling (bb and aba-b inside, aa slid outside) carries both descriptions of the side at once, exactly as the strips step will require.

Two ab Strips with an Overlap

Step 3 lays down two abab strips that together cover most of the square:

• A horizontal strip of dimensions a×ba \times b runs along the top of the square (sides aa and bb, area abab).

• A vertical strip of dimensions b×ab \times a runs down the right side (sides bb and aa, area abab).

The two strips overlap exactly on the upper-right b×bb \times b corner. The pink b2b^2 patch is the overlap region — a single b×bb \times b square covered by both strips at once. The remaining uncovered region is a square of side aba-b in the lower-left, with area (ab)2(a-b)^2.

Counting areas naively gives ab+ab=2abab + ab = 2ab, but this double-counts the overlap. The corrected total of the covered region is 2abb22ab - b^2. The whole a×aa \times a square equals the covered region plus the uncovered (ab)2(a-b)^2:

a2=(2abb2)+(ab)2a^2 = (2ab - b^2) + (a-b)^2
(a−b)²ababba − baa − bba
Step 3: the overlapping strips, frozen

Two ab strips in place, crossing exactly on the b² patch, with the (a−b)² target outlined dashed in the lower left.

In the frozen frame the (ab)2(a-b)^2 square in the lower-left already announces itself with its own label and a dashed outline — the proof's destination visible before the algebra arrives. Both strips sit in place, and the pink b2b^2 patch is doing double duty exactly where they cross.

This is the identity's entire content in one still image; the discard step only pulls the strips apart so the double-counting can be seen instead of asserted.

The Discard Step

Step 4 makes the overlap correction explicit. The top strip lifts upward off the square and the right strip slides outward to the right, so each strip can be inspected on its own. A red X mark appears on one copy of the b2b^2 overlap with a "discard" label, indicating that this piece of area was counted by both strips and needs to be subtracted out. The animation then oscillates back and forth — strips together, strips apart — driving home the relationship.

Solving the area equation a2=2abb2+(ab)2a^2 = 2ab - b^2 + (a-b)^2 for (ab)2(a-b)^2:

(ab)2=a22ab+b2(a-b)^2 = a^2 - 2ab + b^2


The minus sign in front of 2ab2ab is the strip-overlap correction. The plus sign in front of b2b^2 is the rebate that compensates for double-subtracting the overlap when we wrote 2ab-2ab. Both signs are forced by the geometry; neither is a memorisation rule.
(a−b)²ababba − baa − bba
Step 4: the discard, frozen at full separation

Strips lifted and slid apart, the double-counted b² removed — the inventory a² = 2ab − b² + (a−b)², readable piece by piece.

The frozen frame captures the exploded extreme of the oscillation: the top strip lifted clear (carrying its copy of the b2b^2 corner), the right strip slid out with its overlap copy already discarded, and the (ab)2(a-b)^2 square holding its ground. Read the separated inventory left to right and the equation assembles itself: one (ab)2(a-b)^2, two abab strips, one b2b^2 counted once too often.

In the live tool the pieces breathe apart and together continuously — freezing at maximum separation trades the motion for the clearest single reading of the count.

Why the Signs Land Where They Do

The identity has three terms with three different sign behaviours, each tied directly to the geometric construction:

a2a^2 is positive — this is the area of the square we started with.

2ab-2ab is negative — the two strips together have area 2ab2ab, but this is too much because of the overlap; subtracting accounts for the fact that the strips don't really tile the square cleanly.

+b2+b^2 is positive — the overlap region was counted twice in 2ab2ab, so when we subtract 2ab2ab we have removed it once too many; adding b2b^2 back compensates.

This three-term structure is the simplest case of inclusion-exclusion: when two regions overlap, the size of their union is "size of A + size of B − size of overlap." The square-of-a-difference identity is exactly that principle dressed in algebra.

Using the Controls

Five controls drive the animation:

Play runs the full proof. After step 4 finishes, the strips oscillate apart-and-together to keep the discard idea visible without freezing the screen.

Pause stops the current animation, including the stage-4 oscillation, in place.

Step Forward and Step Back move through steps 1–4 one at a time. Use these to study the marking and overlap separately from the discard correction.

Reset returns to step 1 and replays the intro fade-in.

Speed ranges from 0.5× to 2×. The default 1× lets the strip motion read clearly while still keeping the proof brisk.

The right panel shows the four written steps with the current step highlighted as the animation progresses.