Sum and difference of cubes is one of 2 factoring formulas in the algebra section of this library, and it is used at high school level.
Why sum and difference of cubes works
Multiplying the binomial by the three-term factor produces six products, and four of them cancel in two pairs. That only happens because the middle term carries a single ab rather than 2ab, and because the sign in front of it is opposite the sign in the binomial. Change either detail and the cancellation stops.
What each symbol means
$a,b$ are the cube roots of the original terms.
Sum and difference of cubes: when it holds
The sign in the quadratic factor is opposite the first sign; its final term is positive.
When it stops applying
Do not try to break the three-term factor down further over the reals. Treated as a quadratic its discriminant works out to -3b squared, which is negative for every nonzero b, so it has no real roots and is already fully factored.
Sum and difference of cubes: a worked example
$x^3-8=(x-2)(x^2+2x+4)$.
The mistake to avoid
What people do: Using the perfect-square trinomial and writing a cubed minus b cubed as (a - b)(a squared - 2ab + b squared).
Why it goes wrong: That product is really (a - b) cubed, an entirely different expression. The extra 2 leaves leftovers where the cancellation was supposed to be clean.
Do this instead: Remember the three-term factor has no coefficient on the middle term, and its sign is the opposite of the binomial's, while its last term is always added.
Sum and difference of cubes: step by step
- Name the unknown, and the unit the answer has to come out in.
- Match the symbols to your values. $a,b$ are the cube roots of the original terms.
- Check the conditions before substituting. The sign in the quadratic factor is opposite the first sign; its final term is positive.
- Substitute, keep exact values to the last line, then test the sign, size, and unit against a rough estimate — the check that catches most algebra slips.
Where this formula fits
- Subject
- Algebra formulas — 28 entries in this library
- Topic
- Factoring
- Level
- High school
Formulas are easiest to keep when they sit inside a method rather than on a list. Use the links below to see where sum and difference of cubes comes from, to check a calculation against a tool, and to practise it until you can recall it without looking.
- Factoring Polynomials — the lesson behind this formula: reverse multiplication to expose roots and structure.
- Algebra Calculator — check your substitution and the value it produces.
- Study algebra — the subject guide that explains the ideas these formulas compress.
- Algebra I Practice — questions that make you retrieve the formula instead of recognising it.
- All 28 algebra formulas — the full grouped reference, or the complete formula library.
Questions about sum and difference of cubes
How do I keep the signs straight?
Copy the sign of the original problem into the binomial, flip it for the middle term of the trinomial, and always make the last term positive. So x cubed - 8 becomes (x - 2)(x squared + 2x + 4).
Does a sum of cubes really factor, when a sum of squares does not?
Yes, and that surprises most students. Expanding (x + 2)(x squared - 2x + 4) returns x cubed + 8 exactly, because a cube keeps the sign of its base while a square does not.
What do I do with something that is both a square and a cube, like x to the sixth minus 64?
Split it as a difference of squares first. That gives (x cubed - 8)(x cubed + 8), and each bracket then splits again, ending at (x - 2)(x + 2)(x squared - 2x + 4)(x squared + 2x + 4).
Why is there no 2 in front of the ab term?
Because this trinomial is not a perfect square. Its job is to supply terms that cancel against the binomial's expansion, and a coefficient of 2 would leave one copy of a squared b uncancelled.