Sum of Cubes

Sum of Cubes is a factoring formula that breaks a binomial with two cubic terms into a product of a linear and a quadratic factor.

a3+b3=(a+b)(a2ab+b2)a^3 + b^3 = (a + b)(a^2 - ab + b^2)

Solve a problem with Sum of Cubes

Type the problem. The solver will use Sum of Cubes where Sum of Cubes is the right tool, and tell you when it is not.

Drag one in or paste from the clipboard. JPEG, PNG or WebP. You get the transcription to check before anything is solved.

How to get a better answer
  • Paste the whole problem, including the instruction word — "simplify", "solve for x" and "factor" lead to three different answers.
  • Say what you have already tried. "I got x = 4 and the book says 2" turns a solution into a diagnosis.
  • Set the level in the settings button. A calculus shortcut is not a better answer if you have not met derivatives yet.
  • For a photo, get the whole problem in frame and hold the page flat — you get the transcription to fix before anything is solved.

What each symbol means

What Sum of Cubes takes
aa
bb
Sum of Cubes
SymbolMeaning
aaThe first term in the binomial; it must be a perfect cube, meaning it equals some value raised to the third power.
bbThe second term in the binomial; it must also be a perfect cube, and it is added to a3a^3 rather than subtracted.

When to use it

When you see two perfect cubes being added together, use Sum of Cubes to factor them instantly.

Level

Usually taught in: Algebra II

Worked examples

1. Factor a simple sum of cubes

Problem

Factor x3+27x^3 + 27.
  1. x3+27=x3+33x^3 + 27 = x^3 + 3^3

    Recognize that 27=3327 = 3^3, so this is a sum of two perfect cubes.

  2. x3+33=(x+3)(x2(x)(3)+32)x^3 + 3^3 = (x + 3)(x^2 - (x)(3) + 3^2)

    Apply the Sum of Cubes formula (a)3+(b)3=(a+b)(a2ab+b2)(a)^3 + (b)^3 = (a+b)(a^2 - ab + b^2) with a=xa = x and b=3b = 3.

  3. (x+3)(x23x+9)(x + 3)(x^2 - 3x + 9)

    Simplify by evaluating (x)(3)=3x-(x)(3) = -3x and 32=93^2 = 9.

Answer: (x+3)(x23x+9)(x + 3)(x^2 - 3x + 9)

Sum of Cubes directly factors this binomial. Since both x3x^3 and 2727 are perfect cubes, we apply the formula and are done.

2. Factor a sum of cubes with coefficients

Problem

Factor 64a3+164a^3 + 1.
  1. 64a3+1=(4a)3+1364a^3 + 1 = (4a)^3 + 1^3

    Recognize that 64a3=(4a)364a^3 = (4a)^3 and 1=131 = 1^3, so we have a sum of perfect cubes.

  2. (4a)3+13=(4a+1)((4a)2(4a)(1)+12)(4a)^3 + 1^3 = (4a + 1)((4a)^2 - (4a)(1) + 1^2)

    Apply the Sum of Cubes formula with a=4aa = 4a and b=1b = 1.

  3. (4a+1)(16a24a+1)(4a + 1)(16a^2 - 4a + 1)

    Evaluate (4a)2=16a2(4a)^2 = 16a^2, (4a)(1)=4a(4a)(1) = 4a, and 12=11^2 = 1 to get the final factorization.

Answer: (4a+1)(16a24a+1)(4a + 1)(16a^2 - 4a + 1)

Recognizing that 64a3=(4a)364a^3 = (4a)^3 is the key step. Once both terms are identified as perfect cubes, the formula applies directly.

3. Factor a sum of cubes from a storage capacity problem

Problem

A cloud storage service offers two account types. One stores m3m^3 gigabytes, the other stores 125125 gigabytes. The total storage is m3+125m^3 + 125 gigabytes. Factor this expression to analyze the relationship between account types.
  1. m3+125=m3+53m^3 + 125 = m^3 + 5^3

    Recognize that 125=53125 = 5^3, so this is a sum of two perfect cubes.

  2. m3+53=(m+5)(m2(m)(5)+52)m^3 + 5^3 = (m + 5)(m^2 - (m)(5) + 5^2)

    Apply the Sum of Cubes formula with a=ma = m and b=5b = 5.

  3. (m+5)(m25m+25)(m + 5)(m^2 - 5m + 25)

    Simplify by computing (m)(5)=5m-(m)(5) = -5m and 52=255^2 = 25.

Answer: (m+5)(m25m+25)(m + 5)(m^2 - 5m + 25)

