Algebra • Polynomial Factoring

Difference of Squares Factorization Calculator

Factor binomial expressions instantly using the algebraic identity a² - b² = (a - b)(a + b) with step-by-step root identification and geometric area proofs.

|
Last Updated: September 2026
|
Verified Accurate: Ring Theory & Commutative Algebra
Interactive Calculator

Difference of Squares Factorizer

Formula identity: a² - b² = (a - b)(a + b)

Geometric Dissection Proof Area: a² - b² = (a+b)(a-b)
Remaining Area (a² - b²)
Excised Corner Square (b²)
Factored Form
(3x - 5)(3x + 5)
Completely Factored Conjugate Pair
Square Roots (a and b)
a = 3x, b = 5
√a² and √b²
Factored GCF
1 (None)
Greatest Common Factor extracted first

Algebraic Step-by-Step Factorization Proof

Direct Answer & Overview
Verified Educational Guide

How to Factor Using the Difference of Squares Formula

To factor a difference of squares binomial a² - b², take the square root of the first term to find a, and the square root of the second term to find b. The factored form is the product of their difference and their sum: (a - b)(a + b). If the terms share a common numerical or variable factor, factor out the Greatest Common Factor (GCF) first before applying the formula.

Primary Mathematical Formula Conjugate Binomial Product Identity
Standard Equation
ƒ(x)
Q.E.D.
a2−b2=(a−b)(a+b)a^2 - b^2 = (a - b)(a + b)
Where a = √a² and b = √b². When multiplied via FOIL, the middle terms (+ab and -ab) cancel out completely.
Exact Formula
Input Parameters
Required
1
First Squared Term a²: Positive real coefficient or even-power variable expression.
2
Second Squared Term b²: Subtracted positive term.
Expected Outputs
Calculated
Factored Conjugate Product: (a - b)(a + b) or c(a - b)(a + b) if a GCF exists.
Base Roots: Identified values of a and b.
FOIL Verification: Expansion proof verifying that (a-b)(a+b) equals a² - b².
Worked Numerical Example
Instant Verification
Factor 9x² - 25
→ Step 1: a = √(9x²) = 3x. Step 2: b = √(25) = 5. Step 3: Apply formula (a - b)(a + b).
9x² - 25 = (3x - 5)(3x + 5)

The Difference of Squares Formula & Algebraic Identity

In elementary and intermediate algebra, the difference of two squares is one of the most fundamental special factoring formulas. It states that whenever an algebraic expression consists of two perfect squares separated by a minus sign, it can be factored into a pair of conjugate binomials:

a² - b² = (a - b)(a + b)

The two factors, (a - b) and (a + b), are called conjugates because they share identical terms separated only by opposite operational signs. Factoring with this identity is an indispensable shortcut in simplifying rational expressions, finding polynomial roots, and evaluating calculus limits. You can explore broader factoring techniques on our polynomial factoring calculator.

Geometric Dissection Proof (Area Equivalence)

Long before modern symbolic algebra was formalized, ancient Greek geometers understood the difference of squares as an elegant visual property of area dissection:

1. Initial Large Square: Consider a square with side length a. Its area is a × a = a².
2. Excising the Small Square: Cut out a smaller square of side length b from one corner. The removed area is b², leaving an L-shaped region with area a² - b².
3. Slicing into Rectangles: Cut the remaining L-shape into two rectangles: one of dimensions (a - b) × a, and another of dimensions b × (a - b).
4. Rearranging into One Rectangle: Place the two pieces end-to-end. They form a single uniform rectangle of width (a + b) and height (a - b).
Conclusion: Total Area = Height × Width ⇒ a² - b² = (a - b)(a + b).

Why the Middle Term Cancels (FOIL Proof)

To prove the identity algebraically, expand the right-hand side using the standard distributive law (FOIL method):

(a - b)(a + b) = a(a + b) - b(a + b)
       = a² + ab - ba - b²
By the commutative law of multiplication, ba = ab:
       = a² + (ab - ab) - b²
       = a² + 0 - b² = a² - b²   ✓ (Q.E.D.)

The outer product (+ab) and inner product (-ab) are exact additive opposites. Their cancellation is the specific mathematical property that eliminates the linear middle term in the expansion.

Advanced Factoring: GCF, Multivariable, and Repeated Powers

Many expressions encountered in high school and college algebra do not appear in the basic x² - 9 form. Mastering these three advanced variations is essential:

1. Factoring Out a GCF First

Always inspect terms for common factors before applying special formulas. For example, in 5x² - 45, neither 5 nor 45 is a square. Factoring out 5 reveals the hidden difference of squares:

5x² - 45 = 5(x² - 9) = 5(x - 3)(x + 3)

2. Multivariable Terms

When terms contain multiple variables, each variable exponent must be even. For 36x⁴y² - 49z⁶, take the square root of both coefficients and halve each exponent:

√(36x⁴y²) = 6x²y  and  √(49z⁶) = 7z³ ⇒ (6x²y - 7z³)(6x²y + 7z³)

