The Sum and Difference of Two Cubes

A linear bracket times a quadratic one.

Squares, then cubes

A difference of two squares factors into two brackets: a² − b² = (a − b)(a + b). A difference of two cubes, a³ − b³, factors too, but the second bracket has three terms: a³ − b³ = (a − b)(a² + ab + b²).

The first bracket, a − b, is linear: its terms have no powers. The second bracket, a² + ab + b², is quadratic, because its highest power is 2.

Why the middle terms cancel

Check the identity by multiplying out the right side. Multiply each term of the first bracket by every term of the second.

Multiplying the second bracket by a gives a³ + a²b + ab². Multiplying it by −b gives −a²b − ab² − b³. Add the two rows: a³ + a²b + ab² − a²b − ab² − b³.

The a²b terms cancel, and so do the ab² terms, which leaves a³ − b³. The second bracket is chosen so that exactly this happens: every term that is not a cube appears once with a plus sign and once with a minus sign.

Numbers confirm it. With a = 10 and b = 2, a³ − b³ = 1000 − 8 = 992, and (a − b)(a² + ab + b²) = 8 × (100 + 20 + 4) = 8 × 124 = 992.

The sum of two cubes

For a sum of two cubes, change two signs: a³ + b³ = (a + b)(a² − ab + b²). The linear bracket takes the sign of the sum, a plus, and the middle term of the quadratic bracket takes the opposite sign, a minus. The last term, b², is always a plus.

Multiplying out checks it in the same way: a(a² − ab + b²) + b(a² − ab + b²) = a³ − a²b + ab² + a²b − ab² + b³ = a³ + b³.

A sum of two squares, such as a² + b², has no factors like these. A sum of two cubes does.

Write the number as a cube first

To factor x³ − 8, first write 8 as a cube: 8 = 2³, so x³ − 8 = x³ − 2³. Now it matches a³ − b³ with a = x and b = 2. Put these into the identity: (x − 2)(x² + x × 2 + 2²) = (x − 2)(x² + 2x + 4).

To factor x³ + 27, write 27 = 3³. Then a = x and b = 3, and the identity for a sum gives (x + 3)(x² − 3x + 9).

The cubes worth knowing by sight are 1, 8, 27, 64, 125, 216, 343, 512, 729 and 1000, the cubes of 1 to 10. A letter term can be a cube too: 8x³ = (2x)³, so 8x³ − 1 = (2x − 1)(4x² + 2x + 1).

The usual mistakes

Copying the sign into the middle term. In x³ + 27 the middle term of the quadratic bracket is −3x, not +3x. The middle sign is always the opposite of the sign in the linear bracket.

Leaving out the middle term, as in (x + 3)(x² + 9). That treats a sum of cubes as if it were like a difference of squares. A cube always leaves three terms in the second bracket.

Writing a³ − b³ as (a − b)³. The difference of two cubes is not the cube of the difference: with a = 10 and b = 2, (a − b)³ = 8³ = 512, but a³ − b³ = 992.

Worked example: The Steel in the Walls of a Hollow Cube-Shaped Box, and the Side of a Larger Box

