A difference of squares is an expression of the form a2 − b2: one perfect square subtracted from another. It always factors as (a + b)(a − b). For example, x2 − 49 = (x + 7)(x − 7). A sum of squares, a2 + b2, does not factor over the real numbers.
In Spanish
diferencia de cuadrados
Also called
difference of two squares, a^2 – b^2, difference of perfect squares
Cut the small square out of the big one and rearrange the leftover: it becomes an (a + b) by (a − b) rectangle.
Formal definition and notation
For any expressions a and b, the identity a2 − b2 = (a + b)(a − b) holds; an expression that matches the left side is called a difference of squares, and the factors a + b and a − b are conjugates. The identity is checked by multiplying: (a + b)(a − b) = a2 − ab + ab − b2 = a2 − b2.
Symbol
Read it as
Meaning
a2 − b2
a squared minus b squared
the pattern to look for: two squares and a minus sign
(a + b)(a − b)
a plus b times a minus b
the factored form; the two factors are conjugates
Key facts
The middle terms cancel when you multiply the conjugates, which is why there is no x term: (x + 5)(x − 5) = x2 − 25.
Perfect squares to recognize: 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, and even powers such as x2, x4, y6.
Sometimes you can factor again: x4 − 16 = (x2 + 4)(x2 − 4), and then x2 − 4 = (x + 2)(x − 2).
It speeds up mental math: 51 × 49 = 502 − 12 = 2499.
Setting a difference of squares equal to 0 gives two opposite solutions: x2 − 36 = 0 means x = 6 or x = −6.
Difference of squares formula
Difference of squares formula
a2 − b2 = (a + b)(a − b)
a
the square root of the first term: for 9x2, a = 3x
b
the square root of the second term: for 25, b = 5
Check three things: exactly two terms, both perfect squares, and a minus sign between them. Factor out a common factor first if there is one.
Difference of Squares examples, step by step
Example 1: Basic pattern
Warm-up
Factor x2 − 81.
Both terms are squares: x2 = (x)2 and 81 = 92, with a minus sign between them.
The factors must have opposite signs so the middle terms cancel. A squared binomial keeps a middle term.
✗ Mistakex2 + 25 = (x + 5)(x − 5).
✓ Instead(x + 5)(x − 5) = x2 − 25. x2 + 25 is a sum of squares and does not factor over the reals.
The pattern needs subtraction. Multiplying back always catches this error.
✗ Mistakex2 − 10 = (x + 5)(x − 5).
✓ Instead10 is not a perfect square; (x + 5)(x − 5) = x2 − 25.
Take square roots, not halves. Over the reals, x2 − 10 = (x + √10)(x − √10), but it has no integer factoring.
Not to be confused with
Difference of Squaresvs.Perfect square trinomial
A perfect square trinomial has three terms, x2 + 10x + 25 = (x + 5)2. A difference of squares has two terms and factors into two different binomials.
Difference of Squaresvs.Square of a difference
(a − b)2 = a2 − 2ab + b2 is a square of a difference. a2 − b2 is a difference of squares. They are not equal: with a = 5, b = 3, the first is 4 and the second is 16.
Quick check: 3 questions
Question 1 of 3
Which expression is a difference of squares?
Show answer and explanation
Answer: C.25y2 = (5y)2 and 1 = 12, joined by a minus sign. x2 + 36 is a sum, 12 is not a perfect square, and x3 is not a square.
Question 2 of 3
Factor 49m2 − 64.
Show answer and explanation
Answer: B.a = 7m and b = 8, so (7m + 8)(7m − 8). (7m − 8)2 would add a −112m term, and the last two do not multiply back to 49m2 − 64.
Question 3 of 3
What are the solutions of x2 − 144 = 0?
Show answer and explanation
Answer: D.(x + 12)(x − 12) = 0, so x = −12 or 12. Choice A misses the negative root, B halved 144 instead of taking its square root, and C would be true only for x2 + 144 = 0.
Difference of Squares: frequently asked questions
How do you know if something is a difference of squares?
Check three things: there are exactly two terms, a minus sign between them, and each term is a perfect square (a square number like 49 or a variable to an even power like x2 or y4). If a common factor hides the squares, as in 2x2 − 18, factor it out first: 2(x2 − 9).
Can a sum of squares be factored?
Not over the real numbers. x2 + 9 has no factors with real coefficients, because x2 + 9 = 0 has no real solutions. Over the complex numbers it does factor, as (x + 3i)(x − 3i), which you meet in Algebra 2. In Algebra 1, call a sum of squares prime once any common factor is removed.
Why do the middle terms cancel?
Multiply the conjugates with FOIL: (a + b)(a − b) = a2 − ab + ab − b2. The Outer product −ab and the Inner product +ab are opposites, so they add to 0. Only the First and Last products, a2 and −b2, remain. That is exactly the difference of two squares.
Updated November 2026·Reviewed by the Effortless Math team·Standards: CCSS HSA-SSE.A.2
Cite this entry
Effortless Math Team. “Difference of Squares.” Effortless Math Dictionary. Updated November 2026. https://www.effortlessmath.com/math-dictionary/difference-of-squares/
Flashcard
TermDifference of Squaresa2 − b2
DefinitionTwo perfect squares subtracted; factors as (a + b)(a − b). x2 − 49 = (x + 7)(x − 7). Sums of squares do not factor.
SideA side is one of the straight line segments that form the outline of a polygon. Two sides meet at each corner, or vertex. A triangle has 3 sides and a square has 4, and adding the lengths of all the sides gives the perimeter.Geometry · Kindergarten, Grade 1, Grade 2SquareA square is a quadrilateral with four equal sides and four right angles. It is a special rectangle and a special rhombus at the same time. For a square with side s, the perimeter is 4s, the area is s2, and each diagonal is s√2.Geometry · Kindergarten, Grade 2, Grade 3Perfect SquareA perfect square is a number that equals a whole number times itself, so its square root is a whole number. For example, 49 is a perfect square because 7 × 7 = 49 and √49 = 7. The first perfect squares are 0, 1, 4, 9, 16, 25, 36, 49, 64, 81 and 100.Number System · Grade 6, Grade 7, Grade 8PowerA power is a number written as a base with an exponent, such as 53, or the value that results, 53 = 5 × 5 × 5 = 125. We say 125 is the third power of 5, or “5 to the third power”. The second power is called the square and the third power the cube.Number System · Grade 5, Grade 6, Grade 7Equal ToEqual to means having exactly the same value or amount, and it is written with the symbol =. Numbers that look different can still be equal to each other: 12 is equal to 0.5. When two amounts are not the same, one is greater than or less than the other.Symbols and Notation · Kindergarten, Grade 1, Grade 2Factor CompletelyFactor completely means to write a polynomial as a product of factors that cannot be factored any further. First take out the greatest common factor, then factor what is left: 2x2 − 18 = 2(x2 − 9) = 2(x + 3)(x − 3). Stopping at 2(x2 − 9) is not complete, because x2 − 9 still factors.Algebra · Algebra 1, Algebra 2NumberA number is an amount or value used to count, measure, order and compare. We write numbers with digits (7), words (seven) or other symbols, but the number itself is the amount: 7 dots, the word seven and the numeral 7 all show the same number. Numbers include whole numbers, fractions, decimals and negatives.Number System · Kindergarten, Grade 1, Grade 2BinomialA binomial is a polynomial with exactly two terms, joined by a plus or minus sign. Examples are x + 7, 3m − 4 and a2 − 9. Combine like terms before counting: 3x + 5x is 8x, one term. A polynomial with one term is a monomial; three terms make a trinomial.Algebra · Algebra 1, Algebra 2SubtractionSubtraction is the operation that finds how much is left when you take one amount away from another, or how far apart two numbers are. It is written with a minus sign: 9 − 4 = 5. The answer is called the difference. Subtraction undoes addition, so you can check 9 − 4 = 5 by adding 5 + 4 = 9.Operations · Grade 1, Grade 2, Grade 3Square RootA square root of a number is a value that, multiplied by itself, gives that number. The square root of 36 is 6 because 6 × 6 = 36. Every positive number has two square roots, such as 6 and −6, but the radical sign √ means the principal square root, which is the non-negative one.Number System · Grade 8, Algebra 1FactoringFactoring rewrites a number or expression as a product of factors. It is the reverse of multiplying or distributing: 12 = 3 × 4, 6x + 9 = 3(2x + 3) and x2 + 5x + 6 = (x + 2)(x + 3). Factoring changes the form, not the value, so multiplying the factors back gives the original.Algebra · Grade 6, Grade 7, Grade 8TrinomialA trinomial is a polynomial with exactly three terms, such as x2 + 5x + 6 or 2a − 3b + 7. The terms are joined by addition or subtraction and must be unlike terms, so nothing combines. The most common kind is the quadratic trinomial ax2 + bx + c, which students learn to factor into two binomial factors.Algebra · Algebra 1, Algebra 2Quadratic EquationA quadratic equation is an equation that can be written in the form ax2 + bx + c = 0, where a is not 0. Its graph is a parabola, and it may have zero, one, or two real solutions. You can solve it by factoring, by taking square roots, by completing the square, or with the quadratic formula.Algebra · Algebra 1, Algebra 2Zero of a FunctionA zero of a function is an input that makes the output 0: a number a with f(a) = 0. For f(x) = x − 5, the zero is 5. On a graph, the real zeros are the x-values where the curve meets the x-axis. You find zeros by solving f(x) = 0.Functions · Algebra 1, Algebra 2, PrecalculusComplex NumberA complex number is a number of the form a + bi, where a and b are real numbers and i is the imaginary unit, with i2 = −1. The real part is a and the imaginary part is b. Examples: 3 + 2i and −4i. Complex numbers let you take square roots of negatives, such as √−9 = 3i.Number System · Algebra 2, PrecalculusFOIL MethodThe FOIL method is a memory aid for multiplying two binomials: multiply the First terms, the Outer terms, the Inner terms and the Last terms, then combine like terms. For (x + 2)(x + 5): x2 + 5x + 2x + 10 = x2 + 7x + 10. It is the distributive property applied twice.Algebra · Algebra 1Greatest Common FactorThe greatest common factor (GCF) is the largest factor shared by two or more numbers: the largest number that divides into both without a remainder. The GCF of 18 and 24 is 6. Find it by listing factors or by multiplying the prime factors the numbers share. The GCF is how you simplify fractions in one step.Number System · Grade 5, Grade 6, Grade 7