A difference of cubes is used in algebra to factor cubic or higher degree polynomials. The predictable formula for factoring a difference of cubes saves us time if we can recognize the general form.

So, what is a difference of cubes? **A difference of cubes has the form A ^{3} – B^{3} and factors as (A – B)(A^{2} + AB + B^{2}). Each term in a difference of cubes has a perfect cube numerical coefficient and exponents that are multiples of 3. In some cases, we need to factor out a GCF (greatest common factor) to reveal a difference of cubes.**

Of course, there is also a formula for a sum of cubes: A^{3} + B^{3} = (A + B)(A^{2} – AB + B^{2}).

In this article, we’ll talk about difference of cubes and when to use this formula. We’ll also answer some common questions and look at some examples to make the concepts clear.

Let’s get started.

## What Is A Difference Of Cubes?

A difference of cubes is an expression with exactly two terms with opposite signs (one is positive, and the other is negative). Each term has a perfect cube numerical coefficient (such as 1, 8, 27, 64, 125, etc.), and the exponent of every variable is a multiple of 3 (3, 6, 9, 12, etc.)

The formula for factoring a difference of cubes is given by:

**A**^{3}– B^{3}= (A – B)(A^{2}+ AB + B^{2})

The following table summarizes what you should look for to recognize a difference of cubes.

Characteristic | What To Look For |
---|---|

Number Of Terms | 2 |

Signs Of Terms | + and – (one positive, one negative) |

Numerical Coefficients | Perfect Cubes: 1, 8, 27, 64, 125, 216, etc. |

Exponents On Variables | Multiples of 3: 3, 6, 9, 12, 15, 18, 21 etc. |

look for to recognize a difference of cubes.

Note that we can also write a similar formula for factoring a sum of cubes:

**A**^{3}+ B^{3}= (A + B)(A^{2}– AB + B^{2})

### When To Use Difference Of Cubes

We use a difference of cubes to factor certain cubic expressions or as part of the process to factor higher-degree polynomials.

Let’s take a look at some examples that show how to factor a difference of cubes.

#### Example 1: Factor A Difference Of Cubes

Let’s say we want to factor the expression 8x^{3} – y^{6}.

We can recognize this as a difference of cubes, since:

**There are exactly two terms: 8x**^{3}and –y^{3}**The two terms have opposite signs (+ and –)****The numerical coefficients are perfect cubes: 8 = 2**^{3}and 1 = 1^{3}**The exponents on the variables are multiples of 3: 3 for x**^{3 }and 6 for y^{6}

So, we can factor this expression using a difference of cubes. To find A and B, we solve:

**A**^{3}= 8x^{3}**(A**^{3})^{1/3}= (8x^{3})^{1/3}**A = 8**^{1/3}x**A = 2x**

Similarly:

**B**^{3}= y^{6}**(B**^{3})^{1/3}= (y^{6})^{1/3}**B = y**^{2}

Now, we substitute A = 2x and B = y into the formula for factoring a difference of cubes:

**A**^{3}– B^{3}= (A – B)(A^{2}+ AB + B^{2})**(2x)**^{3}– (y^{2})^{3}= (2x – y^{2})((2x)^{2}+ (2x)(y^{2}) + (y^{2})^{2})**8x**^{3}– y^{6}= (2x – y^{2})(4x^{2}+ 2xy^{2}+ y^{4})

#### Example 2: Factor A Difference Of Cubes

Let’s say we want to factor the expression 27x^{6}y^{9} – 64s^{3}t^{12}

We can recognize this as a difference of cubes, since:

**There are exactly two terms: 27x**^{6}y^{9}and – 64s^{3}t^{12}**The two terms have opposite signs (+ and –)****The numerical coefficients are perfect cubes: 27 = 3**^{3}and 64 = 4^{3}**The exponents on the variables are multiples of 3: 6 for x**^{6}, 9 for y^{9}, 3 for s^{3}, and 12 for t^{12}.

In this case, we have A = 3x^{2}y^{3} and B = 4st^{4}.

Now, we substitute A = 3x^{2}y^{3} and B = 4st^{4 }into the formula for factoring a difference of cubes:

**A**^{3}– B^{3}= (A – B)(A^{2}+ AB + B^{2})**(3x**^{2}y^{3})^{3}– (4st^{4})^{3}= (3x^{2}y^{3}– 4st^{4})((3x^{2}y^{3})^{2}+ (3x^{2}y^{3})(4st^{4}) + (4st^{4})^{2})**27x**^{6}y^{9}– 64s^{3}t^{12 }= (3x^{2}y^{3}– 4st^{4})(9x^{4}y^{6}+ 12x^{2}y^{3}st^{4}+ 16s^{2}t^{8})

