Tutorials › Calculus I › Factoring Differences and Sums of Cubes

Algebraic Function Structures · Tutorial 45 of 1495

Factoring Differences and Sums of Cubes

Recognize perfect-cube terms, use the difference and sum of cubes identities, and check the result by expanding the factors.

Beginner 8 min read

What You'll Learn

  • Identify when both terms in a binomial are perfect cubes.
  • Apply the difference of cubes identity with its correct signs.
  • Apply the sum of cubes identity with its correct signs.
  • Factor numerical and variable expressions using cube roots.
  • Verify a proposed factorization by multiplying its factors.
  • Catch common sign errors by comparing the expansion with the original expression.

Why Cube Factoring Has Its Own Pattern

Some polynomial expressions can be factored by recognizing that each term is a perfect cube. For example, \(x^3-64\) is a difference of cubes because \(64=4^3\). The expression \(8a^3+27b^3\) is a sum of cubes because \(8a^3=(2a)^3\) and \(27b^3=(3b)^3\).

These expressions have standard factorizations. The main challenge is remembering the signs in the quadratic factor: the sign between the cube roots matches the original operation, while the middle term in the quadratic factor has the opposite sign. The final term in that factor is positive in both identities.

Key idea: For cube roots \(a\) and \(b\), the difference \(a^3-b^3\) factors as \((a-b)(a^2+ab+b^2)\), and the sum \(a^3+b^3\) factors as \((a+b)(a^2-ab+b^2)\). Verify a factorization by multiplying the factors back together.

The Two Identities

For any real numbers or algebraic expressions \(a\) and \(b\), the difference of cubes identity is

$$ a^3-b^3=(a-b)(a^2+ab+b^2). $$

The sum of cubes identity is

$$ a^3+b^3=(a+b)(a^2-ab+b^2). $$

Each identity expresses a cubic binomial as a linear factor times a quadratic factor. In the difference formula, the linear factor is \(a-b\), and the quadratic factor has two positive signs. In the sum formula, the linear factor is \(a+b\), and the quadratic factor has a negative middle term and a positive final term.

When applying either identity, \(a\) and \(b\) stand for the cube roots of the terms, not for the terms themselves. For instance, in \(x^3-125\), use \(a=x\) and \(b=5\), since \(125=5^3\).

Why the Identities Work

The formulas can be justified directly by multiplying the proposed factors. This also shows why the middle-term signs are essential: the mixed terms cancel, leaving only the original cubes.

1
Expand the difference formula.
Distribute each term of \(a-b\) across the quadratic factor and collect like terms.
2
Expand the sum formula.
Distribute each term of \(a+b\) across the quadratic factor and collect like terms.

For the difference, multiplication gives

$$ \begin{aligned} (a-b)(a^2+ab+b^2) &=a(a^2+ab+b^2)-b(a^2+ab+b^2)\\ &=a^3+a^2b+ab^2-a^2b-ab^2-b^3\\ &=a^3-b^3. \end{aligned} $$

The terms \(a^2b\) cancel, and the terms \(ab^2\) cancel. For the sum, multiplication gives

$$ \begin{aligned} (a+b)(a^2-ab+b^2) &=a(a^2-ab+b^2)+b(a^2-ab+b^2)\\ &=a^3-a^2b+ab^2+a^2b-ab^2+b^3\\ &=a^3+b^3. \end{aligned} $$

Here too, both mixed-term pairs cancel. These expansions prove the identities and provide a reliable way to check any particular use of them.

A Reliable Factoring Procedure

Before applying an identity, check that the expression has exactly the needed structure: two terms, each of which is a perfect cube, joined by subtraction or addition. Then find the cube root of each term and place those roots into the matching formula.

  1. Write each term as a cube, if possible.
  2. Identify the two cube roots \(a\) and \(b\).
  3. Choose the difference identity for subtraction or the sum identity for addition.
  4. Substitute \(a\) and \(b\) into both factors, keeping the signs in the formula.
  5. Multiply the factors to confirm that the original expression is recovered.

A coefficient is a perfect cube when it is the cube of a number, and a variable power is a perfect cube when its exponent is divisible by \(3\). For example, \(64x^6=(4x^2)^3\), because \(4^3=64\) and \((x^2)^3=x^6\). The cube root of \(64x^6\) is therefore \(4x^2\).

Worked Examples

Worked Example: Factor a Difference of Cubes

Factor \(x^3-64\), then verify the result.

First, write both terms as cubes: \(x^3=x^3\) and \(64=4^3\). Thus \(a=x\) and \(b=4\). Since the expression is a difference, use \(a^3-b^3=(a-b)(a^2+ab+b^2)\):

$$ \begin{aligned} x^3-64 &=x^3-4^3\\ &=(x-4)(x^2+4x+16). \end{aligned} $$

To check, multiply the factors:

$$ \begin{aligned} (x-4)(x^2+4x+16) &=x(x^2+4x+16)-4(x^2+4x+16)\\ &=x^3+4x^2+16x-4x^2-16x-64\\ &=x^3-64. \end{aligned} $$

