# 4.7 Factoring the Sum and Difference of Cubes

Now, we will look at two new special products: the sum and difference of cubes. Although the sum of squares cannot be factored, the sum of cubes can be factored into a binomial and a trinomial.

$a^3 + b^3 = (a+b)(a^2 - ab + b^2)$

Similarly, the sum of cubes can be factored into a binomial and a trinomial, but with different signs.
$a^3 -b^3 = (a - b)(a^2 + ab + b^2)$

We can use the acronym SOAP to remember the signs when factoring the sum or difference of cubes. The first letter of each word relates to the signs: Same Opposite Always Positive. For example, consider the following example.

$x^3 - 2^3 = (x - 2)(x^2 + 2x + 4)$

The sign of the first $2$ is the same as the sign between $x^3 - 2^3$. The sign of the $2x$ term is opposite the sign between $x^3 - 2^3$. And the sign of the last term, $4$, is always positive.

## Sum and Difference of Cubes

We can factor the sum of two cubes as

$a^3 + b^3 = (a + b)(a^2 - ab + b^2)$

We can factor the difference of two cubes as

$a^3 - b^3 = (a - b)(a^2 + ab + b^2)$

## How To

Given a sum of cubes or difference of cubes, factor it.

1. Confirm that the first and last term are cubes, $a^3 + b^3$ or $a^3 - b^3$
2. For a sum of cubes, write the factored form as $(a + b)(a^2 - ab + b^2)$. For a difference of cubes, write the factored form as $(a - b)(a^2 + ab + b^2)$.

## Example 1: Factoring a Sum of Cubes

1. Factor $x^3 + 512$.

### Analysis

After writing the sum of cubes this way, we might think we should check to see if the trinomial portion can be factored further. However, the trinomial portion cannot be factored, so we do not need to check.

1. Factor the sum of cubes: $216a^3+b^3$.

## Example 2: Factoring a Difference of Cubes

1. Factor $8x^3 - 125$.

### Analysis

Just as with the sum of cubes, we will not be able to further factor the trinomial portion.

1. Factor the difference of cubes: $1000x^3−1$