3. Repeated Factoring (Higher Powers)

Expressions with exponents of 4, 8, or 16 can be factored in stages. For x⁴ - 16:

x⁴ - 16 = (x² - 4)(x² + 4) = (x - 2)(x + 2)(x² + 4)

Notice that (x² + 4) is a sum of squares and remains irreducible over real numbers.

Step-by-Step Factoring Algorithm

1
Check for Greatest Common Factor: Extract any common numerical or variable divisor from both terms.
2
Confirm Two Terms with a Minus Sign: Verify that the expression is a binomial separated by subtraction (First Term - Second Term).
3
Take the Principal Square Root of Each Term: Find a = √(a²) and b = √(b²).
4
Write as Conjugate Factors: Assemble the factors into (a - b)(a + b) (including any GCF in front).

Step-by-Step Graded Worked Examples

Example 1 • Binomial with Integer Squares Basic Tier

Factor completely: 16x² - 81

1. First term: a² = 16x² ⇒ a = √(16x²) = 4x
2. Second term: b² = 81 ⇒ b = √(81) = 9
3. Assemble factors: (a - b)(a + b)
Factored Answer: (4x - 9)(4x + 9)
Example 2 • GCF Extraction Followed by Factoring Intermediate Tier

Factor completely: 12x³ - 27x

1. Identify GCF of 12x³ and 27x: GCF = 3x
2. Factor out 3x: 3x(4x² - 9)
3. Factor binomial: a = √(4x²) = 2x, b = √(9) = 3
Factored Answer: 3x(2x - 3)(2x + 3)
Example 3 • Quartic Multivariable Repeated Factoring Advanced Tier

Factor completely: 81x⁴ - 16y⁴

1. First pass: a = 9x², b = 4y² ⇒ (9x² - 4y²)(9x² + 4y²)
2. Inspect (9x² - 4y²): a = 3x, b = 2y ⇒ (3x - 2y)(3x + 2y)
3. Inspect (9x² + 4y²): Sum of squares, irreducible over reals
Factored Answer: (3x - 2y)(3x + 2y)(9x² + 4y²)

Common Pitfalls and Sign Mistakes

Attempting to Factor Sums of Squares

Writing x² + 25 = (x + 5)(x + 5). Expanding (x + 5)² yields x² + 10x + 25, NOT x² + 25. Over real numbers, a sum of squares cannot be factored.

Halving Coefficients Instead of Taking Square Roots

Mistakenly writing the square root of 16x² as 8x instead of 4x. Remember to take the square root of the number (√16 = 4), while dividing the exponent by 2 (x²/² = x¹).

Stopping Before Complete Factorization

Leaving x⁴ - 81 factored as (x² - 9)(x² + 9). Always check whether any resulting factor can be factored further using difference of squares.

Forgetting the GCF in the Final Answer

Extracting a common factor like 2 from 2x² - 50 to get (x² - 25), but forgetting to include the 2 in the final product: (x - 5)(x + 5) instead of 2(x - 5)(x + 5).

Fact-Checked & Verified • Computational Accuracy Standards
Updated September 2026 • Editorial Policy
Authored By
Sanjay Samanta

Lead Developer & Founder of Basic Math Tools. Specializes in browser-native computational algorithms and applied mathematics.

Reviewed & Verified By
Academic Review Board

Mathematics & curriculum specialists. Audited against standard algebraic and arithmetic principles.

Found an error or have an improvement suggestion? Report a calculation issue

Frequently Asked Questions

What is the difference of squares formula?
The difference of squares formula states that a² - b² = (a - b)(a + b). It allows any binomial consisting of one squared term subtracted from another to be factored into a pair of conjugate binomials.
Why does the middle term cancel out in (a - b)(a + b)?
When expanding (a - b)(a + b) using FOIL: First = a², Outer = +ab, Inner = -ab, and Last = -b². The outer and inner terms (+ab and -ab) are exact additive inverses and sum to zero (+ab - ab = 0), leaving only a² - b².
Can you factor a sum of squares like a² + b² using real numbers?
No. Over the field of real numbers, a sum of squares a² + b² is irreducible (prime). However, in complex analysis, it factors using the imaginary unit i: a² + b² = (a - bi)(a + bi).
What should you do if the terms have a common factor like 3x² - 75?
Always factor out the Greatest Common Factor (GCF) first. For 3x² - 75, factoring out 3 yields 3(x² - 25). Then apply the difference of squares formula to the remaining binomial: 3(x - 5)(x + 5).
Can you factor expressions with higher even powers like x⁴ - 81?
Yes. Higher even powers can be factored repeatedly. x⁴ - 81 = (x² - 9)(x² + 9). The first factor (x² - 9) is itself a difference of squares and factors further into (x - 3)(x + 3), yielding the final answer (x - 3)(x + 3)(x² + 9).
Can non-perfect squares be factored using difference of squares?
Yes. Over real numbers, any positive constant can be expressed as the square of its radical. For instance, x² - 5 = (x - √5)(x + √5). This is heavily used in calculus when finding limits and asymptotes.