The expanded result is the original expression, so the factorization is correct.

Worked Example: Factor a Sum with Coefficients

Factor \(8a^3+27b^3\), then check by multiplication.

Recognize the terms as cubes: \(8a^3=(2a)^3\), since \(2^3=8\), and \(27b^3=(3b)^3\), since \(3^3=27\). Thus the cube roots are \(2a\) and \(3b\). This is a sum, so use the sum identity:

$$ \begin{aligned} 8a^3+27b^3 &=(2a)^3+(3b)^3\\ &=(2a+3b)\big((2a)^2-(2a)(3b)+(3b)^2\big)\\ &=(2a+3b)(4a^2-6ab+9b^2). \end{aligned} $$

Now expand. The first factor contributes \(2a\) times the quadratic, and the second contributes \(3b\) times the quadratic:

$$ \begin{aligned} (2a+3b)(4a^2-6ab+9b^2) &=8a^3-12a^2b+18ab^2+12a^2b-18ab^2+27b^3\\ &=8a^3+27b^3. \end{aligned} $$

The mixed terms cancel, giving the expression we started with. The negative middle term in the quadratic factor is required for this cancellation.

Worked Example: Factor a Difference with a Variable in Each Term

Factor \(125x^3-y^3\) and verify the signs.

Write \(125x^3=(5x)^3\) and \(y^3=y^3\). The cube roots are \(5x\) and \(y\). Because the original operation is subtraction, apply the difference identity:

$$ \begin{aligned} 125x^3-y^3 &=(5x)^3-y^3\\ &=(5x-y)\big((5x)^2+(5x)y+y^2\big)\\ &=(5x-y)(25x^2+5xy+y^2). \end{aligned} $$

To verify, expand one term from each part of the product:

$$ \begin{aligned} (5x-y)(25x^2+5xy+y^2) &=125x^3+25x^2y+5xy^2\\ &\quad -25x^2y-5xy^2-y^3\\ &=125x^3-y^3. \end{aligned} $$

The \(25x^2y\) terms and the \(5xy^2\) terms cancel, so the expansion verifies the factorization.

Common Sign Mistake

A frequent error is to use the sum identity but put a positive middle term in the quadratic factor. For example, an incorrect attempt at factoring \(x^3+8\) is

$$ x^3+8\overset{\text{wrong}}{=}(x+2)(x^2+2x+4). $$

Multiplication reveals the error:

$$ \begin{aligned} (x+2)(x^2+2x+4) &=x^3+2x^2+4x+2x^2+4x+8\\ &=x^3+4x^2+8x+8, \end{aligned} $$

which is not \(x^3+8\). The sum identity has a negative middle term in its quadratic factor. Since \(8=2^3\), the correction is

$$ x^3+8=(x+2)(x^2-2x+4). $$

Checking confirms the correction:

$$ \begin{aligned} (x+2)(x^2-2x+4) &=x^3-2x^2+4x+2x^2-4x+8\\ &=x^3+8. \end{aligned} $$

The safest way to avoid this mistake is to memorize the two formulas with their signs and multiply back whenever the signs seem uncertain.

When These Identities Apply

These formulas apply directly when an expression consists of two perfect cubes. A binomial such as \(x^3-27\) fits the pattern, as does \(8x^3+1\). By contrast, an expression with more than two terms is not immediately a sum or difference of cubes as written. Also, an expression such as \(x^3+2\) does not have an integer cube root for its constant term, though the identity can still be written using the real cube root of \(2\).

In a polynomial factoring problem, the useful first recognition is often that the coefficients and variable powers permit simple cube roots. If the terms can be written as \(a^3\) and \(b^3\), then the standard identity applies directly. The identity does not assert that every cubic polynomial factors in this way; it addresses the specific two-term patterns \(a^3-b^3\) and \(a^3+b^3\).

It is also worth distinguishing the identities from the square identities. A sum of squares does not follow this cube pattern: \(a^2+b^2\) has no corresponding factorization over the real numbers into linear factors in general. For cube factoring, the exponents and the operation between the terms both matter.

Summary

Factoring a difference or sum of cubes begins by identifying the cube roots of the two terms. For a difference, keep a minus sign in the linear factor and use all positive signs in the quadratic factor. For a sum, use a plus sign in the linear factor, a negative middle term in the quadratic factor, and a positive final term.

Takeaway: Difference: \((a-b)(a^2+ab+b^2)\). Sum: \((a+b)(a^2-ab+b^2)\). In either case, expansion confirms that the mixed terms cancel and the product equals the original binomial.

Check Your Understanding

For each question, keep track of the cube roots and use multiplication to check the signs.

  1. Factor \(x^3-216\).
  2. Factor \(27m^3+8n^3\).
  3. What are the signs in the quadratic factor for a difference of cubes? What are they for a sum of cubes?
  4. Expand \((p+3)(p^2-3p+9)\). Which cube identity does the result verify?
  5. A student writes \(a^3-b^3=(a-b)(a^2-ab+b^2)\). Expand the proposed right-hand side and explain why it does not give the difference of cubes.

Test yourself: Calculus I final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon