# Cube of Sum and Difference

Cube of sum and difference:

$\color{purple}{\left(a\pm b\right)^3=a^3\pm 3a^2 b+3ab^2\pm b^3}$

Let's see how to derive it.

Recall, that exponent is just repeating multiplication.

Thus, we can write that ${{\left({a}+{b}\right)}}^{{3}}={\left({a}+{b}\right)}{{\left({a}+{b}\right)}}^{{2}}$.

From square of sum/difference note, we know, that ${{\left({a}+{b}\right)}}^{{2}}={{a}}^{{2}}+{2}{a}{b}+{{b}}^{{2}}$.

Thus, ${{\left({a}+{b}\right)}}^{{3}}={\left({a}+{b}\right)}{\left({{a}}^{{2}}+{2}{a}{b}+{{b}}^{{2}}\right)}$.

Finally, just multiply polynomials: ${\left({a}+{b}\right)}{\left({{a}}^{{2}}+{2}{a}{b}+{{b}}^{{2}}\right)}={a}\cdot{{a}}^{{2}}+{a}\cdot{2}{a}{b}+{a}\cdot{{b}}^{{2}}+{b}\cdot{{a}}^{{2}}+{b}\cdot{2}{a}{b}+{b}\cdot{{b}}^{{2}}=$

$={{a}}^{{3}}+{3}{{a}}^{{2}}{b}+{3}{a}{{b}}^{{2}}+{{b}}^{{3}}$.

Similarly, it can be shown, that ${{\left({a}-{b}\right)}}^{{3}}={{a}}^{{3}}-{3}{{a}}^{{2}}{b}+{3}{a}{{b}}^{{2}}-{{b}}^{{3}}$.

Or, more shortly: ${{\left({a}\pm{b}\right)}}^{{3}}={{a}}^{{3}}\pm{3}{{a}}^{{2}}{b}+{3}{a}{{b}}^{{2}}\pm{{b}}^{{2}}$.

Example 1. Multiply ${{\left({2}{x}+{y}\right)}}^{{3}}$.

Here ${a}={2}{x}$ and ${b}={y}$.

Just use above formula: ${{\left({2}{x}+{y}\right)}}^{{3}}={{\left({2}{x}\right)}}^{{3}}+{3}\cdot{{\left({2}{x}\right)}}^{{2}}\cdot{\left({y}\right)}+{3}\cdot{\left({2}{x}\right)}\cdot{{\left({y}\right)}}^{{2}}+{{\left({y}\right)}}^{{3}}={8}{{x}}^{{3}}+{12}{{x}}^{{2}}{y}+{6}{x}{{y}}^{{2}}+{{y}}^{{3}}$.

Let's see how to handle minus sign.

Example 2. Multiply ${{\left(\frac{{3}}{{4}}{a}{b}-{2}{c}{d}\right)}}^{{3}}$.

Here ${a}=\frac{{3}}{{4}}{a}{b}$ and ${b}={2}{c}{d}$.

Now, use formula for difference: ${{\left(\frac{{3}}{{4}}{a}{b}-{2}{c}{d}\right)}}^{{3}}={{\left(\frac{{3}}{{4}}{a}{b}\right)}}^{{3}}-{3}\cdot{{\left(\frac{{3}}{{4}}{a}{b}\right)}}^{{2}}\cdot{\left({2}{c}{d}\right)}+{3}\cdot{\left(\frac{{3}}{{4}}{a}{b}\right)}\cdot{{\left({2}{c}{d}\right)}}^{{2}}-{{\left({2}{c}{d}\right)}}^{{3}}=$

$=\frac{{27}}{{64}}{{a}}^{{3}}{{b}}^{{3}}-\frac{{27}}{{8}}{{a}}^{{2}}{{b}}^{{2}}{c}{d}+{9}{a}{b}{{c}}^{{2}}{{d}}^{{2}}-{8}{{c}}^{{3}}{{d}}^{{3}}$.

Finally, let's do a slightly harder example.

Example 3. Multiply the following: ${{\left(-{x}{y}{z}-{2}{{x}}^{{2}}\right)}}^{{3}}$.

Till now, we didn't see two minus signs, but this case can be handled easily.

There are two options:

• ${a}=-{x}{y}{z}$ and ${b}=-{2}{{x}}^{{2}}$; apply sum formula.
• ${a}=-{x}{y}{z}$ and ${b}={2}{{x}}^{{2}}$; apply difference formula.

I choose second option: ${{\left(-{x}{y}{z}-{2}{{x}}^{{2}}\right)}}^{{3}}={{\left(-{x}{y}{z}\right)}}^{{3}}-{3}\cdot{{\left(-{x}{y}{z}\right)}}^{{2}}\cdot{\left({2}{{x}}^{{2}}\right)}+{3}\cdot{\left(-{x}{y}{z}\right)}\cdot{{\left({2}{{x}}^{{2}}\right)}}^{{2}}-{{\left({2}{{x}}^{{2}}\right)}}^{{3}}=$

$=-{{x}}^{{3}}{{y}}^{{3}}{{z}}^{{3}}-{6}{{x}}^{{4}}{{y}}^{{2}}{{z}}^{{2}}-{12}{{x}}^{{5}}{y}{z}-{8}{{x}}^{{6}}$.

From last example we see, that ${\color{purple}{{{{\left(-{a}-{b}\right)}}^{{3}}=-{{\left({a}+{b}\right)}}^{{3}}}}}$.

Now, it is time to exercise.

Exercise 1. Multiply ${{\left({4}{z}+{3}{y}\right)}}^{{3}}$.

Answer: ${64}{{z}}^{{3}}+{144}{{z}}^{{2}}{y}+{108}{z}{{y}}^{{2}}+{27}{{y}}^{{3}}$.

Exercise 2. Multiply ${{\left(-\frac{{1}}{{3}}{{x}}^{{3}}{{y}}^{{2}}+{2}{x}\right)}}^{{3}}$.

Answer: $-\frac{{1}}{{27}}{{x}}^{{9}}{{y}}^{{6}}+\frac{{2}}{{3}}{{x}}^{{7}}{{y}}^{{4}}-{4}{{x}}^{{5}}{{y}}^{{2}}+{8}{{x}}^{{3}}$.

Hint: either swap summands (${{\left(-\frac{{1}}{{3}}{{x}}^{{3}}{{y}}^{{2}}+{2}{x}\right)}}^{{3}}={{\left({2}{x}-\frac{{1}}{{3}}{{x}}^{{3}}{{y}}^{{2}}\right)}}^{{3}}$: commutative property of addition) or proceed as always.

Exercise 3. Multiply the following: ${{\left(-{2}{x}-{1}\right)}}^{{3}}$.

Answer: $-{8}{{x}}^{{3}}-{12}{{x}}^{{2}}-{6}{x}-{1}$.