Rewrite as .

Since both terms are perfect cubes, factor using the sum of cubes formula, where and .

Rewrite as .

Expand using the FOIL Method.

Apply the distributive property.

Apply the distributive property.

Apply the distributive property.

Simplify and combine like terms.

Simplify each term.

Multiply by .

Rewrite using the commutative property of multiplication.

Rewrite using the commutative property of multiplication.

Multiply by by adding the exponents.

Move .

Multiply by .

Multiply by .

Multiply by .

Subtract from .

Move .

Subtract from .

Apply the distributive property.

Multiply .

Multiply by .

Multiply by .

Apply the distributive property.

Multiply by .

Move to the left of .

Raise to the power of .

Factor (a-b)^3+27