Forward ▶▶ animates the proof one step ahead and ◀◀ Back one step back; the Steps panel on the right adds a card for each step reached. Learn more about the controls
▶ Play runs the proof through to Step 4, ⏸ Pause stops it in place, ↺ Reset returns to Step 1, and Speed sets 0.5× to 2×. Learn more about the controls
This visualizer turns the identity (a−b)2=a2−2ab+b2 into a geometric argument you can step through. Starting from a square of side a, two ab strips are laid down to cover most of it. The strips overlap on a small b2 corner, which has been counted twice and must be subtracted. What remains uncovered is the (a−b)2 square — and the equation falls out of summing the pieces correctly.
The right-hand side has the same outer terms a2 and b2 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.
Step 1 of the animation shows a square of side a, labelled a2 in the centre. Dimension marks on the top and left edges read "a". 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=a2. This is the quantity we will decompose. Unlike the square-of-a-sum proof, where the goal was to expand (a+b)2 into pieces, here we begin from a2 and work toward an expression involving (a−b)2.
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 (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=7 and b=3 units, leaving a 4×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 b in the upper-right corner. The dimension labels on the top edge and left edge update to show the split: the top edge becomes "a−b" then "b"; the left edge becomes "b" then "a−b". The original "a" labels remain, slid further out to indicate the total side length.
The marked b2 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 a−b and one of length b.
The b2 patch will reappear in the next step as the place where two strips overlap. Its role is structural, not decorative.
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 (b and a−b inside, a 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 ab strips that together cover most of the square:
• A horizontal strip of dimensions a×b runs along the top of the square (sides a and b, area ab).
• A vertical strip of dimensions b×a runs down the right side (sides b and a, area ab).
The two strips overlap exactly on the upper-right b×b corner. The pink b2 patch is the overlap region — a single b×b square covered by both strips at once. The remaining uncovered region is a square of side a−b in the lower-left, with area (a−b)2.
Counting areas naively gives ab+ab=2ab, but this double-counts the overlap. The corrected total of the covered region is 2ab−b2. The whole a×a square equals the covered region plus the uncovered (a−b)2:
a2=(2ab−b2)+(a−b)2
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 (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 b2 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
DemoStep 4 and back
Step 0 of 4
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 b2 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 equationa2=2ab−b2+(a−b)2 for (a−b)2:
(a−b)2=a2−2ab+b2
The minus sign in front of 2ab is the strip-overlap correction. The plus sign in front of b2 is the rebate that compensates for double-subtracting the overlap when we wrote −2ab. Both signs are forced by the geometry; neither is a memorisation rule.
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 b2 corner), the right strip slid out with its overlap copy already discarded, and the (a−b)2 square holding its ground. Read the separated inventory left to right and the equation assembles itself: one (a−b)2, two ab strips, one b2 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:
• a2 is positive — this is the area of the square we started with.
• −2ab is negative — the two strips together have area 2ab, 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 is positive — the overlap region was counted twice in 2ab, so when we subtract 2ab we have removed it once too many; adding b2 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
DemoPlay, speed and reset
Step 0 of 4
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.
Related Concepts and Tools
Algebraic Identities — Hub for all four identity visualizers.
Square of a Sum — Companion proof of (a+b)2=a2+2ab+b2. Same form, opposite sign on the middle term.
Difference of Squares — Factors a2−b2 into (a+b)(a−b). Useful next step after this identity.