Mathematics · Formula

Difference of squares

Factors any expression that is one perfect square subtracted from another.

Mathematics librarySymbols definedWorked example
Formula
a2 − b2 = (a − b)(a + b)

Factors any expression that is one perfect square subtracted from another.

What the symbols mean

  • a, b — any expressions

What it means

Recognising a difference of squares is the fastest way to factor many quadratics and to rationalise denominators containing square roots.

Worked example

Example

x² − 9 factors as (x − 3)(x + 3), so the equation x² = 9 has solutions x = 3 and x = −3.

Related formulas

These relationships often appear alongside the difference of squares in the same problems.

Frequently asked questions

What is the difference of squares formula?

The relationship is a2 − b2 = (a − b)(a + b). Factors any expression that is one perfect square subtracted from another.

When should I use the difference of squares formula?

Recognising a difference of squares is the fastest way to factor many quadratics and to rationalise denominators containing square roots.

How do I avoid unit mistakes?

Write each quantity with its unit before substituting, convert to the units the formula expects, and check that the result's unit matches the quantity you are solving for. Angles must be in radians for calculus-based expressions unless the page says degrees.

Sources and standards

The equation form, symbols and expected units on this page are checked against the reference works below.

How these are used: sources and standards.

Reviewed November 2026 · Educational reference. See the disclaimer and methodology.