➕ Algebra 1 · Factoring
Difference of Squares
Factor a difference of squares into (a + b)(a − b), spot perfect squares, take out the GCF first, and see why a sum like x² + 9 does not factor.
By the end you can…
- Recognize a difference of squares: a binomial with one perfect square subtracted from another, including terms like 9y2 and x6.
- Factor it with a2 − b2 = (a + b)(a − b), and check the answer by expanding.
- Take out a greatest common factor first, and keep factoring until the expression is completely factored, as in x4 − 16.
- Explain why a sum of squares such as x2 + 9 does not factor, and use the pattern for mental math such as 51 × 49.
Lesson (school style)
A difference of squares is a binomial in which one perfect square is subtracted from another, like x2 − 9. It factors in one step: a2 − b2 = (a + b)(a − b). Factoring is the reverse of multiplying, so you can always check an answer by multiplying it back out. In this lesson, “factor” means “factor using integers,” and the pattern needs a minus sign between two perfect squares.
The pattern
a2 − b2 = (a + b)(a − b)
The two factors use the same two pieces, a and b. They differ only in the sign between them: one plus and one minus. The order of the factors does not matter, because multiplication can be done in either order.
Try it with numbers. For a = 9 and b = 4: a2 − b2 = 81 − 16 = 65, and (9 + 4)(9 − 4) = 13 × 5 = 65.
The letters a and b can stand for anything you can square: numbers, variables, or terms such as 2x. In x2 − 9 we have a = x and b = 3, so x2 − 9 = (x + 3)(x − 3).
If you met the product of a sum and a difference in Special Products of Binomials, this is that same fact read from right to left.
Why it works: expand and look at the middle
Multiply (a + b)(a − b) one term at a time:
(a + b)(a − b) = a·a − a·b + b·a − b·b = a2 − ab + ab − b2 = a2 − b2
The two middle terms, −ab and +ab, have the same size and opposite signs, so they cancel. They cancel only because the two factors have opposite signs. In (a + b)(a + b) the middle terms are both +ab and add up to 2ab, so (a + b)2 = a2 + 2ab + b2. That is not a difference of squares.
Why it works: a picture
Start with a big square whose sides are a long. Cut a small square with sides b long out of one corner. (In the picture, a is bigger than b.) The L-shaped piece that is left has area a2 − b2.
Cut the L into two rectangles: a bottom strip that is a wide and a − b tall, and a piece above it that is a − b wide and b tall. Turn the second piece on its side and slide it to the end of the strip. Together they make one rectangle that is a + b wide and a − b tall. Its area is (a + b)(a − b).
Nothing was added or thrown away, so the two areas are equal: a2 − b2 = (a + b)(a − b).
The picture needs positive lengths with a > b. The expanding argument above shows the identity is true for all numbers.
Spotting perfect squares
A perfect square is what you get when you square something. With whole-number coefficients, the numbers to know are the squares of 1 through 12: 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121 and 144.
A term is a perfect square when both of these are true:
- its coefficient is a perfect square (a lone variable power such as x6 has coefficient 1, which counts), and
- every variable in it has an even exponent.
To find the thing that was squared, take the square root of the coefficient and halve each exponent. Halving works because squaring doubles an exponent: (x3)2 = x3 · x3 = x6.
- 1 = 12
- 49 = 72
- x6 = (x3)2
- 9y2 = (3y)2
- 16x4 = (4x2)2
Not perfect squares: 20x2 (20 is not a perfect square), x5 (the exponent is odd) and 7.
Put it together with 4x2 − 25: 4x2 = (2x)2 and 25 = 52, so a = 2x and b = 5. Then 4x2 − 25 = (2x + 5)(2x − 5). Check by expanding: 4x2 − 10x + 10x − 25 = 4x2 − 25.
The steps
- Take out any GCF (greatest common factor) of all the terms first.
- Check the shape. You need exactly two terms, and each must be a perfect square, with one subtracted from the other. It does not matter which square is written first: 100 − 9t2 qualifies.
- Find a and b, the things that were squared.
- Write (a + b)(a − b).
- Check by expanding. The middle terms should cancel and you should land back on the start.
- Look again. If any factor can still be factored, keep going until the expression is completely factored.
Take out the GCF first
Sometimes the squares are hiding behind a common factor. In 20x2 − 5, neither 20 nor 5 is a perfect square, so it does not look like a difference of squares. But 5 divides both terms: 20x2 − 5 = 5(4x2 − 1). Now 4x2 = (2x)2 and 1 = 12, so 20x2 − 5 = 5(2x + 1)(2x − 1). The GCF stays out front of the finished product.
Looking for a GCF first is a strategy, not a guarantee. After you take it out, the terms still have to be perfect squares. For 3x2 − 20 the GCF is 1 and neither term is a perfect square, so this pattern does not apply.
Completely factored: keep going
An expression is completely factored when you have taken out any GCF and every other factor is prime, meaning it cannot be factored any further using integers.
Look at x4 − 16. Since x4 = (x2)2 and 16 = 42, it is a difference of squares with a = x2 and b = 4:
x4 − 16 = (x2 + 4)(x2 − 4)
Seeing x4 − 16 as (x2)2 − 42 means reading the structure of the expression: the same pattern can sit inside bigger pieces.
Now inspect each factor. The factor x2 − 4 = x2 − 22 is another difference of squares, so it factors again: (x + 2)(x − 2). The factor x2 + 4 is a sum of squares and cannot be factored (see the next section). So
x4 − 16 = (x2 + 4)(x + 2)(x − 2)
Stopping at (x2 + 4)(x2 − 4) is a correct factorization, but it is not complete, because x2 − 4 can still be factored.
Why a sum like x² + 9 does not factor
Compare x2 − 9 and x2 + 9. The first is (x + 3)(x − 3). The second is a sum of squares, and the pattern needs a minus sign.
Try to force it. (x + 3)(x − 3) = x2 − 9 has the wrong sign. (x + 3)(x + 3) = x2 + 6x + 9 and (x − 3)(x − 3) = x2 − 6x + 9 have a middle term. To make the middle terms cancel, the signs must be opposite, and opposite signs make the last term negative. So no choice of signs gives x2 + 9.
That only tried factors that look like (x ± 3). Here is an argument for all numbers. Any way of writing x2 + 9 as a product of two binomials with real coefficients can be put in the form (x + p)(x + q), because the x2 term has coefficient 1. Put x = −p. The right side becomes 0. The left side becomes p2 + 9, which is at least 9, never 0. So no real numbers p and q work. The same idea works for any sum like 4x2 + 25.
So x2 + 9 is prime: it cannot be factored using integers, and it cannot be factored with any real-number coefficients either. (A later course uses imaginary numbers, with i2 = −1, to write x2 + 9 = (x + 3i)(x − 3i).)
A sum of squares can still have a GCF: 4x2 + 36 = 4(x2 + 9). The GCF 4 comes out, and the x2 + 9 stays as it is.
A caution about how far this goes: this section is about two-term sums of degree 2, like x2 + 9 and 4x2 + 25. A few sums with higher powers, such as x4 + 4 = (x2 + 2x + 2)(x2 − 2x + 2), can be factored by methods beyond this lesson.
Mental math
The pattern also multiplies numbers quickly. If two numbers are the same distance from a number whose square you know, one is a sum and the other is a difference: (n + d)(n − d) = n2 − d2.
For 47 × 53: both numbers are 3 away from 50, so 47 × 53 = (50 − 3)(50 + 3) = 502 − 32 = 2500 − 9 = 2491.
It works only when the numbers sit the same distance on either side of the middle number. A pair like 47 × 52 is not the same distance from 50, so the trick does not apply with 50 as the middle.
Key words
- Difference of squares
- A binomial in which one perfect square is subtracted from another, such as x2 − 9 or 100 − 9t2. It factors as a2 − b2 = (a + b)(a − b).
- Perfect square
- A term that is another term squared. With whole-number coefficients, the coefficient must be 1, 4, 9, 16, 25, … and every variable exponent must be even. Examples: 49, 9y2 (which is (3y)2) and x6 (which is (x3)2).
- Sum of squares
- Two perfect squares added, such as x2 + 9. After any GCF is taken out, a two-term sum of squares of degree 2 is prime.
- Binomial
- A polynomial with exactly two terms, such as x2 − 9.
- Greatest common factor (GCF)
- The largest factor that divides every term. For 18x2 − 50 it is 2.
- Prime (cannot be factored using integers)
- A polynomial that cannot be written as a product of simpler polynomials with integer coefficients, other than by taking out 1 or −1. The polynomial x2 + 9 is prime. The polynomial 2x + 4 is not, because 2x + 4 = 2(x + 2).
- Completely factored
- Written as a product of any GCF and prime factors, so that no factor can be factored further using integers. For x4 − 16 that is (x2 + 4)(x + 2)(x − 2).
Worked examples
Example 1. Factor x2 − 64.
- Check the shape: there are two terms, a minus sign between them, and both are perfect squares. x2 is x squared and 64 = 82. There is no GCF other than 1.
- So a = x and b = 8.
- Write (a + b)(a − b) = (x + 8)(x − 8).
- Check by expanding: (x + 8)(x − 8) = x2 − 8x + 8x − 64 = x2 − 64. It matches the start.
Answer: Answer: (x + 8)(x − 8)
Example 2. Factor 49x2 − 16.
- 49x2 = (7x)2 and 16 = 42, so a = 7x and b = 4. The coefficient gets a square root too: 49 becomes 7.
- Write (7x + 4)(7x − 4).
- Check by expanding: (7x + 4)(7x − 4) = 49x2 − 28x + 28x − 16 = 49x2 − 16.
Answer: Answer: (7x + 4)(7x − 4)
Example 3. Factor x6 − 121.
- Halve the exponent: x6 = (x3)2, because (x3)2 = x3 · x3 = x6. Also 121 = 112.
- So a = x3 and b = 11, and the factorization is (x3 + 11)(x3 − 11).
- Check by expanding: (x3 + 11)(x3 − 11) = x6 − 11x3 + 11x3 − 121 = x6 − 121.
- Neither factor is a difference of squares, because 3 is an odd exponent and 11 is not a perfect square. They are in fact prime, but proving it, and factoring cubes like x3 − 8 in other problems, takes tools from a later course.
Answer: Answer: (x3 + 11)(x3 − 11)
Example 4. Factor 100 − 9t2 (the number comes first this time).
- Both terms are perfect squares: 100 = 102 and 9t2 = (3t)2. The square being subtracted is 9t2. It does not matter which square comes first.
- So a = 10 and b = 3t, and the factorization is (10 + 3t)(10 − 3t).
- Check by expanding: (10 + 3t)(10 − 3t) = 100 − 30t + 30t − 9t2 = 100 − 9t2.
- Writing it as −(3t + 10)(3t − 10) gives the same expression, because −(9t2 − 100) = 100 − 9t2.
Answer: Answer: (10 + 3t)(10 − 3t)
Example 5. Factor x4 − 16 completely.
- x4 = (x2)2 and 16 = 42, so a = x2 and b = 4: x4 − 16 = (x2 + 4)(x2 − 4).
- Inspect each factor. x2 + 4 is a sum of squares, so it is prime and stays.
- x2 − 4 = x2 − 22 is a difference of squares, so it factors again: (x + 2)(x − 2).
- Put the pieces together: (x2 + 4)(x + 2)(x − 2).
- Check by expanding in two stages: (x + 2)(x − 2) = x2 − 4, and then (x2 + 4)(x2 − 4) = x4 − 4x2 + 4x2 − 16 = x4 − 16.
Answer: Answer: (x2 + 4)(x + 2)(x − 2)
Example 6. Factor 18x2 − 50 completely.
- Neither 18 nor 50 is a perfect square, so look for a GCF first. Both are divisible by 2, and no larger number divides both: 18x2 − 50 = 2(9x2 − 25).
- Now 9x2 = (3x)2 and 25 = 52, so 9x2 − 25 = (3x + 5)(3x − 5).
- Keep the 2 out front: 2(3x + 5)(3x − 5).
- Check by expanding: (3x + 5)(3x − 5) = 9x2 − 25, and 2(9x2 − 25) = 18x2 − 50.
Answer: Answer: 2(3x + 5)(3x − 5)
Example 7. Factor 5x4 − 5 completely.
- The GCF is 5: 5x4 − 5 = 5(x4 − 1).
- x4 = (x2)2 and 1 = 12, so x4 − 1 = (x2 + 1)(x2 − 1).
- The factor x2 − 1 = x2 − 12 factors again as (x + 1)(x − 1). The factor x2 + 1 is a sum of squares, so it stays.
- Together: 5(x2 + 1)(x + 1)(x − 1).
- Check by expanding: (x + 1)(x − 1) = x2 − 1, then (x2 + 1)(x2 − 1) = x4 − 1, and 5(x4 − 1) = 5x4 − 5.
Answer: Answer: 5(x2 + 1)(x + 1)(x − 1)
Example 8. Which of these can be factored with the difference-of-squares pattern using integers? (a) 9x2 − 1 (b) x2 + 49 (c) x2 − 10 (d) 36 − x4. Factor the ones that can.
- (a) 9x2 = (3x)2 and 1 = 12, with a minus sign between them. Yes: 9x2 − 1 = (3x + 1)(3x − 1).
- (b) There is a plus sign, so this is a sum of squares. No: x2 + 49 is prime.
- (c) The terms are x2 and 10, and 10 is not a perfect square. No. (If square roots were allowed it would be (x + √10)(x − √10), but those are not integers.)
- (d) 36 = 62 and x4 = (x2)2, with the square being subtracted written second. Yes: 36 − x4 = (6 + x2)(6 − x2). Neither factor can be factored further with integers: 6 + x2 is a sum, and 6 − x2 would need 6 to be a perfect square.
- Check (a): (3x + 1)(3x − 1) = 9x2 − 1. Check (d): (6 + x2)(6 − x2) = 36 − x4.
Answer: Answer: (a) (3x + 1)(3x − 1). (b) No, it is prime. (c) No. (d) (6 + x2)(6 − x2).
Example 9. Use the pattern to find 51 × 49 in your head.
- Both numbers are 1 away from 50: 51 = 50 + 1 and 49 = 50 − 1.
- So 51 × 49 = (50 + 1)(50 − 1) = 502 − 12.
- 502 = 2500, so 2500 − 1 = 2499.
- Check the long way: 51 × 49 = 51 × 50 − 51 = 2550 − 51 = 2499.
Answer: Answer: 51 × 49 = 2499
In plain English
Picture a big square made of tiles. Cut a smaller square of tiles out of one corner. What is left looks like the letter L. The number of tiles left is the big square minus the small square.
Now here is the surprise. You can cut that L into two rectangles and slide them together into one new rectangle. The sides of the new rectangle are the big side plus the small side, and the big side minus the small side.
That is the whole idea: a2 − b2 = (a + b)(a − b). It only works with a minus sign between two squares. A plus sign, like in x2 + 9, does not split this way.
Two habits help. First, look for a common factor before anything else. Second, check your answer by multiplying it back out. The middle terms should cancel.
See it
More ways to learn it
Practice it your way
Keep going
How this lesson was checked
About standards and checking
Written by AI, then independently re-solved and checked by separate AI reviewers and automated answer checks. Written by Claude (Sonnet 5.5) from the concept template. Automated gate: schema, notation and every math answer verified by evaluated expressions. Two blind re-solves by separate AI solvers with no access to the answer key: every keyed answer matched. Two prose audits by a separate, stronger AI reviewer (Claude Opus 5.5): every finding fixed, no wrong answer keys found. Final small edits re-checked by the automated gate (no human teacher review yet). Last checked 2026-11-08.
Standards this lesson lines up with:
- CCSS A-SSE.A.2: Use the structure of an expression to identify ways to rewrite it.