The factorization shows how total storage is a product of a linear factor and a quadratic factor, revealing the capacity relationship structure.

Common mistakes

Where Sum of Cubes usually goes wrong
Answer came out wrong
Writing (x+2)(x22x4)(x + 2)(x^2 - 2x - 4) when factoring x3+8x^3 + 8.
The correct factorization is (x+2)(x22x+4)(x + 2)(x^2 - 2x + 4) where the middle term is ab=2x-ab = -2x and the last term is +b2=+4+b^2 = +4.
Using (a+b)(a2+ab+b2)(a + b)(a^2 + ab + b^2) to factor a3+b3a^3 + b^3.
For Sum of Cubes, use (a+b)(a2ab+b2)(a+b)(a^2 - ab + b^2). For Difference of Cubes a3b3a^3 - b^3, use (ab)(a2+ab+b2)(a-b)(a^2 + ab + b^2) with a positive middle term.
Trying to factor x3+y3x^3 + y^3 as (x+y)3(x + y)^3 or into two identical binomials.
The correct factorization is (x+y)(x2xy+y2)(x + y)(x^2 - xy + y^2), and the quadratic factor cannot be factored further over the real numbers.
The mistakeWhy it is wrongThe fix
Writing (x+2)(x22x4)(x + 2)(x^2 - 2x - 4) when factoring x3+8x^3 + 8.The sign pattern in the quadratic factor is often confused; the middle term must be negative and the last term must be positive.The correct factorization is (x+2)(x22x+4)(x + 2)(x^2 - 2x + 4) where the middle term is ab=2x-ab = -2x and the last term is +b2=+4+b^2 = +4.
Using (a+b)(a2+ab+b2)(a + b)(a^2 + ab + b^2) to factor a3+b3a^3 + b^3.The Sum of Cubes formula is confused with the Difference of Cubes formula, which has a positive middle term instead of negative.For Sum of Cubes, use (a+b)(a2ab+b2)(a+b)(a^2 - ab + b^2). For Difference of Cubes a3b3a^3 - b^3, use (ab)(a2+ab+b2)(a-b)(a^2 + ab + b^2) with a positive middle term.
Trying to factor x3+y3x^3 + y^3 as (x+y)3(x + y)^3 or into two identical binomials.Sum of Cubes produces one linear factor and one quadratic factor, not two identical factors or a perfect cube.The correct factorization is (x+y)(x2xy+y2)(x + y)(x^2 - xy + y^2), and the quadratic factor cannot be factored further over the real numbers.

Tips and when to use something else

  • Always verify that both terms are perfect cubes before applying the formula. For instance, x3+10x^3 + 10 cannot use Sum of Cubes since 1010 is not a perfect cube.
  • Remember the sign pattern: a3+b3=(a+b)(a2ab+b2)a^3 + b^3 = (a+b)(a^2 - ab + b^2) has a negative middle term. If you see a3b3a^3 - b^3 instead, you need Difference of Cubes (ab)(a2+ab+b2)(a-b)(a^2 + ab + b^2) with a positive middle term.
  • The quadratic factor in the result is typically irreducible over the reals, so your factorization is complete. Do not attempt to factor it further.
  • Sum of Cubes applies only to addition; subtraction requires a different method. Always check whether you have a sum or difference before selecting your factoring strategy.

Frequently asked questions

What if only one of the terms is a perfect cube?
Sum of Cubes requires both terms to be perfect cubes. If only one is, you cannot use this formula. Try factoring by grouping, finding a common factor, or another factoring technique instead.
Why cannot the quadratic factor be factored further?
The quadratic a2ab+b2a^2 - ab + b^2 from the Sum of Cubes formula has a negative discriminant, meaning it has no real roots. This is why it cannot be factored into real linear factors.
Is Sum of Cubes the only way to factor a sum of cubes?
For a binomial of two perfect cubes, Sum of Cubes is the primary and most direct method. In some cases a common factor may first be present, but once removed, Sum of Cubes handles the remaining expression.
How do I tell Sum of Cubes apart from Difference of Cubes?
Sum of Cubes handles a3+b3a^3 + b^3 (addition) and gives (a+b)(a2ab+b2)(a+b)(a^2 - ab + b^2). Difference of Cubes handles a3b3a^3 - b^3 (subtraction) and gives (ab)(a2+ab+b2)(a-b)(a^2 + ab + b^2). The key difference is the operation (plus or minus) and the sign of the middle term in the quadratic.

Need a different method?

The full solver is not scoped to one formula — type any problem and it will pick the method.

Open the math solver

Reviewed 2026-09-18