#### Example 3: Factor A Difference Of Cubes

Let’s say we want to factor the expression 250x^{4}y^{8}z – 16xy^{2}z^{10}.

This does not look like a difference of cubes. However, we can factor out a GCF (greatest common factor) of 2xy^{2}z from both terms to get:

**250x**^{4}y^{8}z – 16xy^{2}z^{10}= 2xy^{2}z(125x^{3}y^{6}– 8z^{9})

Now we can recognize the expression in parentheses as a difference of cubes, since:

**There are exactly two terms: 125x**^{3}y^{6}and – 8z^{9}**The two terms have opposite signs (+ and –)****The numerical coefficients are perfect cubes: 125 = 5**^{3}and 8 = 2^{3}**The exponents on the variables are multiples of 3: 3 for x**^{3}, 6 for y^{6}, and 9 for z^{9}.

In this case, we have A = 5xy^{2} and B = 2z^{3}.

Now, we substitute A = 5xy^{2} and B = 2z^{3 }into the formula for factoring a difference of cubes:

**A**^{3}– B^{3}= (A – B)(A^{2}+ AB + B^{2})**(5xy**^{2})^{3}– (2z^{3})^{3}= (5xy^{2}– 2z^{3})((5xy^{2})^{2}+ (5xy^{2})( 2z^{3}) + (2z^{3})^{2})**125x**^{3}y^{6}– 8z^{9}= (5xy^{2}– 2z^{3})(25x^{2}y^{4}+ 10xy^{2}z^{3}+ 4z^{6})

Don’t forget to include the GCF that we factored out earlier to factor completely:

**250x**^{4}y^{8}z – 16xy^{2}z^{10}**= 2xy**[factor out GCF]^{2}z(125x^{3}y^{6}– 8z^{9})**= 2xy**[factor difference of cubes]^{2}z(5xy^{2}– 2z^{3})(25x^{2}y^{4}+ 10xy^{2}z^{3}+ 4z^{6})

#### Example 4: Factor A Sum Of Cubes

Let’s say we want to factor the expression x^{27} – y^{27}.

We can recognize this as a difference of cubes, since:

**There are exactly two terms: x**^{27}and –y^{27}.**The two terms have opposite signs (+ and –)****The numerical coefficients are perfect cubes: 1 = 1**^{3}and 1 = 1^{3}**The exponents on the variables are multiples of 3: 27 for x**^{27}and 27 for y^{27}.

In this case, we have A = x^{9} and B = y^{9}.

Now, we substitute A = x^{9} and B = y^{9} into the formula for factoring a difference of cubes:

**A**^{3}– B^{3}= (A – B)(A^{2}+ AB + B^{2})**(x**^{9})^{3}– (y^{9})^{3}= (x^{9}– y^{9})((x^{9})^{2}+ (x^{9})( y^{9}) + (y^{9})^{2})**x**^{27}– y^{27 }= (x^{9}– y^{9})(x^{18}+ x^{9}y^{9}+ y^{18})

However, this is not factored completely. Note that the first factor, x^{9} – y^{9}, is also a difference of cubes, so we factor it as well:

**x**^{27}– y^{27}**=(x**^{9}– y^{9})(x^{18}+ x^{9}y^{9}+ y^{18})**=(x**^{3}– y^{3})(x^{6}+ x^{3}y^{3}+ y^{6})(x^{18}+ x^{9}y^{9}+ y^{18})

However, we are still not done, since x^{3} – y^{3 }is also a difference of cubes:

**=(x – y)(x**^{2}+ xy + y^{2})(x^{6}+ x^{3}y^{3}+ y^{6})(x^{18}+ x^{9}y^{9}+ y^{18})

So, the complete factorization (after using a difference of cubes three times) is:

**x**^{27}– y^{27}= (x – y)(x^{2}+ xy + y^{2})(x^{6}+ x^{3}y^{3}+ y^{6})(x^{18}+ x^{9}y^{9}+ y^{18})

#### Example 5: Factor A Sum Of Cubes

Let’s say we want to factor the expression 125x^{6} + y^{9}.

We can recognize this as a sum of cubes, since:

