Sum And Difference Of Cubes: Formula, Rules & Examples

The sum and difference of cubes formulas factor expressions in which two perfect cubes are added or subtracted.
The sum of cubes formula is:
a³ + b³ = (a + b)(a² – ab + b²)
The difference of cubes formula is:
a³ – b³ = (a – b)(a² + ab + b²)
For example:
x³ + 27
is a sum of cubes because:
27 = 3³
Therefore:
x³ + 27 = x³ + 3³
Apply the formula:
x³ + 27 = (x + 3)(x² – 3x + 9)
For a difference:
x³ – 8 = x³ – 2³
so:
x³ – 8 = (x – 2)(x² + 2x + 4)
The key is to recognize both terms as perfect cubes before applying the correct identity.
What Are the Sum and Difference of Cubes?
A sum of cubes has the form:
a³ + b³
A difference of cubes has the form:
a³ – b³
Examples of sums of cubes include:
x³ + 8
27a³ + 64
125x³ + y³
Examples of differences of cubes include:
x³ – 27
8a³ – 125b³
64x⁶ – y³
The formulas convert these two-term cubic expressions into a linear binomial factor multiplied by a quadratic factor.
Sum of Cubes Formula
The formula for the sum of two cubes is:
a³ + b³ = (a + b)(a² – ab + b²)
Notice the sign pattern.
The first factor keeps the same sign as the original sum:
a + b
The middle term in the quadratic factor uses the opposite sign:
-ab
The final term is always positive:
+b²
So:
a³ + b³
becomes:
(a + b)(a² – ab + b²)
Difference of Cubes Formula
The formula for the difference of two cubes is:
a³ – b³ = (a – b)(a² + ab + b²)
Again, the first factor keeps the original sign:
a – b
The middle term of the quadratic factor switches sign:
+ab
The last term remains positive:
+b²
Therefore:
a³ – b³ = (a – b)(a² + ab + b²)
The Sign Pattern
The two formulas can be remembered structurally:
First factor: same sign
Middle quadratic term: opposite sign
Last quadratic term: always positive
For a sum:
a³ + b³
we get:
(a + b)(a² – ab + b²)
For a difference:
a³ – b³
we get:
(a – b)(a² + ab + b²)
Understanding the structure is safer than memorizing disconnected signs.
Why the Sum of Cubes Formula Works
Expand:
(a + b)(a² – ab + b²)
Distribute a:
a³ – a²b + ab²
Distribute b:
a²b – ab² + b³
Combine:
a³ – a²b + ab² + a²b – ab² + b³
The middle terms cancel:
-a²b + a²b = 0
ab² – ab² = 0
leaving:
a³ + b³
Therefore:
(a + b)(a² – ab + b²) = a³ + b³
Why the Difference of Cubes Formula Works
Expand:
(a – b)(a² + ab + b²)
Distribute a:
a³ + a²b + ab²
Distribute -b:
-a²b – ab² – b³
Combine:
a³ + a²b + ab² – a²b – ab² – b³
The middle terms cancel:
a²b – a²b = 0
ab² – ab² = 0
leaving:
a³ – b³
So the difference formula is verified.
Recognizing Perfect Cubes
Before factoring, identify whether each term is a perfect cube.
Common numerical perfect cubes include:
1 = 1³
8 = 2³
27 = 3³
64 = 4³
125 = 5³
216 = 6³
343 = 7³
512 = 8³
729 = 9³
1000 = 10³
Variable powers are perfect cubes when their exponents are divisible by 3.
For example:
x³ = (x)³
x⁶ = (x²)³
x⁹ = (x³)³
This recognition step determines what a and b should be in the formulas.
Example 1: Factor x³ + 8
Recognize:
8 = 2³
So:
x³ + 8 = x³ + 2³
Use:
a³ + b³ = (a + b)(a² – ab + b²)
with:
a = x
b = 2
Therefore:
x³ + 8 = (x + 2)(x² – 2x + 4)
This is the complete factorization over the real numbers.
Example 2: Factor x³ – 27
Recognize:
27 = 3³
Then:
x³ – 27 = x³ – 3³
Apply the difference formula:
x³ – 27 = (x – 3)(x² + 3x + 9)
Notice the positive middle term in the quadratic factor.
Example 3: Factor 8x³ + 125
Recognize each cube:
8x³ = (2x)³
and:
125 = 5³
Therefore:
8x³ + 125 = (2x)³ + 5³
Use the sum formula:
8x³ + 125 = (2x + 5)((2x)² – (2x)(5) + 5²)
Simplify:
8x³ + 125 = (2x + 5)(4x² – 10x + 25)
Example 4: Factor 8x³ – 125
Recognize:
8x³ = (2x)³
125 = 5³
Use the difference formula:
8x³ – 125 = (2x – 5)((2x)² + (2x)(5) + 5²)
Simplify:
8x³ – 125 = (2x – 5)(4x² + 10x + 25)
The signs differ from the sum-of-cubes case.
Example 5: Variables in Both Terms
Factor:
a³ + b³
This is already in formula form:
a³ + b³ = (a + b)(a² – ab + b²)
Now consider:
x³ + y³
Then:
x³ + y³ = (x + y)(x² – xy + y²)
Nothing requires the second cube to be numerical.
Example 6: Coefficients and Variables
Factor:
27x³ – 64y³
Recognize:
27x³ = (3x)³
and:
64y³ = (4y)³
Apply the difference formula:
27x³ – 64y³ = (3x – 4y)((3x)² + (3x)(4y) + (4y)²)
Simplify:
27x³ – 64y³ = (3x – 4y)(9x² + 12xy + 16y²)
Higher Powers That Are Cubes
An expression does not need exponent 3 specifically to use a cube identity.
Consider:
x⁶ – 64
Since:
x⁶ = (x²)³
and:
64 = 4³
we have:
x⁶ – 64 = (x²)³ – 4³
Apply the formula:
x⁶ – 64 = (x² – 4)(x⁴ + 4x² + 16)
The first factor can be factored further:
x² – 4 = (x – 2)(x + 2)
Therefore:
x⁶ – 64 = (x – 2)(x + 2)(x⁴ + 4x² + 16)
Factoring should continue whenever another recognizable factorization remains.
Example 7: Factor x⁹ + 1
Recognize:
x⁹ = (x³)³
and:
1 = 1³
Therefore:
x⁹ + 1 = (x³)³ + 1³
Apply the sum formula:
x⁹ + 1 = (x³ + 1)(x⁶ – x³ + 1)
The first factor is itself another sum of cubes:
x³ + 1 = x³ + 1³
so:
x³ + 1 = (x + 1)(x² – x + 1)
Therefore:
x⁹ + 1 = (x + 1)(x² – x + 1)(x⁶ – x³ + 1)
This illustrates the importance of checking whether a new factor can be reduced further.
Factor Out the Greatest Common Factor First
Before applying a cube identity, check for a common factor.
Consider:
2x³ – 16
Factor out 2:
2(x³ – 8)
Now recognize:
x³ – 8 = x³ – 2³
Factor:
x³ – 8 = (x – 2)(x² + 2x + 4)
Therefore:
2x³ – 16 = 2(x – 2)(x² + 2x + 4)
Factoring out the greatest common factor first usually produces a cleaner final result.
Example 8: Common Factor Before Cubes
Factor:
3x⁴ + 24x
First find the common factor:
3x
Then:
3x⁴ + 24x = 3x(x³ + 8)
Now factor the sum of cubes:
x³ + 8 = (x + 2)(x² – 2x + 4)
Therefore:
3x⁴ + 24x = 3x(x + 2)(x² – 2x + 4)
Sum of Cubes vs Difference of Squares
The difference of squares formula is:
a² – b² = (a – b)(a + b)
A similar two-factor shortcut does not apply to a sum of squares over the real numbers.
By contrast, both the sum and difference of cubes factor:
a³ + b³ = (a + b)(a² – ab + b²)
a³ – b³ = (a – b)(a² + ab + b²)
Pay attention to both the exponent and the operation between the terms before choosing an identity.
Why a³ + b³ Does Not Equal (a + b)³
A common mistake is:
a³ + b³ = (a + b)³
This is false.
Expanding the right side gives additional terms:
(a + b)³ = a³ + 3a²b + 3ab² + b³
Therefore:
(a + b)³ ≠ a³ + b³
in general.
The correct factorization is:
a³ + b³ = (a + b)(a² – ab + b²)
Why a³ – b³ Does Not Equal (a – b)³
Likewise:
(a – b)³
expands to:
a³ – 3a²b + 3ab² – b³
So:
a³ – b³ ≠ (a – b)³
in general.
The correct formula is:
a³ – b³ = (a – b)(a² + ab + b²)
Solving an Equation Using Difference of Cubes
Consider:
x³ – 64 = 0
Factor:
x³ – 4³ = 0
(x – 4)(x² + 4x + 16) = 0
One factor immediately gives:
x – 4 = 0
so:
x = 4
The quadratic factor has no real roots because:
D = 4² – 4(1)(16)
D = 16 – 64
D = -48
Therefore the only real solution is:
x = 4
Factoring establishes the structure, while the general rules for determining solutions belong to solving equations.
Solving a Sum-of-Cubes Equation
Consider:
x³ + 27 = 0
Factor:
(x + 3)(x² – 3x + 9) = 0
The linear factor gives:
x + 3 = 0
x = -3
The quadratic factor has discriminant:
D = (-3)² – 4(1)(9)
D = 9 – 36
D = -27
Therefore it has no real roots.
The only real solution is:
x = -3
Checking a Factorization
A useful way to verify a cube factorization is to multiply the factors back together.
For example:
(x – 2)(x² + 2x + 4)
Expand:
x³ + 2x² + 4x – 2x² – 4x – 8
Combine:
x³ – 8
The intermediate terms cancel exactly.
This cancellation pattern is built into both cube identities.
Perfect Cube Coefficients
Coefficients must also be perfect cubes.
For example:
64x³ + 125
works because:
64 = 4³
125 = 5³
so:
64x³ + 125 = (4x)³ + 5³
But an expression such as:
2x³ + 7
is not directly a sum of perfect cubes over ordinary integer or rational factoring because neither 2 nor 7 is a perfect cube.
Forcing the cube formula where the terms are not cubes makes the expression more complicated instead of simplifying it.
Fractional Cubes
The identities remain valid when the cube roots are fractions.
For example:
x³ – 1/8
can be recognized as:
x³ – (1/2)³
Therefore:
x³ – 1/8 = (x – 1/2)(x² + x/2 + 1/4)
The formula depends on cube structure, not on whether the cube roots are integers.
Negative Terms
Consider:
x³ + (-8)
This can be viewed as:
x³ – 8
because adding -8 is subtraction.
Use the difference-of-cubes formula:
x³ – 2³ = (x – 2)(x² + 2x + 4)
Identify the actual operation after simplifying signs before choosing the identity.
Sum and Difference of Cubes vs Synthetic Division
The cube formulas are specialized factoring identities. They are ideal when the expression has exactly the structure:
a³ + b³
or:
a³ – b³
A more general cubic polynomial such as:
x³ – 4x² + x + 6
does not have that two-cube structure.
When a suitable linear divisor or root is known, synthetic division can reduce such a polynomial efficiently.
The two methods therefore address different polynomial structures.
Cube Identities and Linear Equations
The cube formulas apply to cubic expressions, not first-degree line equations.
For example, standard form of a line uses:
Ax + By = C
while slope-intercept form uses:
y = mx + b
Neither is factored with sum-or-difference-of-cubes identities because the variables are first degree rather than cubic.
Recognizing degree prevents an unrelated algebraic identity from being applied to the wrong expression.
Cube Identities and Systems
A system of linear equations solves several first-degree equations simultaneously.
Sum and difference of cubes instead factor one cubic expression.
A problem can eventually involve both ideas, but the cube identity itself does not solve a linear system. Its role is to reveal factors in a polynomial with perfect-cube terms.
Does the Quadratic Factor Usually Factor Further?
In:
a³ + b³ = (a + b)(a² – ab + b²)
the quadratic factor:
a² – ab + b²
does not normally factor further over the real numbers when a and b represent ordinary independent real expressions.
Similarly:
a² + ab + b²
from the difference formula generally remains quadratic.
However, after substituting specific algebraic expressions for a and b, other common factors or identities may sometimes appear, so the full result should still be inspected.
Common Sum and Difference of Cubes Mistakes
Using the Wrong Sign in the Quadratic Factor
For a sum:
a³ + b³
the middle term is negative:
a² – ab + b²
For a difference:
a³ – b³
the middle term is positive:
a² + ab + b²
Making the Final Term Negative
The final term is always:
+b²
in both identities.
Forgetting to Cube-Root the Terms
For:
8x³
the cube root is:
2x
not 8x.
Confusing Sum of Cubes With Cube of a Sum
a³ + b³
is not the same as:
(a + b)³
Forgetting the Greatest Common Factor
An expression such as:
6x³ – 48
should first become:
6(x³ – 8)
before the cube identity is applied.
Using the Formula on Non-Cubes
Both terms must be expressible as cubes before the identity applies directly.
Stopping Before the Expression Is Fully Factored
After applying the formula, inspect the resulting factors for another common factor or recognizable identity.
Worked Sum of Cubes Example
Factor completely:
16x⁴ + 54x
First factor out the greatest common factor:
2x(8x³ + 27)
Now recognize:
8x³ = (2x)³
and:
27 = 3³
Apply the sum-of-cubes formula:
8x³ + 27 = (2x + 3)((2x)² – (2x)(3) + 3²)
Simplify:
8x³ + 27 = (2x + 3)(4x² – 6x + 9)
Therefore:
16x⁴ + 54x = 2x(2x + 3)(4x² – 6x + 9)
The expression is fully factored over the real numbers.
Worked Difference of Cubes Example
Factor completely:
250x⁴ – 2x
First factor out:
2x
giving:
2x(125x³ – 1)
Recognize:
125x³ = (5x)³
and:
1 = 1³
Apply the difference formula:
125x³ – 1 = (5x – 1)((5x)² + (5x)(1) + 1²)
Simplify:
125x³ – 1 = (5x – 1)(25x² + 5x + 1)
Therefore:
250x⁴ – 2x = 2x(5x – 1)(25x² + 5x + 1)
Frequently Asked Questions
What is the sum of cubes formula?
The sum of cubes formula is:
a³ + b³ = (a + b)(a² – ab + b²)
What is the difference of cubes formula?
The difference of cubes formula is:
a³ – b³ = (a – b)(a² + ab + b²)
How do you recognize a sum or difference of cubes?
Check whether both terms can be written as perfect cubes and whether they are connected by addition or subtraction.
For example:
8x³ – 27 = (2x)³ – 3³
How do you factor x³ + 27?
Since:
27 = 3³
we have:
x³ + 27 = (x + 3)(x² – 3x + 9)
How do you factor x³ – 8?
Since:
8 = 2³
we get:
x³ – 8 = (x – 2)(x² + 2x + 4)
What happens to the signs in the formula?
The first factor keeps the original sign, the middle term of the quadratic factor uses the opposite sign, and the last term is always positive.
Is a³ + b³ equal to (a + b)³?
No. The expansion of (a + b)³ contains additional middle terms.
Should you factor out a greatest common factor first?
Yes. If the expression has a common factor, removing it first often reveals a sum or difference of cubes.
Can x⁶ – 64 use the difference-of-cubes formula?
Yes, because:
x⁶ = (x²)³
and:
64 = 4³
so:
x⁶ – 64 = (x² – 4)(x⁴ + 4x² + 16)
The factor x² – 4 can then be factored further.
Can the formulas use variables in both terms?
Yes. For example:
x³ + y³ = (x + y)(x² – xy + y²)
Can the formulas be used to solve equations?
Yes. After factoring, set the factors equal to zero according to the zero-product property. The cube identity performs the factorization; ordinary equation-solving rules determine the roots.
When should synthetic division be used instead?
Synthetic division is useful for a more general polynomial when a suitable linear divisor or known root is available. The sum-and-difference-of-cubes formulas are faster when the expression already has the special two-cube pattern.



