In short
a^3 + b^3 = (a+b)(a^2 - ab + b^2) comes from a 3D dissection. Imagine an a \times a \times a cube and a b \times b \times b cube. Nest them at opposite corners of a bigger (a+b)^3 box. The big box is cut into eight pieces (one per corner of an (a+b)^3 dissection): the two cubes you started with, plus six "extra" slabs — three of volume a^2 b and three of volume a b^2. Subtract those extras and the surviving a^3 + b^3 rearranges into a flat slab of base (a+b) and a curiously-shaped lid of cross-section a^2 - ab + b^2. The -ab is not a typo — it is the correction that makes the cross-terms cancel when you expand the product.
You have already seen the difference-of-squares picture: an a \times a square minus a b \times b corner folds into a single rectangle of size (a+b) \times (a-b), proving a^2 - b^2 = (a+b)(a-b). In one dimension up, the cubic identities a^3 \pm b^3 both factor too — and they factor through almost the same trick. In this article you will see the picture for a^3 + b^3, and check the algebra in a way that makes the magical -ab in the middle factor finally feel inevitable.
There is one honest disclaimer up front. Cutting two cubes into pieces that re-glue cleanly into (a+b) \times (a^2 - ab + b^2) is genuinely harder than the 2D dissection — you cannot just rotate a flat piece on the page. So this article uses a hybrid approach: a 3D bookkeeping picture (which counts and subtracts pieces) plus a clean algebraic check (which shows the cancellations explicitly). Together, the two halves leave nothing waved away.
The picture: two cubes hiding inside a bigger cube
Start with the two cubes you want to add: a wheat-coloured a^3 cube and a yellow b^3 cube. Place them at diagonally opposite corners of an imagined (a+b)^3 box.
From the eight-piece dissection of (a+b)^3 you already know:
So the volume of the outer box, minus the six leftover slabs, equals the two cubes you care about:
That last step pulls out the common factor 3ab(a+b) = 3a^2 b + 3 a b^2. Now the right-hand side has a common factor of (a+b) sitting in both terms. Factor it out:
Expand the inside bracket: (a+b)^2 - 3ab = a^2 + 2ab + b^2 - 3ab = a^2 - ab + b^2. So
That is the identity, derived from one cube picture and one factor-pull. Why is the middle term -ab and not +ab? It is the correction — the residue left after you subtract the six leftover slabs 3ab(a+b) from the full (a+b)^3. Algebraically: (a+b)^2 contains a +2ab, and you remove 3ab, so 2ab - 3ab = -ab. The minus sign is the bookkeeping of "I added too much when I built the big cube; I have to take some back."
Algebraic verification: every cross-term cancels
The 3D picture gives you the idea. To be sure no piece is mis-counted, expand (a+b)(a^2 - ab + b^2) directly and watch the cross-terms vanish in pairs:
Distribute a across the second bracket:
Distribute b across the second bracket:
Add the two rows:
The two middle pairs cancel exactly because the quadratic factor's middle term is -ab. Why does the cancellation only work with -ab in the middle? Try writing (a+b)(a^2 + ab + b^2) instead. Now a \cdot ab = a^2 b and b \cdot ab = ab^2, but the other contributions are +a^2 b from b \cdot a^2 and +ab^2 from a \cdot b^2 — both terms double rather than cancel, giving a^3 + 2a^2 b + 2 ab^2 + b^3 = a^3 + b^3 + 2ab(a+b). The sign of the middle coefficient is what kills the cross-terms. Get it wrong and you get (a+b)^3 minus the wrong thing.
The cubic mirror of a^2 - b^2
Compare the two factorings side by side:
The pattern is clean. Differences and sums of like powers always factor — the linear factor matches the sign of the original (sum gets a+b, difference gets a-b), and the quadratic factor takes the opposite sign in its middle term. Why is there no comparable factoring of a^2 + b^2 over real numbers? Because the discriminant of the would-be quadratic factor is negative — over the reals, a^2 + b^2 is irreducible. (Over the complex numbers, it does factor as (a+bi)(a-bi), but that is a different story for the complex-numbers article.) So among the six identities in this family, a^2 + b^2 is the odd one out: the cubic versions are friendlier than the quadratic versions because cubics have an obvious real root structure.
Why the quadratic factor is always positive
There is a beautiful subplot hiding in a^2 - ab + b^2. Read it as a quadratic in a with b fixed:
Its discriminant is \Delta = (-b)^2 - 4 \cdot 1 \cdot b^2 = b^2 - 4b^2 = -3b^2. Why does negative discriminant matter? A quadratic a^2 + pa + q has real roots only when \Delta = p^2 - 4q \geq 0. With \Delta < 0, the parabola never crosses the a-axis, and since the leading coefficient is positive, the entire parabola sits above zero. So a^2 - ab + b^2 > 0 for every real a, as long as b \neq 0 (and at b = 0 it equals a^2 \geq 0).
This has a striking consequence: the equation a^3 + b^3 = 0 has only one real solution, namely a = -b. Here is why. From the factoring,
means either a + b = 0 or a^2 - ab + b^2 = 0. The second factor is strictly positive for every real a, b (not both zero), so it never vanishes. Only the first factor can be zero, giving a = -b. The cubic equation x^3 = -k^3 has the obvious real root x = -k, and the other two roots are complex.
You can also rewrite a^2 - ab + b^2 as a sum of squares to see its positivity directly:
Both terms on the right are squares (hence non-negative), and they are not simultaneously zero unless b = 0 and a = 0. So the quadratic factor is positive whenever (a, b) \neq (0, 0).
Worked examples
Example 1 — checking the picture with $a = 2$, $b = 1$
The two cubes have volumes 8 and 1, so a^3 + b^3 = 9. The identity says
You can also verify the bookkeeping: the outer cube is 3^3 = 27, the six leftover slabs are 3 \cdot 4 \cdot 1 + 3 \cdot 2 \cdot 1 = 12 + 6 = 18, and 27 - 18 = 9 — exactly the two corner cubes.
Example 2 — bigger numbers: $a = 5$, $b = 3$
The two cubes have volumes 125 and 27, so a^3 + b^3 = 152. The identity says
For mental arithmetic, the identity is often the fastest route to a cube sum. Adding 125 + 27 in your head is not painful, but multiplying 8 \times 19 as 8 \times 20 - 8 = 160 - 8 = 152 is a one-liner. For larger pairs the speedup is bigger: a = 10, b = 7 gives 1000 + 343 = 1343 via the cubes, or 17 \times (100 - 70 + 49) = 17 \times 79 = 17 \times 80 - 17 = 1360 - 17 = 1343 via the identity.
Example 3 — factoring $x^3 + 27$
Recognise 27 = 3^3. So x^3 + 27 = x^3 + 3^3, which fits the pattern with a = x, b = 3:
The factor (x+3) tells you immediately that x = -3 is a root of x^3 + 27 = 0. The quadratic factor x^2 - 3x + 9 has discriminant 9 - 36 = -27 < 0, so it has no real roots — confirming what the general theory said: x^3 = -27 has exactly one real solution, namely x = -3.
A few more, all the same picture:
- x^3 + 8 = (x+2)(x^2 - 2x + 4)
- x^3 + 1 = (x+1)(x^2 - x + 1)
- 8y^3 + 27 = (2y)^3 + 3^3 = (2y + 3)(4y^2 - 6y + 9)
- a^6 + b^6 = (a^2)^3 + (b^2)^3 = (a^2 + b^2)(a^4 - a^2 b^2 + b^4) — the picture inside the picture.
Each "plus" between two cubes splits into a "times" of a linear and a quadratic.
Why this matters
In Class 9 you meet a^3 + b^3 as a formula to memorise. By Class 11, you meet it as the tool that splits cubic equations into a linear root times an irreducible quadratic. By the time you reach JEE, the same identity sits inside polynomial factorization, partial fractions, and the proof that every odd-degree real polynomial has at least one real root.
It even shows up in cricket-pitch arithmetic. The volume of a cube of side 13 cm is 2197 cm³, and 2197 = 13^3 = (10 + 3)^3. The volume of a cube of side 10 cm plus a cube of side 3 cm is 1000 + 27 = 1027 = 13 \times 79 — a nice mental check. Diwali rangoli patterns built from cubic blocks, autorickshaw seat-foam blocks stacked in storerooms, ISRO solid-fuel grain geometries — wherever volumes of nested cubes appear, the same identity is there to factor the total.
The picture is the proof. Stack two cubes inside an imagined bigger cube. Subtract the six leftover slabs. What remains rearranges into (a+b) multiplied by a quadratic whose middle term is exactly the amount you over-removed. Once that picture is in your head, the formula is no longer something you memorise — it is something you read off geometry.
References
- Algebraic identities — the parent article.
- Geometric proof of (a+b)^3 — the eight-piece cube dissection used here as a starting point.
- Geometric proof of a^2 - b^2 — the 2D mirror of this article.
- Wikipedia: Sum of two cubes — algebraic statement, factoring, and applications.
- NCERT Class 9 Mathematics, Chapter 2: Polynomials — the Indian school textbook treatment of a^3 + b^3 and a^3 - b^3.
- Cut the Knot: Sum and difference of cubes — gallery of proofs and visualisations.