**There are exactly two terms: 125x**^{6}and y^{9}**The two terms have the same signs (+ and +)****The numerical coefficients are perfect cubes: 125 = 5**^{3}and 1 = 1^{3}**The exponents on the variables are multiples of 3: 6 for x**^{6 }and 9 for y^{9}

So, we can factor this expression using a sum of cubes. In this case, A = 5x^{2} and B = y^{3}.

Now, we substitute A = 5x^{2} and B = y^{3 }into the formula for factoring a sum of cubes:

**A**^{3}+ B^{3}= (A + B)(A^{2}– AB + B^{2})**(5x**^{2})^{3}+ (y^{3})^{3}= (5x^{2}+ y^{3})((5x^{2})^{2}– (5x^{2})(y^{3}) + (y^{3})^{2})**(125x**^{6}+ y^{9}) = (5x^{2}+ y^{3})(25x^{4}– 5x^{2}y^{3}+ y^{6})

#### Example 6: Factor A Sum Of Cubes

Let’s say we want to factor the expression 40x^{8}y^{3}z + 135x^{2}z^{10}.

This does not look like a sum of cubes. However, we can factor out a GCF (greatest common factor) of 5x^{2}z from both terms to get:

**40x**^{8}y^{3}z + 135x^{2}z^{10}= 5x^{2}z(8x^{6}y^{3}+ 27z^{9})

Now we can recognize the expression in parentheses as a sum of cubes, since:

**There are exactly two terms: 8x**^{6}y^{3}and 27z^{9}**The two terms have the same signs (+ and +)****The numerical coefficients are perfect cubes: 8 = 2**^{3}and 27 = 3^{3}**The exponents on the variables are multiples of 3: 6 for x**^{6}, 3 for y^{3}, and 9 for z^{9}.

In this case, we have A = 2x^{2}y and B = 3z^{3}.

Now, we substitute A = 2x^{2}y and B = 3z^{3} into the formula for factoring a sum of cubes:

**A**^{3}+ B^{3}= (A + B)(A^{2}– AB + B^{2})**(2x**^{2}y)^{3}+ (3z^{3})^{3}= (2x^{2}y + 3z^{3})((2x^{2}y)^{2}– (2x^{2}y)( 3z^{3}) + (3z^{3})^{2})**8x**^{6}y^{3}+ 27z^{9 }= (2x^{2}y + 3z^{3})(4x^{4}y^{2}– 6x^{2}yz^{3}+ 9z^{6})

### How To Derive The Difference Of Cubes Formula

We can derive the sum of cubes formula if we use the Distributive Property and start with the right side of the equation:

**(A – B)(A**^{2}+ AB + B^{2})**=A(A**[distribute (A^{2}+ AB + B^{2}) – B(A^{2}+ AB + B^{2})^{2}+ AB + B^{2}) through first set of parentheses]**=(A**[distribute A through 1st parentheses, then distribute B through 2^{3}+ A^{2}B + AB^{2}) – (BA^{2}+ AB^{2}+ B^{3})^{nd}parentheses]**=(A**[distribute negative sign through 2^{3}+ A^{2}B + AB^{2}) – BA^{2}– AB^{2}– B^{3}^{nd}parentheses]**=A**[AB^{3}+ A^{2}B – BA^{2}– B^{3}^{2}– AB^{2}= 0]**=A**[A^{3}– B^{3}^{2}B – BA^{2}= 0]

So, this proves that the formula for a difference of cubes is correct.

We can use similar algebra to prove the formula for a sum of cubes as well. A shorter approach is to replace “B” with “-B” in the difference of cubes formula to get:

**(A**[difference of cubes formula]^{3}– B^{3}) = (A – B)(A^{2}+ AB + B^{2})**(A**[replace B by –B everywhere in the formula]^{3}– (-B)^{3}) = (A – (-B))(A^{2}+ A(-B) + (-B)^{2})**(A**[(-B)^{3}– (-B^{3}) = (A + B)(A^{2}– AB + B^{2})^{2}= B^{2}and (-B)^{3}= -B^{3}]**(A**^{3}+ B^{3}) = (A + B)(A^{2}– AB + B^{2})

So, this proves that the formula for a sum of cubes is correct.

## Conclusion

Now you know what a difference of cubes is, when to use it, and how to apply the formula. You also know how to apply a sum of cubes in the same way.

I hope you found this article helpful. If so, please share it with someone who can use the information.

Don’t forget to subscribe to my YouTube channel & get updates on new math videos!

~Jonathon