Difference of Squares Formula and Examples

Master the difference of squares formula with step-by-step examples, the identity proof, factoring rules, and practice problems for algebra exams.
Difference of Squares Formula and Examples

The difference of squares formula states that a² − b² = (a + b)(a − b). It lets you factor any expression that is one perfect square subtracted from another into two binomials, one with a sum and one with a difference. This difference of squares formula appears constantly in algebra, from simplifying expressions to solving quadratic equations, and recognizing the pattern on sight is one of the fastest ways to cut through a factoring problem.

Key Takeaways

  • The formula is a² − b² = (a + b)(a − b), and it works only when you are subtracting one perfect square from another.
  • A sum of squares (a² + b²) cannot be factored using this identity over the real numbers.
  • The difference of squares identity can be proved in one step by expanding (a + b)(a − b) and watching the middle terms cancel.
  • Always check for a greatest common factor (GCF) before applying the rule, since pulling out the GCF first can reveal a hidden difference of squares underneath.
  • The same pattern extends to expressions with higher powers, such as x⁴ − 16, which factors as (x² + 4)(x² − 4) and then again as (x² + 4)(x + 2)(x − 2).

What Is the Difference of Squares?

The difference of two squares is any algebraic expression where one squared term is subtracted from another, written in the general form a² − b². According to Lamar University’s algebra course on factoring polynomials, recognizing the difference of squares as a special factoring pattern is one of the most useful shortcuts in algebra, since it appears inside more complex problems like solving quadratics, simplifying rational expressions, and reducing polynomial fractions.

The word “difference” here means subtraction, and “squares” means each term is raised to the power of 2. So x² − 9 qualifies (x squared minus 3 squared), but x² + 9 does not, because there is no subtraction.

Read more – See how Think10x.ai explains algebra topics step by step with narrated video walkthroughs.

The Difference of Squares Formula

The difference of squares formula is a² − b² = (a + b)(a − b)

This tells you that any expression in the form “first term squared minus second term squared” can be rewritten as the product of two brackets: one containing the sum of the two terms, and one containing the difference.

Proof of the difference of squares identity

The difference of squares identity is easy to prove by expanding the right side:

(a + b)(a − b) = a(a − b) + b(a − b) = a² − ab + ab − b² = a² − b²

The two middle terms, −ab and +ab, cancel each other out, leaving only a² − b². This cancellation is why the identity works, and it also explains why a sum of squares (a² + b²) has no equivalent factoring over real numbers.

The Difference of Squares Rule: How to Recognize It

The difference of squares rule has three conditions that must all be true before you can apply the formula:

  1. The expression has exactly two terms (it is a binomial).
  2. Both terms are perfect squares, meaning each one is the result of squaring a whole number, variable, or simpler expression.
  3. The two terms are connected by subtraction, not addition.


If all three conditions are met, you can factor directly using a² − b² = (a + b)(a − b). If any one condition fails, the identity does not apply.

Expression Is it a difference of squares? Why / Why not
x² − 25
Yes
x² and 25 are both perfect squares, connected by subtraction
4x² − 9y²
Yes
4x² = (2x)² and 9y² = (3y)², subtracted
x² + 16
No
It uses addition, not subtraction
x² − 7
No (over integers)
7 is not a perfect square integer
x³ − 8
No
x³ is not a square; this is a difference of cubes

How to Use the Difference of Squares

How to use difference of squares in four steps

  1. Check that the expression is a binomial with subtraction.
  2. Confirm both terms are perfect squares by identifying what each one is the square of.
  3. Write two brackets: one with the sum of the square roots, one with the difference.
  4. Check your answer by expanding the brackets back out to confirm it matches the original.

Step-by-step walkthrough: Factor 49x² − 64

  • Is it a binomial with subtraction? Yes.
  • Is 49x² a perfect square? Yes, (7x)² = 49x².
  • Is 64 a perfect square? Yes, 8² = 64.
  • Write the brackets: (7x + 8)(7x − 8).
  • Check: (7x + 8)(7x − 8) = 49x² − 56x + 56x − 64 = 49x² − 64. Correct.

Learn more – Upload any factoring problem to Think10x.ai and get a narrated video explanation showing each step.

How to Solve Difference of Squares Equations

How to solve the difference of squares equations means setting the factored form equal to zero and solving each bracket separately.

Example 1. Solve x² − 36 = 0

  1. Factor -> x² − 36 = (x + 6)(x − 6) = 0.
  2. Set each bracket to zero -> x + 6 = 0 gives x = −6, and x − 6 = 0 gives x = 6.
  3. The solutions are x = 6 and x = −6.


