Sum and Difference of Cubes

Sum and Difference of Cubes:

a3±b3=(a±b)(a2ab+b2)\color{purple}{a^3 \pm b^3=\left(a\pm b\right)\left(a^2 \mp ab+b^2 \right)}

Proof of this fact is straightforward.

We just prove it from right to left.

Multiply polynomials:

(ab)(a2+ab+b2)=aa2+aab+ab2ba2babbb2={\left({a}-{b}\right)}{\left({{a}}^{{2}}+{a}{b}+{{b}}^{{2}}\right)}={a}\cdot{{a}}^{{2}}+{a}\cdot{a}{b}+{a}\cdot{{b}}^{{2}}-{b}\cdot{{a}}^{{2}}-{b}\cdot{a}{b}-{b}\cdot{{b}}^{{2}}=

=a3+a2b+ab2a2bab2b3=a3b3={{a}}^{{3}}+{{a}}^{{2}}{b}+{a}{{b}}^{{2}}-{{a}}^{{2}}{b}-{a}{{b}}^{{2}}-{{b}}^{{3}}={{a}}^{{3}}-{{b}}^{{3}}.

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

Or written more compactly: a3±b3=(a±b)(a2ab+b2)a^3 \pm b^3=\left(a\pm b\right)\left(a^2 \mp ab+b^2 \right)

Expressions a2+ab+b2{{a}}^{{2}}+{a}{b}+{{b}}^{{2}} and a2ab+b2{{a}}^{{2}}-{a}{b}+{{b}}^{{2}} are often called incomplete squares, because they lack one ab{a}{b} to become perfect square ((a±b)2=a2±2ab+b2)\left({{\left({a}\pm{b}\right)}}^{{2}}={{a}}^{{2}}\pm{\color{red}{{{2}}}}{a}{b}+{{b}}^{{2}}\right).

Don't attempt to factor an incomplete square. It can't be factored.

Example 1. Factor x3+8{{x}}^{{3}}+{8}.

Notice, that 8=23{8}={{2}}^{{3}}.

Thus, x3+8=x3+23=(x+2)(x2x2+22)=(x+2)(x22x+4){{x}}^{{3}}+{8}={{x}}^{{3}}+{{2}}^{{3}}={\left({x}+{2}\right)}{\left({{x}}^{{2}}-{x}\cdot{2}+{{2}}^{{2}}\right)}={\left({x}+{2}\right)}{\left({{x}}^{{2}}-{2}{x}+{4}\right)}.

Answer: x3+8=(x+2)(x22x+4){{x}}^{{3}}+{8}={\left({x}+{2}\right)}{\left({{x}}^{{2}}-{2}{x}+{4}\right)}.

Of course, there can be more complex expressions.

Example 2. Factor 27y364{27}{{y}}^{{3}}-{64}.

Notice, that 27y3=(3y)3{27}{{y}}^{{3}}={{\left({3}{y}\right)}}^{{3}} and 64=43{64}={{4}}^{{3}}.

Thus, 27y364=(3y)343=(3y4)((3y)2+3y4+42)=(3y4)(9y2+12y+16){27}{{y}}^{{3}}-{64}={{\left({3}{y}\right)}}^{{3}}-{{4}}^{{3}}={\left({3}{y}-{4}\right)}{\left({{\left({3}{y}\right)}}^{{2}}+{3}{y}\cdot{4}+{{4}}^{{2}}\right)}={\left({3}{y}-{4}\right)}{\left({9}{{y}}^{{2}}+{12}{y}+{16}\right)}.

Answer: 27y364=(3y4)(9y2+12y+16){27}{{y}}^{{3}}-{64}={\left({3}{y}-{4}\right)}{\left({9}{{y}}^{{2}}+{12}{y}+{16}\right)}.

And even harder...

Example 3. Factor the following: 8m6n9+27a9b3{8}{{m}}^{{6}}{{n}}^{{9}}+{27}{{a}}^{{9}}{{b}}^{{3}}.

