Difference Of Squares: Formula, Rules & Examples

The difference of squares is a special algebraic pattern that allows an expression containing two perfect squares separated by subtraction to be factored immediately.
The formula is:
a² – b² = (a – b)(a + b)
For example:
x² – 25
can be recognized as:
x² – 5²
Therefore:
x² – 25 = (x – 5)(x + 5)
The pattern works because multiplying the two conjugate factors causes the middle terms to cancel.
Difference of squares is especially useful in polynomial factoring, equation solving, simplifying rational expressions, and recognizing larger expressions that can be factored repeatedly.
What Is a Difference of Squares?
An expression is a difference of squares when it has the structure:
Perfect Square – Perfect Square
Examples include:
x² – 16
9x² – 25
a⁴ – b⁴
49m² – n²
The word difference indicates subtraction.
The word squares means both terms can be written as squares.
For:
9x² – 25
we have:
9x² = (3x)²
and:
25 = 5²
Therefore:
9x² – 25 = (3x – 5)(3x + 5)
This special pattern is part of the broader factoring framework in algebra.
Difference of Squares Formula
The core formula is:
a² – b² = (a – b)(a + b)
It can also be read backward:
(a – b)(a + b) = a² – b²
This second interpretation is useful when multiplying conjugate binomials.
The formula applies whenever both terms are perfect squares and they are separated by subtraction.
Why the Difference of Squares Formula Works
Expand:
(a – b)(a + b)
Distribute:
a(a + b) – b(a + b)
Then:
a² + ab – ab – b²
The middle terms cancel:
+ab – ab = 0
leaving:
a² – b²
This cancellation explains why no middle term appears in the final expression.
The same result can be verified through ordinary polynomial multiplication or the principles behind the binomial theorem.
Basic Difference of Squares Example
Factor:
x² – 36
Recognize:
36 = 6²
So:
x² – 36 = x² – 6²
Apply the formula:
x² – 36 = (x – 6)(x + 6)
That is the complete factorization over the real numbers.
Example: 4x² – 49
Factor:
4x² – 49
Write each term as a square:
4x² = (2x)²
49 = 7²
Therefore:
4x² – 49 = (2x – 7)(2x + 7)
Example: 25a² – 9b²
Recognize:
25a² = (5a)²
and:
9b² = (3b)²
Then:
25a² – 9b² = (5a – 3b)(5a + 3b)
The same pattern works when both square terms contain variables.
How to Recognize a Difference of Squares
Check three conditions.
First, there must be exactly two main terms after any common factors have been removed.
Second, the operation between those terms must be subtraction.
Third, both terms must be perfect squares.
For example:
16x⁴ – 81y²
has:
16x⁴ = (4x²)²
and:
81y² = (9y)²
Therefore:
16x⁴ – 81y² = (4x² – 9y)(4x² + 9y)
Factor Out a Common Factor First
Sometimes the difference-of-squares structure is hidden.
Consider:
3x² – 75
Both terms share a factor of 3:
3(x² – 25)
Now recognize:
x² – 25 = (x – 5)(x + 5)
Therefore:
3x² – 75 = 3(x – 5)(x + 5)
Factoring out the greatest common factor first often reveals a special identity.
Example With a Larger Common Factor
Factor:
8x² – 200
Greatest common factor:
8
So:
8(x² – 25)
Then:
x² – 25 = (x – 5)(x + 5)
Final factorization:
8(x – 5)(x + 5)
Skipping the common factor would leave the expression incompletely factored.
Repeated Difference of Squares
Some expressions can use the formula more than once.
Consider:
x⁴ – 16
First:
x⁴ – 16 = (x²)² – 4²
Therefore:
x⁴ – 16 = (x² – 4)(x² + 4)
The first factor is itself a difference of squares:
x² – 4 = (x – 2)(x + 2)
So over the real numbers:
x⁴ – 16 = (x – 2)(x + 2)(x² + 4)
The factor:
x² + 4
is a sum of squares and does not factor into real linear factors.
Difference of Fourth Powers
The identity:
a⁴ – b⁴
can be factored as:
(a² – b²)(a² + b²)
Then factor the first part again:
a² – b² = (a – b)(a + b)
Therefore:
a⁴ – b⁴ = (a – b)(a + b)(a² + b²)
This is an example of repeated application rather than a separate unrelated formula.
Example: x⁴ – 81
Factor:
x⁴ – 81
Recognize:
x⁴ = (x²)²
81 = 9²
So:
x⁴ – 81 = (x² – 9)(x² + 9)
Continue:
x² – 9 = (x – 3)(x + 3)
Therefore:
x⁴ – 81 = (x – 3)(x + 3)(x² + 9)
over the real numbers.
Difference of Squares vs. Sum of Squares
The identity works for:
a² – b²
It does not give a real factorization for:
a² + b²
For example:
x² + 25
cannot be factored as:
(x – 5)(x + 5)
because that product equals:
x² – 25
not:
x² + 25
Over the complex numbers, however:
a² + b² = (a – bi)(a + bi)
because:
i² = -1
This distinction becomes important when moving from real to complex factorization.
Difference of Squares vs. Perfect Square Trinomial
A difference of squares has two terms:
a² – b²
A perfect square trinomial has three:
a² + 2ab + b² = (a + b)²
or:
a² – 2ab + b² = (a – b)²
For example:
x² – 10x + 25
is not a difference of squares.
It is:
(x – 5)²
Recognizing the correct special pattern prevents incorrect factorization.
Solving an Equation With Difference of Squares
Solve:
x² – 49 = 0
Factor:
(x – 7)(x + 7) = 0
Apply the zero-product property:
x – 7 = 0
or:
x + 7 = 0
Therefore:
x = 7 or x = -7
Difference-of-squares factoring can make many quadratic equations almost immediate.
Zero-Product Property
The zero-product property states:
If AB = 0, then A = 0 or B = 0
That is why:
(x – 7)(x + 7) = 0
produces:
x = 7
or:
x = -7
Factoring changes the form of the equation so this property can be used.
Example: 9x² – 16 = 0
Factor:
(3x – 4)(3x + 4) = 0
Then:
3x – 4 = 0
gives:
x = 4/3
and:
3x + 4 = 0
gives:
x = -4/3
Solutions:
x = ±4/3
Difference of Squares and Quadratic Factoring
The pattern is a special case of factoring quadratics.
A quadratic:
x² – 25
has:
a = 1
b = 0
c = -25
Instead of using a general factoring procedure, recognizing the square structure immediately gives:
(x – 5)(x + 5)
Pattern recognition often makes the calculation much faster.
Difference of Squares and the Quadratic Formula
The same equation can also be solved with the quadratic formula.
For:
x² – 25 = 0
we have:
a = 1
b = 0
c = -25
Then:
x = [-0 ± √(0² – 4(1)(-25))] / 2
x = ±√100 / 2
x = ±10/2
x = ±5
The result is correct, but difference-of-squares factoring is much shorter.
Difference of Squares and the Discriminant
For:
x² – a² = 0
the quadratic coefficients are:
A = 1
B = 0
C = -a²
The discriminant is:
D = B² – 4AC
Therefore:
D = 0 – 4(1)(-a²)
D = 4a²
For nonzero real a:
D > 0
so the equation has two distinct real roots:
x = ±a
This agrees exactly with the difference-of-squares factorization.
Difference of Squares in a Cubic Equation
A cubic equation can contain a difference of squares after a common factor is removed.
Consider:
x³ – 9x = 0
Factor out:
x
giving:
x(x² – 9) = 0
Then:
x(x – 3)(x + 3) = 0
Roots:
x = 0, 3, -3
The cubic itself is not a difference of squares, but the identity completes its factorization.
Difference of Squares in Rational Expressions
Consider:
(x² – 25) / (x – 5)
Factor the numerator:
[(x – 5)(x + 5)] / (x – 5)
For:
x ≠ 5
cancel the common factor:
x + 5
The restriction:
x ≠ 5
must remain because the original denominator was zero at 5.
This same domain discipline is essential throughout rational expressions.
Do Not Cancel Terms Across Subtraction
Consider:
(x² – 25) / (x – 5)
You cannot cancel the x or the 5 directly.
Cancellation applies to factors, not terms separated by addition or subtraction.
First factor:
x² – 25 = (x – 5)(x + 5)
Then the factor:
x – 5
can be canceled.
This is one of the most important practical reasons to recognize difference-of-squares patterns.
Difference of Squares and Polynomial Equations
A polynomial equation may contain a high-degree difference of squares.
For example:
x⁶ – 64 = 0
Recognize:
x⁶ = (x³)²
and:
64 = 8²
Therefore:
(x³ – 8)(x³ + 8) = 0
Each cubic factor can then be factored using cube identities.
One special pattern can therefore expose additional algebraic structure.
Difference of Squares and Polynomial Long Division
If a factor such as:
x – a
is already known, polynomial long division can divide the polynomial by that factor.
For a straightforward difference of squares, however:
x² – a² = (x – a)(x + a)
direct factorization is usually far more efficient than performing long division.
The two techniques solve different forms of the same broader factorization problem.
Conjugate Factors
The factors:
a – b
and:
a + b
are called conjugates in this algebraic context.
Their product contains no middle term:
(a – b)(a + b) = a² – b²
This conjugate structure also appears in complex-number division.
For example:
(a + bi)(a – bi) = a² + b²
because:
i² = -1
The cancellation mechanism is closely related even though the resulting sign differs.
Difference of Squares Over Complex Numbers
A real sum of squares such as:
x² + 9
does not factor into real linear factors.
But:
x² + 9 = x² – (3i)²
because:
(3i)² = -9
Therefore:
x² + 9 = (x – 3i)(x + 3i)
These factors produce the complex roots:
x = 3i
and:
x = -3i
Difference of Squares and Complex Powers
In more advanced complex-number work, powers and roots can be represented geometrically using De Moivre’s theorem.
The basic difference-of-squares identity does not require De Moivre’s theorem, but both rely on recognizing algebraic structure rather than expanding expressions blindly.
For ordinary real polynomial factoring, the simple identity:
a² – b² = (a – b)(a + b)
is all that is required.
Difference of Squares With Fractions
Factor:
x² – 1/4
Recognize:
1/4 = (1/2)²
Therefore:
x² – 1/4 = (x – 1/2)(x + 1/2)
The identity works with fractional squares just as it does with integers.
Difference of Squares With Decimals
Consider:
x² – 0.49
Since:
0.49 = 0.7²
we get:
x² – 0.49 = (x – 0.7)(x + 0.7)
The important question is whether the terms are squares, not whether they are whole numbers.
Difference of Squares With Exponents
Consider:
x¹⁰ – y⁶
Both terms are squares:
x¹⁰ = (x⁵)²
y⁶ = (y³)²
Therefore:
x¹⁰ – y⁶ = (x⁵ – y³)(x⁵ + y³)
Whether the factors can be simplified further depends on their own algebraic structure.
Difference of Squares With Coefficients
Factor:
100x⁶ – 121y⁴
Recognize:
100x⁶ = (10x³)²
121y⁴ = (11y²)²
Therefore:
100x⁶ – 121y⁴ = (10x³ – 11y²)(10x³ + 11y²)
The same identity handles substantial coefficients and powers without changing its structure.
Solving a Difference of Squares Worded as Equal Squares
Suppose:
x² = 64
Move everything to one side:
x² – 64 = 0
Factor:
(x – 8)(x + 8) = 0
Therefore:
x = 8 or x = -8
This is equivalent to using:
x = ±√64
The factoring method makes the connection with polynomial roots explicit.
Difference of Squares and Domain Restrictions
When the identity is used only for polynomial factoring, there are normally no new domain restrictions.
When it is used to simplify fractions, however, restrictions from the original denominator remain.
For example:
(x² – 9)/(x² – x – 6)
Factor:
(x – 3)(x + 3) / [(x – 3)(x + 2)]
Simplify:
(x + 3)/(x + 2)
but the original expression requires:
x ≠ 3
and:
x ≠ -2
The domain and range framework becomes important when the factorization appears inside functions.
Difference of Squares Pattern Check
Before applying the formula, ask:
Can the first term be square-rooted exactly in the current algebraic setting?
Can the second term be square-rooted exactly?
Is the operation subtraction?
If yes:
A² – B² = (A – B)(A + B)
If not, another factoring method may be required.
Common Difference of Squares Mistakes
A common mistake is applying the formula to a sum:
a² + b²
The ordinary real formula does not factor that expression.
Another mistake is taking incorrect square roots of variable powers.
For example:
√x⁶ = x³
within ordinary polynomial factorization notation, while numerical square-root identities involving signs need appropriate domain care.
Students also sometimes forget to factor out a common factor first.
Another error is stopping after the first difference-of-squares step when one factor can be factored again.
When simplifying rational expressions, canceled factors can cause original domain restrictions to be forgotten.
Finally:
(a – b)²
is not the same as:
a² – b²
because:
(a – b)² = a² – 2ab + b²
Frequently Asked Questions
What is the difference of squares formula?
a² – b² = (a – b)(a + b)
What does difference of squares mean?
It means two perfect-square terms are separated by subtraction.
Is x² – 25 a difference of squares?
Yes.
x² – 25 = x² – 5²
so:
x² – 25 = (x – 5)(x + 5)
Is x² + 25 a difference of squares?
No. It is a sum of squares.
It does not factor into real linear factors using the difference-of-squares formula.
How do you factor 9x² – 16?
9x² – 16 = (3x)² – 4²
Therefore:
(3x – 4)(3x + 4)
Why does the formula work?
When:
(a – b)(a + b)
is expanded, the middle terms +ab and -ab cancel.
Can the formula be used more than once?
Yes.
For example:
x⁴ – 16
first becomes:
(x² – 4)(x² + 4)
and then:
(x – 2)(x + 2)(x² + 4)
over the real numbers.
Should a common factor be removed first?
Usually yes.
For:
3x² – 75
first write:
3(x² – 25)
then factor the difference of squares.
Can difference of squares contain fractions?
Yes.
x² – 1/4 = (x – 1/2)(x + 1/2)
Can difference of squares contain variables in both terms?
Yes.
25a² – 9b² = (5a – 3b)(5a + 3b)
How does difference of squares help solve equations?
It converts an equation into factors so the zero-product property can be applied.
What are the roots of x² – a² = 0?
x = a or x = -a
How does it relate to quadratic factoring?
Difference of squares is a special quadratic factoring pattern with no middle term.
Can a sum of squares factor over complex numbers?
Yes.
a² + b² = (a – bi)(a + bi)
Why is difference of squares useful in rational expressions?
Factoring can reveal common factors that may be canceled while preserving the original domain restrictions.
What is the most important rule to remember?
Square – Square = (Difference)(Sum)
or formally:
a² – b² = (a – b)(a + b)
Recognizing that structure quickly can turn a long algebra problem into a one-step factorization.



