Difference of Squares

Instantly factor binomials that are differences of perfect squares by recognizing the pattern and splitting into a product of a sum and difference.

a2b2=(a+b)(ab)a^2 - b^2 = (a + b)(a - b)

Solve a problem with Difference of Squares

Type the problem. The solver will use Difference of Squares where Difference of Squares is the right tool, and tell you when it is not.

Drag one in or paste from the clipboard. JPEG, PNG or WebP. You get the transcription to check before anything is solved.

How to get a better answer
  • Paste the whole problem, including the instruction word — "simplify", "solve for x" and "factor" lead to three different answers.
  • Say what you have already tried. "I got x = 4 and the book says 2" turns a solution into a diagnosis.
  • Set the level in the settings button. A calculus shortcut is not a better answer if you have not met derivatives yet.
  • For a photo, get the whole problem in frame and hold the page flat — you get the transcription to fix before anything is solved.

What each symbol means

What Difference of Squares takes
aa
bb
Difference of Squares
SymbolMeaning
aaaa is the base of the first perfect square in the pattern; it represents any real number, expression, or variable, and changing its sign changes the factors.
bbbb is the base of the second perfect square; it can be any real number, expression, or variable, and the formula fails if you misidentify what is being squared.

When to use it

You reach for Difference of Squares when you see a binomial where both terms are perfect squares connected by a minus sign.

Level

Usually taught in: Algebra I · Appears on: SAT

Worked examples

1. Factor a simple difference of perfect squares

Problem

Factor x29x^2 - 9.
  1. x29=x232x^2 - 9 = x^2 - 3^2

    Rewrite 99 as 323^2 so the pattern a2b2a^2 - b^2 becomes clear, with a=xa = x and b=3b = 3.

  2. x232=(x+3)(x3)x^2 - 3^2 = (x + 3)(x - 3)

    Apply a2b2=(a+b)(ab)a^2 - b^2 = (a + b)(a - b) with a=xa = x and b=3b = 3 to factor the expression.

  3. (x+3)(x3)=x23x+3x9=x29(x + 3)(x - 3) = x^2 - 3x + 3x - 9 = x^2 - 9

    Expand to verify: the middle terms cancel, leaving x29x^2 - 9, confirming our factorization.

Answer: (x+3)(x3)(x + 3)(x - 3)

This is the simplest application of Difference of Squares: both x2x^2 and 99 are obviously perfect squares, so we immediately recognize the pattern and apply the formula.

2. Factor with coefficients and higher exponents

Problem

Factor 4x225y44x^2 - 25y^4.
  1. 4x225y4=(2x)2(5y2)24x^2 - 25y^4 = (2x)^2 - (5y^2)^2

    Rewrite each term as a perfect square: 4x2=(2x)24x^2 = (2x)^2 because (2x)2=4x2(2x)^2 = 4x^2, and 25y4=(5y2)225y^4 = (5y^2)^2 because (5y2)2=25y4(5y^2)^2 = 25y^4.

  2. (2x)2(5y2)2=(2x+5y2)(2x5y2)(2x)^2 - (5y^2)^2 = (2x + 5y^2)(2x - 5y^2)

    Apply a2b2=(a+b)(ab)a^2 - b^2 = (a + b)(a - b) with a=2xa = 2x and b=5y2b = 5y^2.

  3. (2x+5y2)(2x5y2)=4x210xy2+10xy225y4=4x225y4(2x + 5y^2)(2x - 5y^2) = 4x^2 - 10xy^2 + 10xy^2 - 25y^4 = 4x^2 - 25y^4

    Expand to confirm: the middle terms cancel, giving us back the original expression.

Answer: (2x+5y2)(2x5y2)(2x + 5y^2)(2x - 5y^2)

This example requires recognizing that 4x24x^2 and 25y425y^4 are perfect squares even though they have coefficients and exponents; the method still works once you identify a=2xa = 2x and b=5y2b = 5y^2.

3. Find remaining area at a bake sale

Problem

At a bake sale, a volunteer sets up a large square table with side length dd feet to display cookies. A smaller square donation box with side length 11 foot is placed at the center. Factor the expression for the available display area.
  1. d21d^2 - 1

    The table has area d2d^2 square feet, and the donation box occupies 11 square foot.

  2. d212d^2 - 1^2

    We write 1=121 = 1^2 to see that both terms are perfect squares.

  3. d212=(d+1)(d1)d^2 - 1^2 = (d + 1)(d - 1)

    Apply the Difference of Squares formula with a=da = d and b=1b = 1 to factor completely.

Answer: (d+1)(d1) square feet(d + 1)(d - 1) \text{ square feet}

This real-world example shows how Difference of Squares gives us a factored form that makes it easier to understand or calculate the remaining space based on the table's dimensions.

Common mistakes

