How to factor the difference of two squares

If both terms in a subtraction are squares, there’s a short way to factor the expression. Let’s write each term as a square first, then see where the two factors come from.

Write the two terms as squares

When we can write the expression as A2-B2, one factor uses the sum of A and B and the other uses their difference. If we multiply the factors, the two middle terms cancel.

A2-B2=(A+B)(A-B)(A+B)(A-B)=A2-AB+AB-B2

Factor when the squared term has a coefficient

For 9x2-16, write 9x2 as (3x)2 and 16 as 42. Now we can use A=3x and B=4.

9x2-16=(3x)2-42=(3x+4)(3x-4)

To check, multiply the factors. The terms -12x and 12x cancel, leaving 9x2-16.

Factor a binomial with one variable

For x2-25, the two squared expressions are x and 5. Use the same two expressions in both factors.

x2-25=(x+5)(x-5)

Factor a difference of squares with several variables

In 64x4y2-9z6, squaring 8x2y gives the first term, and squaring 3z3 gives the second. Put those entire expressions into the sum and the difference.

64x4y2-9z6=(8x2y)2-(3z3)2=(8x2y+3z3)(8x2y-3z3)