# Sum and Difference of Cubes

The sum or difference of two cubes can be factored into a product of a binomial times a trinomial.

That is, ${x}^{3}+{y}^{3}=\left(x+y\right)\left({x}^{2}-xy+{y}^{2}\right)$ and ${x}^{3}-{y}^{3}=\left(x-y\right)\left({x}^{2}+xy+{y}^{2}\right)$ .

A mnemonic for the signs of the factorization is the word "SOAP", the letters stand for "Same sign" as in the middle of the original expression, "Opposite sign", and "Always Positive".

That is, ${x}^{3}±{y}^{3}=\left(x\left[\text{Same}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{sign}\right]y\right)\left({x}^{2}\left[\text{Opposite}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{sign}\right]xy\left[\text{Always}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{Positive}\right]{y}^{2}\right)$

Example 1:

Factor $27{p}^{3}+{q}^{3}$ .

Try to write each of the terms as a cube of an expression.

$27{p}^{3}+{q}^{3}={\left(3p\right)}^{3}+{\left(q\right)}^{3}$

Use the factorization of sum of cubes to rewrite.

$\begin{array}{l}27{p}^{3}+{q}^{3}={\left(3p\right)}^{3}+{\left(q\right)}^{3}\\ \text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}=\left(3p+q\right)\left({\left(3p\right)}^{2}-3pq+{q}^{2}\right)\\ \text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}=\left(3p+q\right)\left(9{p}^{2}-3pq+{q}^{2}\right)\end{array}$

Example 2:

Factor $40{u}^{3}-625{v}^{3}$ .

Factor out the GCF from the two terms.

$40{u}^{3}-625{v}^{3}=5\left(8{u}^{3}-125{v}^{3}\right)$

Try to write each of the terms in the binomial as a cube of an expression.

$8{u}^{3}-125{v}^{3}={\left(2u\right)}^{3}-{\left(5v\right)}^{3}$

Use the factorization of difference of cubes to rewrite.

$\begin{array}{l}5\left(8{u}^{3}-125{v}^{3}\right)=5\left({\left(2u\right)}^{3}-{\left(5v\right)}^{3}\right)\\ \text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}=5\left[\left(2u-5v\right)\left({\left(2u\right)}^{2}+10uv+{\left(5v\right)}^{2}\right)\right]\\ \text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}=5\left(2u-5v\right)\left(4{u}^{2}+10uv+25{v}^{2}\right)\end{array}$