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.

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.

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

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.

Why the Signs Land Where They Do

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

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

$-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.

$+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.

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(a+b)^2 = a^2 + 2ab + b^2. Same form, opposite sign on the middle term.

Difference of Squares — Factors a2b2a^2 - b^2 into (a+b)(ab)(a+b)(a-b). Useful next step after this identity.

Square of a Trinomial — Extension to three terms: (a+b+c)2(a+b+c)^2.

Polynomials — Theory of polynomial expansion, where this identity is one of the standard tools.

Factoring — Recognising perfect square trinomials of the form a22ab+b2a^2 - 2ab + b^2 allows them to be re-factored as (ab)2(a-b)^2.