Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools

How to Factor a Sum or Difference of Cubes

Two perfect cubes added or subtracted always factor into a binomial times a trinomial: a3±b3=(a±b)(a2∓ab+b2)a^3 \pm b^3 = (a \pm b)(a^2 \mp ab + b^2). Unlike squares, a sum of cubes factors too.

Recognize the task

Two terms, both perfect cubes, with ++ or −- between them: 8x3−278x^3 - 27, x3+64x^3 + 64, 54y3+254y^3 + 2 (after a GCF), x6−1x^6 - 1. Test: is each term a cube (1,8,27,64,125,…1, 8, 27, 64, 125, \ldots; x3,x6,…x^3, x^6, \ldots)?
The identities are the sum of cubes and difference of cubes; the lesson section is Sum and Difference of Cubes.

Steps

StepOn 8x3−278x^3 - 27
1Take out a GCF if there is one. GCF first: 54y3+2=2(27y3+1)54y^3 + 2 = 2(27y^3 + 1).none
2Write each term as a cube. Identify aa and bb.(2x)3−33(2x)^3 - 3^3: a=2xa = 2x, b=3b = 3
3Apply the formula with the right signs. Signs: Same, Opposite, Always Positive. The binomial copies the sign, the middle term of the trinomial takes the opposite sign, the last term is always ++.(2x−3)(4x2+6x+9)(2x - 3)(4x^2 + 6x + 9)
4Check, and leave the trinomial alone. The trinomial a2∓ab+b2a^2 \mp ab + b^2 never factors over the reals.Distribute every term ↗expand: 8x3+12x2+18x−12x2−18x−27=8x3−278x^3 + 12x^2 + 18x - 12x^2 - 18x - 27 = 8x^3 - 27 ✓

Worked examples

Example 1 · a sum of cubes

basic
x3+64=x3+43x^3 + 64 = x^3 + 4^3
a=xa = x, b=4b = 4
(x+4)(x2−4x+16)(x + 4)(x^2 - 4x + 16)

Example 2 · GCF first

hidden cubes
54y3+2=2(27y3+1)54y^3 + 2 = 2(27y^3 + 1)
27y3=(3y)327y^3 = (3y)^3
2(3y+1)(9y2−3y+1)2(3y + 1)(9y^2 - 3y + 1)

Example 3 · sixth powers

squares first
x6−1=(x3−1)(x3+1)x^6 - 1 = (x^3 - 1)(x^3 + 1)
difference of squares first
=(x−1)(x2+x+1)(x+1)(x2−x+1)= (x - 1)(x^2 + x + 1)(x + 1)(x^2 - x + 1)
then both cube formulas

See it happen

A 2x2x-cube with a 33-cube cut out of its corner can be sliced into three slabs. Their volumes add to (2x−3)(4x2+6x+9)(2x - 3)(4x^2 + 6x + 9): one dimension is the difference of the edges, the rest collects the three faces.

Common mistakes

Wrong middle sign

✗ x3+64=(x+4)(x2+4x+16)x^3 + 64 = (x + 4)(x^2 + 4x + 16)
✓ opposite sign in the middle: x2−4x+16x^2 - 4x + 16

Squaring the middle term

✗ (2x−3)(4x2+12x+9)(2x - 3)(4x^2 + 12x + 9)
✓ the middle term is ab=6xab = 6x, not 2ab2ab

Trying to factor the trinomial

✗ x2−4x+16=(x−4)2x^2 - 4x + 16 = (x - 4)^2
✓ (x−4)2=x2−8x+16(x - 4)^2 = x^2 - 8x + 16; the trinomial is prime