Question A closed box in the shape of a cube is made from steel sheet 1 mm thick, so its outside is a cube of side a mm and its inside is a cube of side b mm, where a − b = 2. (a) A box has an outer side of 101 mm. Factor a3 − b3 and use it to find the volume of steel in the box without a calculator. (b) A larger box made from the same sheet contains 135002 mm3 of steel. Let its outer side be (m + 1) mm. Show that the volume of steel is (6m2 + 2) mm3, and find the outer side.

  1. 1.The steel is the outer cube minus the inner cube, so its volume is a3 − b3 = (a − b)(a2 + ab + b2). Here a = 101 and b = 99.

    outer: a = 101 mminner: b = 99 mma − b = 2steel = a3− b3= (a − b)(a2+ ab + b2)
    outer: a = 101 mminner: b = 99 mma − b = 2steel = a3− b3= (a − b)(a2+ ab + b2)
    The steel is the outer cube minus the inner cube: a3 − b3 = (a − b)(a2 + ab + b2).
  2. 2.a − b = 2, and a2 + ab + b2 = 1012 + 101 × 99 + 992 = 10201 + 9999 + 9801 = 30001.

    outer: a = 101 mminner: b = 99 mma − b = 2a − b = 2a2+ ab + b2= 10201 + 9999 + 9801= 30001
    outer: a = 101 mminner: b = 99 mma − b = 2a − b = 2a2+ ab + b2= 10201 + 9999 + 9801= 30001
    With a = 101 and b = 99: a − b = 2 and a2 + ab + b2 = 10201 + 9999 + 9801 = 30001.
  3. 3.(a) The volume of steel is 2 × 30001 = 60002 mm3. Check: 1013 − 993 = 1030301 − 970299 = 60002.

    outer: a = 101 mminner: b = 99 mma − b = 2a − b = 2, a2+ ab + b2= 30001steel = 2 × 30001 = 60002 mm3
    outer: a = 101 mminner: b = 99 mma − b = 2a − b = 2, a2+ ab + b2= 30001steel = 2 × 30001 = 60002 mm3
    (a) The volume of steel is 2 × 30001 = 60002 mm3.
  4. 4.For the larger box a = m + 1 and b = m − 1. Then a2 + ab + b2 = (m2 + 2m + 1) + (m2 − 1) + (m2 − 2m + 1) = 3m2 + 1, so the volume of steel is 2(3m2 + 1) = 6m2 + 2.

    outer: a = m + 1inner: b = m − 1a − b = 2(m + 1)2+ (m + 1)(m − 1) + (m − 1)2= 3m2+ 1steel = 2(3m2+ 1) = 6m2+ 2
    outer: a = m + 1inner: b = m − 1a − b = 2(m + 1)2+ (m + 1)(m − 1) + (m − 1)2= 3m2+ 1steel = 2(3m2+ 1) = 6m2+ 2
    With a = m + 1 and b = m − 1, a2 + ab + b2 = 3m2 + 1, so the steel is (6m2 + 2) mm3.
  5. 5.Set this equal to the steel in the box: 6m2 + 2 = 135002, so 6m2 = 135000 and m2 = 22500. Then m = 150 or m = −150, and m = −150 would make the outer side negative, so m = 150.

    outer: a = m + 1inner: b = m − 1a − b = 26m2+ 2 = 1350026m2= 135000, m2= 22500m = 150, since m = −150 gives a negative side
    outer: a = m + 1inner: b = m − 1a − b = 26m2+ 2 = 1350026m2= 135000, m2= 22500m = 150, since m = −150 gives a negative side
    6m2 + 2 = 135002 gives m2 = 22500, and a side is positive, so m = 150.
  6. 6.(b) The outer side is 150 + 1 = 151 mm. Check: 1513 − 1493 = 3442951 − 3307949 = 135002.

    outer: 151 mminner: 149 mma − b = 2m = 150outer side = 150 + 1 = 151 mm1513− 1493= 135002
    outer: 151 mminner: 149 mma − b = 2m = 150outer side = 150 + 1 = 151 mm1513− 1493= 135002
    (b) The outer side of the larger box is 151 mm.

Answer: (a) 60002 mm3; (b) the volume of steel is 2(3m2 + 1) = 6m2 + 2, and the outer side is 151 mm

Common mistakes

  • Writing a3 − b3 as (a − b)3, which gives 23 = 8 mm3. The difference of two cubes is not the cube of the difference: the second factor a2 + ab + b2 is needed.
  • Using a2 − ab + b2 as the second factor. That factor belongs to a3 + b3. For a difference of two cubes the middle sign in the second factor is a plus.

More algebraic expressions problems, worked step by step →

Practice The Sum and Difference of Two Cubes in the app