
You know that moment when x² − 9 just splits into (x − 3)(x + 3) and it feels like a magic trick? There is no trick. It is one rule, and once you see it, you will spot it everywhere.
Quick Answer: A difference of squares is two perfect squares with a minus between them, like x² − 9. Factor it as (a − b)(a + b), where a and b are the square roots of the two terms. So x² − 9 becomes (x − 3)(x + 3). Check the GCF first, and keep factoring until nothing factors further.
The rule
a² − b² = (a − b)(a + b)
If you have two perfect squares with a minus between them, take their square roots and write them as (first − second)(first + second). That is the whole thing.
Why does it work? Multiply (x − 3)(x + 3) back out and you get x² + 3x − 3x − 9. The middle terms cancel each other, leaving x² − 9. That cancellation happens every single time, which is why the pattern is so reliable.
Example: 4x² − 25
First check: is 4x² a perfect square? Yes, it is (2x)². Is 25? Yes, 5². So a = 2x and b = 5. Plug into the rule and you get (2x − 5)(2x + 5). Expand it back to check: 4x² + 10x − 10x − 25 = 4x² − 25. Good.
Example: x⁴ − 16 (the nested one)
x⁴ is (x²)² and 16 is 4², so this becomes (x² − 4)(x² + 4). Most people stop here, but x² − 4 is itself a difference of squares. It breaks down further into (x − 2)(x + 2), giving a final answer of (x − 2)(x + 2)(x² + 4).
Note that (x² + 4) stays as it is. A sum of squares does not factor over real numbers. Always keep going until nothing factors further. Nested patterns like this one are exactly where exam marks get lost.
Pull out the GCF first
Look at 12x² − 48. Neither 12 nor 48 is a perfect square, so the rule does not apply directly. But factor out 12 first and you get 12(x² − 4), which contains a clean difference of squares: 12(x − 2)(x + 2).
Make this a habit. Check the GCF before trying any pattern. Our GCF calculator page handles that first step for you.
Where people go wrong
Trying it on a sum. x² + 9 is not (x − 3)(x + 3). Expand that and you get x² − 9. Signs matter.
Skipping the square check. 9x² − 7 looks close, but 7 is not a perfect square, so the pattern fails. Both parts must be squares.
Mixing it up with trinomials. x² + 2x + 1 is not a difference of squares at all. It is a perfect square trinomial, which follows a different rule.
What if it is not a difference of squares?
For full polynomials, use the main factoring calculator or walk through the how to factor polynomials guide. Every tool is on the calculators page.
Practice Problems
Try these, then check your answers:
- Factor x² − 49. (Answer: (x − 7)(x + 7). Check: x² + 7x − 7x − 49 = x² − 49.)
- Factor 25x² − 1. (Answer: (5x − 1)(5x + 1). Check: 25x² + 5x − 5x − 1 = 25x² − 1.)
- Factor 3x² − 27. First take out the GCF 3: 3(x² − 9) = 3(x − 3)(x + 3). Check: 3(x² − 9) = 3x² − 27.
Frequently Asked Questions
Can you factor a sum of squares?
No. x² + 9 does not factor over real numbers.
What if the terms are not perfect squares?
Then the pattern does not apply. Try factoring out a GCF first, or use another method.
Do you stop after one step?
No. Keep factoring each factor until nothing factors further. The x⁴ − 16 example in this post shows why.
What is the formula?
a² − b² = (a − b)(a + b).