Notice, that 8m6n9=(2m2n3)3{8}{{m}}^{{6}}{{n}}^{{9}}={{\left({2}{{m}}^{{2}}{{n}}^{{3}}\right)}}^{{3}} and 27a9b3=(3a3b)3{27}{{a}}^{{9}}{{b}}^{{3}}={{\left({3}{{a}}^{{3}}{b}\right)}}^{{3}}.

Thus, 8m6n9+27a9b3=(2m2n3)3+(3a3b)3={8}{{m}}^{{6}}{{n}}^{{9}}+{27}{{a}}^{{9}}{{b}}^{{3}}={{\left({2}{{m}}^{{2}}{{n}}^{{3}}\right)}}^{{3}}+{{\left({3}{{a}}^{{3}}{b}\right)}}^{{3}}=

=(2m2n3+3a3b)((2m2n3)22m2n33a3b+(3a3b)2)=={\left({2}{{m}}^{{2}}{{n}}^{{3}}+{3}{{a}}^{{3}}{b}\right)}{\left({{\left({2}{{m}}^{{2}}{{n}}^{{3}}\right)}}^{{2}}-{2}{{m}}^{{2}}{{n}}^{{3}}\cdot{3}{{a}}^{{3}}{b}+{{\left({3}{{a}}^{{3}}{b}\right)}}^{{2}}\right)}=

=(2m2n3+3a3b)(4m4n66a3bm2n3+9a6b2)={\left({2}{{m}}^{{2}}{{n}}^{{3}}+{3}{{a}}^{{3}}{b}\right)}{\left({4}{{m}}^{{4}}{{n}}^{{6}}-{6}{{a}}^{{3}}{b}{{m}}^{{2}}{{n}}^{{3}}+{9}{{a}}^{{6}}{{b}}^{{2}}\right)}.

Answer: 8m6n9+27a9b3=(2m2n3+3a3b)(4m4n66a3bm2n3+9a6b2){8}{{m}}^{{6}}{{n}}^{{9}}+{27}{{a}}^{{9}}{{b}}^{{3}}={\left({2}{{m}}^{{2}}{{n}}^{{3}}+{3}{{a}}^{{3}}{b}\right)}{\left({4}{{m}}^{{4}}{{n}}^{{6}}-{6}{{a}}^{{3}}{b}{{m}}^{{2}}{{n}}^{{3}}+{9}{{a}}^{{6}}{{b}}^{{2}}\right)}.

Now, it is time to exercise.

Exercise 1. Factor the following: n3+125{{n}}^{{3}}+{125}.

Answer: (n5)(n2+5n+25){\left({n}-{5}\right)}{\left({{n}}^{{2}}+{5}{n}+{25}\right)}.

Exercise 2. Factor the following: 343+y6x3-{343}+{{y}}^{{6}}{{x}}^{{3}}.

Answer: (y2x7)(y4x2+7y2x+49){\left({{y}}^{{2}}{x}-{7}\right)}{\left({{y}}^{{4}}{{x}}^{{2}}+{7}{{y}}^{{2}}{x}+{49}\right)}. Hint: 343+y6x3=y6x3343-{343}+{{y}}^{{6}}{{x}}^{{3}}={{y}}^{{6}}{{x}}^{{3}}-{343}.

Exercise 3. Factor x3y3z327a3{{x}}^{{3}}{{y}}^{{3}}{{z}}^{{3}}-{27}{{a}}^{{3}}.

Answer: (xyz3a)(x2y2z2+3axyz+9a2){\left({x}{y}{z}-{3}{a}\right)}{\left({{x}}^{{2}}{{y}}^{{2}}{{z}}^{{2}}+{3}{a}{x}{y}{z}+{9}{{a}}^{{2}}\right)}.

Exercise 4. Factor 8x3+1{8}{{x}}^{{3}}+{1}.

Answer: (2x+1)(4x22x+1){\left({2}{x}+{1}\right)}{\left({4}{{x}}^{{2}}-{2}{x}+{1}\right)}.