Connect via MCP →

Enter Calculation

Formula

Advertisement

Results

Numeric value of the expression
35
Factored as (a ± b)(a² ∓ ab + b²)
Linear factor (a ± b) 5
Trinomial factor (a² ∓ ab + b²) 7
8
27
4
ab 6
9

What is the Sum and Difference of Cubes?

Two of the most useful algebraic identities are the sum of cubes and the difference of cubes. They let you rewrite an expression of the form \(a^{3} \pm b^{3}\) as a product of a simple linear factor and a quadratic trinomial. This calculator factors any pair of values a and b for either operation and shows every intermediate piece so you can check your own work.

The Formulas

The two identities are:

Sum of cubes:

$$a^{3} + b^{3} = \left(a + b\right)\left(a^{2} - a\,b + b^{2}\right)$$

Difference of cubes:

$$a^{3} - b^{3} = \left(a - b\right)\left(a^{2} + a\,b + b^{2}\right)$$

A handy memory aid is "SOAP": the signs of the factored form are Same, Opposite, Always Positive. The first sign matches the original, the middle sign is opposite, and the last term is always positive.

Flat diagram showing sum and difference of cubes factored into a binomial and a trinomial
Both cube identities factor into a binomial times a trinomial.

How to Use This Calculator

Enter your first term a and second term b, choose whether you are factoring a sum or a difference, and the calculator returns the linear factor \(\left(a \pm b\right)\), the trinomial factor \(\left(a^{2} \mp a\,b + b^{2}\right)\), and the numeric value of the whole expression. The breakdown table lists \(a^{3}\), \(b^{3}\), \(a^{2}\), \(a\,b\), and \(b^{2}\) individually.

Advertisement

Worked Example

Factor \(8 + 27\) as a sum of cubes. Here \(a = 2\) (since \(2^{3} = 8\)) and \(b = 3\) (since \(3^{3} = 27\)). Then

$$a^{3} + b^{3} = \left(2 + 3\right)\left(2^{2} - 2\cdot 3 + 3^{2}\right) = \left(5\right)\left(4 - 6 + 9\right) = 5 \times 7 = 35,$$

which equals \(8 + 27 = 35\). The linear factor is \(5\) and the trinomial factor is \(7\).

FAQ

Can the trinomial be factored further? Usually no — the quadratic \(a^{2} \mp a\,b + b^{2}\) is prime over the integers in most cases.

What if a or b is a variable? The identity still holds symbolically; this tool evaluates numeric values so you can verify factorizations.

Does it work with negatives or decimals? Yes. Any real numbers for a and b are accepted.

Last updated: