Sum and Difference of Cubes Calculator
Factor cube binomials using the correct A³ + B³ or A³ - B³ pattern, with a step-by-step explanation that helps students understand why the signs change.
How the sum and difference of cubes pattern works
The sum and difference of cubes formulas are special factoring patterns for binomials. They are useful because expressions such as x³ + 8 or 64y³ - 27 do not factor like ordinary trinomials. OpenStax lists the sum and difference of cubes as part of its factoring polynomials section, along with grouping, perfect square trinomials, and difference of squares.
The important habit is to look for cube roots first. If the first term and second term are both perfect cubes, rewrite the expression as A³ + B³ or A³ - B³. Only then should you apply the pattern. This prevents the most common mistake: using the difference of squares pattern on a cube expression.
Formula patterns
Notice the sign rule: the first factor keeps the original sign, while the trinomial factor uses the opposite sign in the middle term and always has a positive final term.
Worked example: factor x³ + 125
First, identify the cube roots. The cube root of x³ is x, and the cube root of 125 is 5. That means the expression is x³ + 5³, so use the sum of cubes pattern.
The trinomial factor usually does not factor further over the real numbers in basic algebra classes. Do not try to split it as if it were a simple quadratic unless your assignment specifically asks for complex factors.
Common mistakes students make
The biggest mistake is forgetting that a sum of squares does not factor over the real numbers, but a sum of cubes does. Another mistake is changing too many signs. For A³ - B³, the answer is not (A - B)(A² - AB + B²); the middle sign must become positive. Finally, students sometimes identify the cube roots incorrectly: 8x³ is (2x)³, not 8x.
Common questions
-
The sum of cubes formula is A³ + B³ = (A + B)(A² - AB + B²). You use it when both terms are perfect cubes and the sign between them is plus. For example, x³ + 64 becomes x³ + 4³, so the factored form is (x + 4)(x² - 4x + 16). The second factor does not simply copy the original sign pattern; its middle term is negative for a sum of cubes.
-
The difference of cubes formula is A³ - B³ = (A - B)(A² + AB + B²). You use it when both terms are perfect cubes and the sign between them is minus. For example, 27x³ - 8 is (3x)³ - 2³, so it factors as (3x - 2)(9x² + 6x + 4). The first factor uses the same minus sign as the original expression, while the trinomial factor has a positive middle term.
-
Check whether the expression has exactly two terms and whether each term can be written as something cubed. Numbers like 1, 8, 27, 64, 125, and 216 are perfect cubes. Variable powers such as x³, x⁶, and y⁹ can also be cubes because their exponents are multiples of 3. If both terms are cubes, the sign between them tells you whether it is a sum or difference of cubes.
-
In most algebra homework, the trinomial factor from a sum or difference of cubes is left as-is. For example, x³ + 8 factors to (x + 2)(x² - 2x + 4), and x² - 2x + 4 does not factor over the real numbers. Some advanced classes may factor further using complex numbers, but that is not normally expected in a standard factoring problem.
-
The pattern works because multiplying the two factors makes the middle cube-related terms cancel. For the sum pattern, (A + B)(A² - AB + B²) expands to A³ - A²B + AB² + A²B - AB² + B³. The -A²B and +A²B cancel, and the +AB² and -AB² cancel, leaving A³ + B³.