# Sum and Difference of Two Cubes

The difference of two cubes can be factored. That is, A3B3 can be factored. The factorization is given by

A3B3 = (AB)(A2 + AB + B2).

We can check this factorization by multiplying out the right hand side and simplifying:

(AB)(A2 + AB + B2) = (AB)A2 + (AB)AB + (AB)B2 = A3A2B + A2BAB2 + AB2B3 = A3B3.

Unlike the sum of two squares (which factors only if we use complex numbers), the sum of two cubes can be factored. That is, A3 + B3 can be factored. The factorization is given by

A3 + B3 = (A + B)(A2AB + B2).

We can check this factorization by multiplying out the right hand side and simplifying:

(A + B)(A2AB + B2) = (A + B)A2 − (A + B)AB + (A + B)B2 = A3 + A2BA2BAB2 + AB2 + B3 = A3 + B3.

Let's look at a couple of examples.

\begin{align} 8x^3 - 27&= (2x)^3 - 3^3\\&=(2x-3)((2x)^2+(2x)\cdot 3+3^2\\&=(2x-3)(4x^2+6x+9) \end{align}
\begin{align} 125x^3 + 8 &= (5x)^3 + 2^3\\&=(5x+2)((5x)^2-(5x)\cdot 2+2^2\\&=(5x+2)(25x^2-10x+4) \end{align}

Try a few yourself. Move your mouse over the solution box to see the solution. If you have trouble use the pencast below.

1. Factor x3-27.

 Solution

2. Factor 8x3+y3.

 Solution