Sum and Difference of Cubes
The sum and difference of cubes are two factoring patterns. A sum of cubes factors as a^3 + b^3 = (a + b)(a^2 - ab + b^2), and a difference of cubes factors as a^3 - b^3 = (a - b)(a^2 + ab + b^2). To use them, write each term as something cubed, find a and b, and substitute.
Before this lesson: You should know Factoring Out the GCF, Factoring the Difference of Squares, Cube Roots and Multiplying Polynomials.
Spotting a Sum or Difference of Cubes
A perfect cube is something times itself three times, like 8 = 2^3 or 27x^3 = (3x)^3. A sum of cubes is two perfect cubes added. A difference of cubes is one perfect cube minus another.
| n | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
|---|---|---|---|---|---|---|---|---|---|---|
| n^3 | 1 | 8 | 27 | 64 | 125 | 216 | 343 | 512 | 729 | 1000 |
Variables are cubes when the exponent is a multiple of 3, like x^3 or y^6 = (y^2)^3.
The Formulas
a^3 + b^3 = (a + b)(a^2 - ab + b^2)
a^3 - b^3 = (a - b)(a^2 + ab + b^2)
Both formulas have the same shape: a binomial times a trinomial. Only the signs change. The word SOAP helps you remember them.
You can check either formula by multiplying. For the difference: (a - b)(a^2 + ab + b^2) = a^3 + a^2b + ab^2 - a^2b - ab^2 - b^3. The middle terms cancel, leaving a^3 - b^3.
Worked Examples
Example 1: A sum of cubes
Factor x^3 + 27.
- Write each term as a cube (see cube roots): x^3 + 3^3
- Name the parts: a = x and b = 3
- Write the sum of cubes formula: (a + b)(a^2 - ab + b^2)
- Substitute: (x + 3)(x^2 - x \cdot 3 + 3^2)
- Simplify the trinomial: (x + 3)(x^2 - 3x + 9)
Answer: (x + 3)(x^2 - 3x + 9)
Example 2: A difference of cubes with a coefficient
Factor 8y^3 - 125.
- Write each term as a cube (see exponent rules): (2y)^3 - 5^3
- Name the parts: a = 2y and b = 5
- Write the difference of cubes formula: (a - b)(a^2 + ab + b^2)
- Substitute: (2y - 5)((2y)^2 + 2y \cdot 5 + 5^2)
- Simplify the trinomial: (2y - 5)(4y^2 + 10y + 25)
Answer: (2y - 5)(4y^2 + 10y + 25)
Example 3: Factor out the GCF first
Factor 2x^4 + 54x completely.
- Factor out the GCF, 2x (see factoring out the GCF): 2x(x^3 + 27)
- Write the sum as cubes: 2x(x^3 + 3^3)
- Use the sum of cubes formula with a = x, b = 3: 2x(x + 3)(x^2 - 3x + 9)
Answer: 2x(x + 3)(x^2 - 3x + 9). The trinomial does not factor any further with real numbers.
Example 4: Two variables
Factor 64m^3 - 27n^3.
- Write each term as a cube: (4m)^3 - (3n)^3
- Name the parts: a = 4m and b = 3n
- Substitute into the difference formula: (4m - 3n)((4m)^2 + 4m \cdot 3n + (3n)^2)
- Simplify the trinomial: (4m - 3n)(16m^2 + 12mn + 9n^2)
Answer: (4m - 3n)(16m^2 + 12mn + 9n^2)
Example 5: Word problem with a hollowed cube
A wooden cube has edges of x inches. A cube with 2-inch edges is cut out of one corner. Write the remaining volume in factored form, then find it when x = 5.
- Subtract the volumes: x^3 - 2^3 = x^3 - 8
- Name the parts: a = x and b = 2
- Use the difference of cubes formula: (x - 2)(x^2 + 2x + 4)
- Substitute x = 5: (5 - 2)(5^2 + 2(5) + 4)
- Simplify inside the parentheses: (3)(25 + 10 + 4)
- Add: 3(39)
- Multiply: 117
Answer: The volume is (x - 2)(x^2 + 2x + 4) cubic inches, which is 117 cubic inches when x = 5. Check: 5^3 - 8 = 125 - 8 = 117.
Common Mistakes
| Mistake | Example of the error | Fix |
|---|---|---|
| Treating it like a cube of a sum | x^3 + 8 = (x + 2)^3 | (x + 2)^3 = x^3 + 6x^2 + 12x + 8. Use the formula: (x + 2)(x^2 - 2x + 4). |
| Wrong middle sign | x^3 - 8 = (x - 2)(x^2 - 2x + 4) | SOAP: the middle sign is the opposite: (x - 2)(x^2 + 2x + 4). |
| Doubling the middle term | x^3 - 8 = (x - 2)(x^2 + 4x + 4) | The middle term is ab = 2x, not 2ab. |
| Forgetting to cube the coefficient | 8y^3 = (8y)^3 | 8y^3 = (2y)^3, since 2^3 = 8. |
| Factoring the trinomial again | Trying to factor x^2 + 2x + 4 | This trinomial never factors with real numbers. Its discriminant is negative. |
Practice Problems
- Factor x^3 + 8.
- Factor y^3 - 64.
- Factor 27x^3 + 1.
- Factor 125 - t^3.
- Factor 8a^3 + 27b^3.
- Factor 3x^3 - 24 completely.
- Factor x^4 + 1000x completely.
- Factor 216p^3 - 343.
- Factor x^6 - 64 completely.
- A cube-shaped planter holds 343 cubic inches. Write the equation x^3 - 343 = 0, factor it, and find the edge length x.
Show answers
- Cubes: x^3 + 2^3, so a = x and b = 2
Substitute: (x + 2)(x^2 - x \cdot 2 + 2^2)
Simplify: (x + 2)(x^2 - 2x + 4) - Cubes: y^3 - 4^3, so a = y and b = 4
Substitute: (y - 4)(y^2 + y \cdot 4 + 4^2)
Simplify: (y - 4)(y^2 + 4y + 16) - Cubes: (3x)^3 + 1^3, so a = 3x and b = 1
Substitute: (3x + 1)((3x)^2 - 3x \cdot 1 + 1^2)
Simplify: (3x + 1)(9x^2 - 3x + 1) - Cubes: 5^3 - t^3, so a = 5 and b = t
Substitute: (5 - t)(5^2 + 5 \cdot t + t^2)
Simplify: (5 - t)(25 + 5t + t^2) - Cubes: (2a)^3 + (3b)^3
Substitute: (2a + 3b)((2a)^2 - 2a \cdot 3b + (3b)^2)
Simplify: (2a + 3b)(4a^2 - 6ab + 9b^2) - Factor out 3: 3(x^3 - 8)
Cubes: 3(x^3 - 2^3)
Formula: 3(x - 2)(x^2 + 2x + 4) - Factor out x: x(x^3 + 1000)
Cubes: x(x^3 + 10^3)
Formula: x(x + 10)(x^2 - 10x + 100) - Cubes: (6p)^3 - 7^3
Substitute: (6p - 7)((6p)^2 + 6p \cdot 7 + 7^2)
Simplify: (6p - 7)(36p^2 + 42p + 49) - Write as a difference of squares (see factoring the difference of squares): (x^3)^2 - 8^2 = (x^3 - 8)(x^3 + 8)
Factor the difference of cubes: x^3 - 8 = (x - 2)(x^2 + 2x + 4)
Factor the sum of cubes: x^3 + 8 = (x + 2)(x^2 - 2x + 4)
Answer: (x - 2)(x^2 + 2x + 4)(x + 2)(x^2 - 2x + 4) - Cubes: x^3 - 7^3 = 0
Factor: (x - 7)(x^2 + 7x + 49) = 0
First factor: x - 7 = 0, so x = 7
Second factor: discriminant 7^2 - 4(1)(49)
Square and multiply: 49 - 196
Subtract: -147, which is negative, so no real solutions (see the discriminant)
Answer: the edge is 7 inches
FAQ
What is the formula for the sum of cubes?
a^3 + b^3 = (a + b)(a^2 - ab + b^2). For example, x^3 + 27 = (x + 3)(x^2 - 3x + 9).
What is the formula for the difference of cubes?
a^3 - b^3 = (a - b)(a^2 + ab + b^2). For example, x^3 - 8 = (x - 2)(x^2 + 2x + 4).
What does SOAP stand for?
Same, Opposite, Always Positive. The binomial factor keeps the same sign as the original, the middle term of the trinomial has the opposite sign, and the last term is always positive.
Can the trinomial factor be factored again?
Not with real numbers. Trinomials like x^2 + 2x + 4 have a negative discriminant, so their zeros are complex (see complex solutions of quadratic equations).
Summary
- Sum of cubes: a^3 + b^3 = (a + b)(a^2 - ab + b^2).
- Difference of cubes: a^3 - b^3 = (a - b)(a^2 + ab + b^2).
- Use SOAP for the signs: Same, Opposite, Always Positive.
- Write each term as a cube first, and factor out any GCF before you start.
- The middle term is ab, not 2ab, and the trinomial never factors further over the reals.
Previous lesson: Remainder and Factor Theorems
Next lesson: Solving Polynomial Equations
Back to the Algebra 2 Index