Algebra
Basic

Difference of Squares

Factors the difference of two perfect squares.

Formula

a2−b2=(a+b)(a−b)a^2 - b^2 = (a+b)(a-b)

Live Calculator

Members

Variables

a, bAny real numbers

Example

25 - 9 = (5+3)(5-3) = 16

How it works

This identity rewrites the difference between two squared quantities as a product of their sum and difference. It works because multiplying (a+b)(a-b) gives a^2 - ab + ab - b^2, and the middle terms cancel. That cancellation is why any pair of perfect squares with subtraction can be factored this way.

When to use it

Use this when you see one square being subtracted from another, especially in algebraic factoring problems. It is also useful for simplifying expressions, solving equations, and mental arithmetic with numbers near each other.

Worked example, step by step

Start with: 64 - 49 Recognize the squares: 64 = 8^2 and 49 = 7^2 Apply the formula: 8^2 - 7^2 = (8+7)(8-7) Simplify the factors: (15)(1) Final answer: 15

Common mistakes to avoid

  • adding the squares instead of subtracting them
  • forgetting that both terms must be perfect squares before using the pattern
  • writing (a-b)(a-b) instead of (a+b)(a-b)

Did You Know?

This identity is a favorite mental-math shortcut: 47×53 = 50² − 3² = 2500 − 9 = 2491.

Share this formula

Reviewed & maintained by the FormulaWon editorial teamLast reviewed September 2026