This is one of the most common applications of the difference of squares method in algebra exams, and the factoring step is often the quickest route to the answer compared to using the quadratic formula on the same equation.

Difference of Squares Examples

Here are different examples covering the types that show up most often in homework and exams.

Example 1. Basic factoring

Factor x² − 81.

Both terms are perfect squares: x² = (x)² and 81 = (9)². Using the difference of two squares formula: x² − 81 = (x + 9)(x − 9).

Example 2. Coefficients greater than 1

Factor 25a² − 4b².

25a² = (5a)² and 4b² = (2b)². So 25a² − 4b² = (5a + 2b)(5a − 2b).

Example 3. Factoring out a GCF first

Factor 3x² − 75.

The two terms share a common factor of 3. Pull it out first: 3(x² − 25). Now x² − 25 is a difference of squares: 3(x + 5)(x − 5).

Example 4. Nested difference of squares

Factor x⁴ − 16.

x⁴ = (x²)² and 16 = (4)², so x⁴ − 16 = (x² + 4)(x² − 4). But x² − 4 is itself a difference of squares: x² − 4 = (x + 2)(x − 2). The fully factored form is (x² + 4)(x + 2)(x − 2).

Example 5. Mental math shortcut

Calculate 47 × 53 without a calculator.

Notice that 47 = 50 − 3 and 53 = 50 + 3. So 47 × 53 = (50 − 3)(50 + 3) = 50² − 3² = 2500 − 9 = 2491. This mental math trick, using the difference of squares method in reverse, works whenever two numbers are the same distance above and below a round number, and it is one of the clearest demonstrations of how to use the difference of squares outside a textbook.

Read more – See how Think10x.ai’s solver handles algebra problems compared to ChatGPT.

Difference of Squares Problems

Try these difference of squares problems and check your solutions below.

Problem 1. Factor 16x² − 49. Solution: (4x)² − (7)² = (4x + 7)(4x − 7).

Problem 2. Solve 9x² − 1 = 0. Solution: (3x + 1)(3x − 1) = 0, so x = 1/3 or x = −1/3.

Problem 3. Factor 2x³ − 50x completely. Solution: Factor out 2x first: 2x(x² − 25) = 2x(x + 5)(x − 5).

Problem 4. Calculate 102 × 98 using the difference of squares. Solution: (100 + 2)(100 − 2) = 100² − 2² = 10000 − 4 = 9996.

If any step feels unclear, a narrated video walkthrough of a similar problem can show the full reasoning instead of just a static answer key.

Checklist before you submit an answer

  • Did you check for a GCF before applying the formula?
  • Are both terms actually perfect squares?
  • Is the operation subtraction, not addition?
  • Did you expand your answer back out to verify it matches the original expression?

Learn more – Explore step-by-step walkthroughs for algebra and beyond on Think10x.ai.

How Think10x.ai Helps With Factoring

Factoring problems like the difference of squares follow a clear pattern, but the pattern only helps if you can spot it in the first place, especially when a GCF needs to come out first or when nested squares hide inside an expression like x⁴ − 16. Think10x.ai turns any factoring question, typed, spoken, or photographed from a worksheet, into a narrated video that walks through identification, factoring, and verification one step at a time.

Students can pause mid-explanation and ask a follow-up, such as why 7 is not a perfect square or why (x² + 4) cannot be factored further, and the platform picks up from that exact point. Try it with your next algebra problem and see the full walkthrough in under two minutes.

Frequently Asked Questions

Can a sum of squares be factored the same way?

No. The identity a² + b² does not factor into real-number binomials, because expanding (a + b)(a + b) gives a² + 2ab + b², not a² + b². The middle term does not cancel the way it does with subtraction.

What if the expression has three terms instead of two?

Then it is a trinomial, not a binomial, and the difference of squares formula does not apply directly. You would need to check whether it fits a different factoring pattern, such as a perfect square trinomial or a general quadratic.

Does the order of the brackets matter?

No. (a + b)(a − b) and (a − b)(a + b) give the same result, since multiplication is commutative. The final factored answer is the same either way.

How do I know when to use the difference of squares versus the quadratic formula?

If the expression is a binomial with two perfect squares separated by subtraction, the difference of squares is faster. If the expression is a full quadratic (three terms) or does not factor neatly, the quadratic formula is the more general tool.

TABLE OF CONTENTS