Free lesson

Every lesson is free, no account needed. Make a free account to save your progress.

Live classGet practice + mocks
  1. Home
  2. Lesson Library
  3. Sum and difference of cubes
UPCAT Math Review · Algebra

Sum and Difference of Cubes

Two formulas, and one three-letter word that keeps the signs straight.

Factor

x³ − 27

Spot the cubes.

nn³nn³
116216
287343
3278512
4649729
5125101000

A variable is a cube when its exponent divides by 3 — x³, x⁶, 8x³ = (2x)³.

Two terms, not three

These formulas only apply to a binomial. Unlike a sum of squares, a sum of cubes does factor — a² + b² does not.

The two formulas.

a³ − b³ = (a − b)(a² + ab + b²)

a³ + b³ = (a + b)(a² − ab + b²)

S — Same

the binomial keeps the original sign

O — Opposite

the middle term flips it

AP — Always Positive

the last term never changes

SOAP. It is the only part of these formulas people get wrong.

x³ − 27.

a = x, b = 3

since 3³ = 27

(x − 3)(x² + 3x + 9)

same, opposite, positive

PieceBuilt fromHere
a²x squaredx²
abx times 33x
b²3 squared9

8x³ + 125 — with coefficients.

8x³ = (2x)³, 125 = 5³

a = 2x, b = 5

(2x + 5)(a² − ab + b²)

a sum, so plus then minus

a² = 4x², ab = 10x, b² = 25

square and multiply

(2x + 5)(4x² − 10x + 25)

done

(x − 3)(x² + 3x + 9)  ·  (2x + 5)(4x² − 10x + 25)

Square the whole thing

a² with a = 2x is 4x², not 2x². And ab is 2x × 5 = 10x, not 5x. Every coefficient comes along for the ride.

The trinomial will not factor further.

x² + 3x + 9

try the discriminant

9 − 4(1)(9) = −27

negative

no real roots → prime

leave it alone

The second bracket from a cube formula never factors over the real numbers. If yours does, check the arithmetic.

Watch for a common factor first, though: 2x³ − 54 is 2(x³ − 27), and only then does the cube formula apply.

Sixth powers: squares first, then cubes.

x6 is both (x³)² and (x²)³. Factor completely: x6 − 1. Treat it as a difference of squares first.

x6 − 1 = (x³)² − 1² = (x³ − 1)(x³ + 1)

difference of squares

x³ − 1 = (x − 1)(x² + x + 1)

SOAP, minus version

x³ + 1 = (x + 1)(x² − x + 1)

SOAP, plus version

(x − 1)(x + 1)(x² + x + 1)(x² − x + 1)

four factors

Cubes first hides a factor

Treating x6 − 1 as (x²)³ − 1 gives (x² − 1)(x4 + x² + 1), and x4 + x² + 1 still factors, which is easy to miss. Squares first lands on all four pieces. A sum of squares such as x² + 1 is never one of them.

Variations: the number first, a fraction cube, a higher power of a letter.

Factor 125 − x³.

a = 5, b = x

a is whatever comes first

(5 − x)(25 + 5x + x²)

x = 1: 124 = 4 × 31 ✓

Different: the order is reversed, so the short bracket is (5 − x), not (x − 5). Both can appear in the choices.

Factor x³ − 164.

164 = (14)³

cube root of top and bottom

(x − ¼)(x² + ¼x + 116)

ab = ¼x, b² = 116

Different: b is a fraction, so b² shrinks — 116, not 18. At x = 1 both sides give 6364.

Factor 8a⁶ − b³.

8a⁶ = (2a²)³

6 ÷ 3 = 2 on the exponent

(2a² − b)((2a²)² + 2a²b + b²)

SOAP with a = 2a²

(2a² − b)(4a⁴ + 2a²b + b²)

a = b = 1: 7 = 1 × 7 ✓

Different: the cube root of a⁶ is a², and squaring it in the long bracket gives a⁴.

(2a²)² is 4a⁴, not 4a²

Squaring the block means squaring the 2 and doubling the exponent. Writing 4a² or 2a⁴ is the slip the wrong choices are built on.

The formula with blocks, numbers and given values.

a and b can be any expression. Factor (x − 2)³ + 27 with a = x − 2 and b = 3.

(a + b) = x − 2 + 3 = x + 1

the short bracket

a² − ab + b² = (x − 2)² − 3(x − 2) + 9

the long bracket, block kept whole

= x² − 4x + 4 − 3x + 6 + 9 = x² − 7x + 19

tidy

(x + 1)(x² − 7x + 19)

x = 0: −8 + 27 = 19 = (1)(19) ✓

Also askedThe move
a + b = 5, ab = 6; find a³ + b³a² − ab + b² = (a + b)² − 3ab = 25 − 18 = 7, so a³ + b³ = 5 × 7 = 35
a − b = 2, ab = 5; find a³ − b³a² + ab + b² = (a − b)² + 3ab = 4 + 15 = 19, so a³ − b³ = 2 × 19 = 38
(47³ − 3³) ÷ (47² + 47 × 3 + 3²)the bottom is the long bracket of a³ − b³, so the answer is 47 − 3 = 44
x³ + y³ + x + y(x + y)(x² − xy + y²) + (x + y) = (x + y)(x² − xy + y² + 1)

On the exam

Cube items test SOAP directly (“which is a factor of 64x³ − 1”), or hide the pattern: a sixth power, a bracket as a, a fraction built from two cubes, or a³ ± b³ from a ± b and ab. If you see two cubes, write the SOAP brackets at once — and test a choice by putting in a small x such as 0 or 1.

Check: expand the first one.

x(x² + 3x + 9) x³ + 3x² + 9x —
−3(x² + 3x + 9) −3x² − 9x − 27 —
add them x³ − 27 the middles cancel ✓
numeric test x = 4: 64 − 27 = 37 (1)(37) = 37 ✓

Remember the flow

Find a and b · Binomial keeps the sign · SOAP

The trinomial never factors again.
Now you try

Practice problem

Factor

27x³ − 8