You know that a difference of squares factors (Factoring Completely) but a sum of squares like $x^2 + 9$ does not. Cubes are different: both $a^3 - b^3$ and $a^3 + b^3$ factor.
Key idea
$$a^3 - b^3 = (a - b)(a^2 + ab + b^2) \qquad a^3 + b^3 = (a + b)(a^2 - ab + b^2)$$ The binomial copies the sign in the middle of the original. The trinomial's middle term gets the opposite sign, and its last term is always $+b^2$.
Why it works
Check by multiplying. $(a - b)(a^2 + ab + b^2)$ $= a^3 + a^2b + ab^2 - a^2b - ab^2 - b^3$, and the four middle terms cancel in pairs, leaving $a^3 - b^3$. The middle sign has to be the opposite one, or those terms would double instead of cancel. Why must $a - b$ be a factor at all? Put $a = b$: then $a^3 - b^3 = 0$, so by the factor theorem (thinking of $a$ as the variable), $a - b$ divides it.
| $n$ | 1 | 2 | 3 | 4 | 5 | 6 | 10 |
|---|---|---|---|---|---|---|---|
| $n^3$ | 1 | 8 | 27 | 64 | 125 | 216 | 1000 |
Worked examples
Worked example: A difference of cubes
Factor $8x^3 - 27$.
- $8x^3 = (2x)^3$ and $27 = 3^3$, so $a = 2x$ and $b = 3$.
- $(a - b)(a^2 + ab + b^2)$ $= (2x - 3)(4x^2 + 6x + 9)$.
Answer: $(2x - 3)(4x^2 + 6x + 9)$
Worked example: A common factor first
Factor $2x^3 + 54$ completely.
- Take out 2: $2(x^3 + 27)$.
- Sum of cubes with $a = x$, $b = 3$: $2(x + 3)(x^2 - 3x + 9)$.
Answer: $2(x + 3)(x^2 - 3x + 9)$
Common mistake
Copying the binomial's sign into the middle of the trinomial, as in $x^3 + 27 = (x + 3)(x^2 + 3x + 9)$. Multiply it out and you get $x^3 + 6x^2 + 18x + 27$, not $x^3 + 27$. The middle sign is always the opposite one. Also, the trinomial factor never factors further over the integers, so don't try.