# Factoring the Difference of Two Cubes (*a*^{3} - *b*^{3})

How to solve factoring the difference of two cubes problems: formula, examples, and their solutions.

## Formula

*a*^{3} - *b*^{3} = (*a* - *b*)(*a*^{2} + *ab* + *b*^{2})

See the blue colored signs.

If the sign of *b*^{3} term in (*a*^{3} - *b*^{3}) is (-),

then the sign of *b* term in (*a* - *b*) is (-)

and the sign of *ab* term in (*a*^{2} + *ab* + *b*^{2}) is (+).

## Proof

Solve (*a* + *b*)(*a*^{2} - *ab* + *b*^{2}).

Multiplying polynomials

Then *a*^{2}*b* terms and *ab*^{2} terms are cancelled.

So (*a* - *b*)(*a*^{2} + *ab* + *b*^{2}) = *a*^{3} - *b*^{3}.

Switch both sides.

Then *a*^{3} - *b*^{3} = (*a* - *b*)(*a*^{2} + *ab* + *b*^{2}).

## Example 1

*x*^{3} - 125 = *x*^{3} - 5^{3}

= (*x* - 5)(*x*^{2} + *x*⋅5 + 5^{2})

## Example 2

8*a*^{3} - 27 = (2*a*)^{3} - 3^{3}

= (2*a* - 3)((2*a*)^{2} + 2*a*⋅3 + 3^{2})

## Example 3

First change it as two squares and factor it.*p*^{6} - 1 = (*p*^{3})^{2} - 1^{2}

= (*p*^{3} + 1)(*p*^{3} - 1)

Factoring the diffeerence of squares

Factor the sum and difference of two cubes.*p*^{3} + 1^{3} = (*p* + 1)(*p*^{2} - *p*⋅1 + 1^{2})

Factoring the sum of two cubes*p*^{3} - 1^{3} = (*p* - 1)(*p*^{2} + *p*⋅1 + 1^{2})

When factoring 6th powers,

first change it as two squares and factor it,

then factor the sum of two cubes.

If you change this order,

it'll be quite tough to solve it.

(See the next image.)

## Example 4

This solution is to show you

how complex it is

if you don't follow the order:

'square → cube'

First change it as two cubes and factor it.*p*^{6} - 1 = (*p*^{2})^{3} - 1^{3}

= (*p*^{2} - 1)((*p*^{2})^{2} + *p*^{2}⋅1 + 1^{2})

To factor ((*p*^{2})^{2} + *p*^{2}⋅1 + 1^{2}),

complete the square.

Change +*p*^{2} to +2*p*^{2}

and write -*p*^{2} to undo the change.

Completing the square

Factor the differences of two squares.*p*^{2} - 1 = (*p* + 1)(*p* - 1)

(*p*^{2} + 1)^{2} - *p*^{2} = (*p*^{2} + 1 + *p*)(*p*^{2} + 1 - *p*)

Factoring the diffeerence of squares