Grade 12 IB Math is live, AA and AI · see the IB course

Grade 12 · MHF4U · Advanced Functions

MHF4U: Sum and Difference of Cubes

A sum or difference of cubes factors every time, by a pattern worth memorising: a3+b3=(a+b)(a2−ab+b2)a^3 + b^3 = (a + b)(a^2 - ab + b^2) and a3−b3=(a−b)(a2+ab+b2)a^3 - b^3 = (a - b)(a^2 + ab + b^2). Everything else is recognising aa and bb.

How It Works

The two patterns differ only in signs, and a mnemonic keeps them straight: SOAP, for Same, Opposite, Always Positive. The binomial takes the same sign as the original, the middle term of the trinomial takes the opposite sign, and the last term is always positive. Expand (a+b)(a2−ab+b2)(a + b)(a^2 - ab + b^2) once to see the middle terms cancel.

To use the pattern you need both terms as cubes. Know the perfect cubes to 10001000: 1,8,27,64,125,216,343,512,729,10001, 8, 27, 64, 125, 216, 343, 512, 729, 1000. For variables, the exponent must be a multiple of 33: x6=(x2)3x^6 = (x^2)^3 and 8x3=(2x)38x^3 = (2x)^3. Write aa and bb down explicitly before substituting; most sign errors come from skipping that.

Always take out a common factor first. 3x4−24x3x^4 - 24x does not look like a difference of cubes until you pull out 3x3x and see x3−8x^3 - 8. And when an expression is both a difference of squares and a difference of cubes, like x6−64x^6 - 64, do squares first: it leads to a complete factoring, while cubes first leaves x4+4x2+16x^4 + 4x^2 + 16, which does factor but not by any pattern you know.

The trinomial a2±ab+b2a^2 \pm ab + b^2 does not factor over the real numbers. Its discriminant is b2−4b2=−3b2b^2 - 4b^2 = -3b^2, which is negative. So once you have it, stop. On a test, factor fully ends there.

The same patterns solve equations: x3−8=0x^3 - 8 = 0 becomes (x−2)(x2+2x+4)=0(x - 2)(x^2 + 2x + 4) = 0, and the only real root is x=2x = 2, because the quadratic factor has no real zeros.

5 Worked Examples

Easy first, test level last. Try each one on paper, then open the solution.

  1. Easy

    Factor x3+27x^3 + 27.
    Show solution
    1. 27=3327 = 3^3, so a=xa = x and b=3b = 3, a sum of cubes.
    2. (a+b)(a2−ab+b2)=(x+3)(x2−3x+9)(a + b)(a^2 - ab + b^2) = (x + 3)(x^2 - 3x + 9).

    Answer: x3+27=(x+3)(x2−3x+9)x^3 + 27 = (x + 3)(x^2 - 3x + 9)

  2. Easy

    Factor 8x3−1258x^3 - 125.
    Show solution
    1. 8x3=(2x)38x^3 = (2x)^3 and 125=53125 = 5^3, so a=2xa = 2x and b=5b = 5, a difference of cubes.
    2. (a−b)(a2+ab+b2)=(2x−5)((2x)2+(2x)(5)+52)(a - b)(a^2 + ab + b^2) = (2x - 5)((2x)^2 + (2x)(5) + 5^2).

    Answer: 8x3−125=(2x−5)(4x2+10x+25)8x^3 - 125 = (2x - 5)(4x^2 + 10x + 25)

  3. Medium

    Factor 3x4−24x3x^4 - 24x fully.
    Show solution
    1. Common factor first: 3x(x3−8)3x(x^3 - 8).
    2. x3−8x^3 - 8 is a difference of cubes with a=xa = x, b=2b = 2: (x−2)(x2+2x+4)(x - 2)(x^2 + 2x + 4).
    3. The trinomial has discriminant 4−16<04 - 16 < 0, so it does not factor further.

    Answer: 3x4−24x=3x(x−2)(x2+2x+4)3x^4 - 24x = 3x(x - 2)(x^2 + 2x + 4)

  4. Medium

    Factor x6−64x^6 - 64 fully.
    Show solution
    1. It is a difference of squares, (x3)2−82(x^3)^2 - 8^2, and a difference of cubes, (x2)3−43(x^2)^3 - 4^3. Squares first.
    2. (x3−8)(x3+8)(x^3 - 8)(x^3 + 8).
    3. Each bracket is a sum or difference of cubes: x3−8=(x−2)(x2+2x+4)x^3 - 8 = (x - 2)(x^2 + 2x + 4) and x3+8=(x+2)(x2−2x+4)x^3 + 8 = (x + 2)(x^2 - 2x + 4).

    Answer: x6−64=(x−2)(x+2)(x2+2x+4)(x2−2x+4)x^6 - 64 = (x - 2)(x + 2)(x^2 + 2x + 4)(x^2 - 2x + 4)

  5. Test level

    Factor (x+2)3−27x3(x + 2)^3 - 27x^3 fully.
    Show solution
    1. A difference of cubes with a=x+2a = x + 2 and b=3xb = 3x.
    2. Binomial: a−b=(x+2)−3x=2−2xa - b = (x + 2) - 3x = 2 - 2x.
    3. Trinomial: a2+ab+b2=(x+2)2+3x(x+2)+9x2=x2+4x+4+3x2+6x+9x2=13x2+10x+4a^2 + ab + b^2 = (x + 2)^2 + 3x(x + 2) + 9x^2 = x^2 + 4x + 4 + 3x^2 + 6x + 9x^2 = 13x^2 + 10x + 4.
    4. Take 22 out of the binomial: 2(1−x)(13x2+10x+4)2(1 - x)(13x^2 + 10x + 4). The discriminant of the trinomial is 100−208<0100 - 208 < 0, so it is done.

    Answer: (x+2)3−27x3=2(1−x)(13x2+10x+4)(x + 2)^3 - 27x^3 = 2(1 - x)(13x^2 + 10x + 4)

Learn It on Martian Lab

Martian Lab teaches this in the Factor Theorem and Rational Zeros lesson of its MHF4U Polynomial Equations unit. Watch it, then take the Polynomial Equations practice tests to see if it stuck.

Watch the Factor Theorem and Rational Zeros lesson free

Start Practicing

No credit card required to start.

Get started