Where Difference of Squares usually goes wrong
Answer came out wrong
Writing a2b2=(ab)(ba)a^2 - b^2 = (a - b)(b - a) or a2b2=(ab)2a^2 - b^2 = (a - b)^2
Remember that a2b2=(a+b)(ab)a^2 - b^2 = (a + b)(a - b): one factor always adds the bases, one subtracts. Using (ab)2(a - b)^2 gives a22ab+b2a^2 - 2ab + b^2, which includes a middle term not in a2b2a^2 - b^2.
Trying to apply the formula to a2+b2a^2 + b^2 instead of a2b2a^2 - b^2
Check your operation first. For x2+25x^2 + 25, Difference of Squares does not apply—look for a different method instead, such as recognizing that sum of squares has no real factorization.
Forgetting to rewrite terms with coefficients as perfect squares, such as treating 4x294x^2 - 9 directly as (4x+3)(4x3)(4x + 3)(4x - 3)
Always rewrite coefficient-heavy terms first: 4x2=(2x)24x^2 = (2x)^2 and 9=329 = 3^2, so 4x29=(2x)232=(2x+3)(2x3)4x^2 - 9 = (2x)^2 - 3^2 = (2x + 3)(2x - 3).
The mistakeWhy it is wrongThe fix
Writing a2b2=(ab)(ba)a^2 - b^2 = (a - b)(b - a) or a2b2=(ab)2a^2 - b^2 = (a - b)^2Both are wrong. The first expression gives the negative of what we want, and the second is the formula for a perfect square trinomial—it expands with a middle term and does not equal the original difference.Remember that a2b2=(a+b)(ab)a^2 - b^2 = (a + b)(a - b): one factor always adds the bases, one subtracts. Using (ab)2(a - b)^2 gives a22ab+b2a^2 - 2ab + b^2, which includes a middle term not in a2b2a^2 - b^2.
Trying to apply the formula to a2+b2a^2 + b^2 instead of a2b2a^2 - b^2Difference of Squares only works when the operation is subtraction, not addition; the sum of two squares does not factor using this pattern over the real numbers.Check your operation first. For x2+25x^2 + 25, Difference of Squares does not apply—look for a different method instead, such as recognizing that sum of squares has no real factorization.
Forgetting to rewrite terms with coefficients as perfect squares, such as treating 4x294x^2 - 9 directly as (4x+3)(4x3)(4x + 3)(4x - 3)This gives the wrong factors because you did not first identify the bases correctly; expanding (4x+3)(4x3)(4x + 3)(4x - 3) does not give 4x294x^2 - 9.Always rewrite coefficient-heavy terms first: 4x2=(2x)24x^2 = (2x)^2 and 9=329 = 3^2, so 4x29=(2x)232=(2x+3)(2x3)4x^2 - 9 = (2x)^2 - 3^2 = (2x + 3)(2x - 3).

Tips and when to use something else

  • Always check that you have a minus sign, not a plus, between the two terms—Difference of Squares only works for subtraction.
  • If the terms have coefficients or exponents, rewrite them as perfect squares first: 9x425y2=(3x2)2(5y)29x^4 - 25y^2 = (3x^2)^2 - (5y)^2 before applying the formula.
  • When neither term is obviously a perfect square, do not force it—look for a different factoring method like Factoring Trinomials or grouping instead.
  • Sum of squares — like a2+b2a^2 + b^2 — does not factor over the reals, so Difference of Squares will not help; use a different technique for problems with a plus sign.

Frequently asked questions

How do I know when to use Difference of Squares instead of other factoring methods?
Difference of Squares is your tool when you can see a binomial where both terms are perfect squares and they are being subtracted. If you do not see that pattern clearly, or if there are three or more terms, reach for Factoring Trinomials or grouping instead. The key is recognizing both terms as perfect squares with a minus sign between them.
Why do we call it 'Difference of Squares' and not just 'factoring binomials'?
The name comes from what the expression is: a difference (subtraction) of two perfect squares. The word Difference tells you the operation is subtraction, and Squares tells you both terms are perfect squares. This specific pattern has a special factoring rule, unlike other binomials.
Does Difference of Squares work if I have a4b4a^4 - b^4?
Yes, if you recognize that a4=(a2)2a^4 = (a^2)^2 and b4=(b2)2b^4 = (b^2)^2, you can factor in stages: first a4b4=(a2+b2)(a2b2)a^4 - b^4 = (a^2 + b^2)(a^2 - b^2), then apply the pattern again to get (a2+b2)(a+b)(ab)(a^2 + b^2)(a + b)(a - b). This works because both a4a^4 and b4b^4 are still perfect squares.
What is the difference between Difference of Squares and Sum of Squares?
Difference of Squares (a2b2a^2 - b^2) factors neatly into (a+b)(ab)(a + b)(a - b) using a simple formula. Sum of Squares (a2+b2a^2 + b^2) does not factor using real numbers—it is a dead end without complex numbers. The minus sign is what makes the formula work, so always check your operation first.

Need a different method?

The full solver is not scoped to one formula — type any problem and it will pick the method.

Open the math solver

Reviewed 2026-09-18