Algebra

Factoring Difference of Squares

Last updated: March 2026 · Intermediate
Before you start

You should be comfortable with:

Real-world applications
Electrical

Voltage drop, wire sizing, load balancing

The difference of squares is one of the most recognizable factoring patterns in algebra. Once you learn to spot it, you can factor certain binomials instantly — no AC method, no trial and error, just one clean formula.

The pattern is:

a2b2=(a+b)(ab)a^2 - b^2 = (a + b)(a - b)

This works because when you multiply (a+b)(ab)(a + b)(a - b) using FOIL, the middle terms cancel:

(a+b)(ab)=a2ab+abb2=a2b2(a + b)(a - b) = a^2 - ab + ab - b^2 = a^2 - b^2

The key is recognizing when an expression fits this pattern: it must be a binomial (two terms), both terms must be perfect squares, and they must be connected by subtraction.

Recognizing Perfect Squares

Before you can use this pattern, you need to quickly identify perfect squares.

Perfect square numbers: 1,4,9,16,25,36,49,64,81,100,121,144,1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, \ldots

Perfect square variables: A variable expression is a perfect square when the exponent is even — x2x^2, x4x^4, x6x^6, y8y^8, etc. The “square root” is the variable raised to half the exponent.

ExpressionIs it a perfect square?Square root
9x29x^2Yes: 9=329 = 3^2, x2=(x)2x^2 = (x)^23x3x
25y425y^4Yes: 25=5225 = 5^2, y4=(y2)2y^4 = (y^2)^25y25y^2
16a2b616a^2b^6Yes: 16=4216 = 4^2, a2=(a)2a^2 = (a)^2, b6=(b3)2b^6 = (b^3)^24ab34ab^3
12x212x^2No: 12 is not a perfect square
x3x^3No: odd exponent

Basic Examples

Example 1: Factor x29x^2 - 9

Identify the squares: x2=(x)2x^2 = (x)^2 and 9=(3)29 = (3)^2.

Apply the pattern:

x29=(x)2(3)2=(x+3)(x3)x^2 - 9 = (x)^2 - (3)^2 = (x + 3)(x - 3)

Check: (x+3)(x3)=x23x+3x9=x29(x + 3)(x - 3) = x^2 - 3x + 3x - 9 = x^2 - 9 . Correct.

Example 2: Factor 4x2254x^2 - 25

Identify the squares: 4x2=(2x)24x^2 = (2x)^2 and 25=(5)225 = (5)^2.

Apply the pattern:

4x225=(2x)2(5)2=(2x+5)(2x5)4x^2 - 25 = (2x)^2 - (5)^2 = (2x + 5)(2x - 5)

Check: (2x+5)(2x5)=4x210x+10x25=4x225(2x + 5)(2x - 5) = 4x^2 - 10x + 10x - 25 = 4x^2 - 25 . Correct.

Example 3: Factor 49a264b249a^2 - 64b^2

Identify the squares: 49a2=(7a)249a^2 = (7a)^2 and 64b2=(8b)264b^2 = (8b)^2.

Apply the pattern:

49a264b2=(7a+8b)(7a8b)49a^2 - 64b^2 = (7a + 8b)(7a - 8b)

Higher-Degree Differences of Squares

The pattern works whenever both terms are perfect squares — even with higher exponents.

Example 4: Factor x416x^4 - 16

Identify the squares: x4=(x2)2x^4 = (x^2)^2 and 16=(4)216 = (4)^2.

Apply the pattern:

x416=(x2)2(4)2=(x2+4)(x24)x^4 - 16 = (x^2)^2 - (4)^2 = (x^2 + 4)(x^2 - 4)

But wait — factor completely! The second factor, x24x^2 - 4, is itself a difference of squares:

x24=(x+2)(x2)x^2 - 4 = (x + 2)(x - 2)

So the complete factorization is:

x416=(x2+4)(x+2)(x2)x^4 - 16 = (x^2 + 4)(x + 2)(x - 2)

The first factor, x2+4x^2 + 4, is a sum of squares — it does not factor over the real numbers (more on this below).

Example 5: Factor 81y4181y^4 - 1

Identify the squares: 81y4=(9y2)281y^4 = (9y^2)^2 and 1=(1)21 = (1)^2.

81y41=(9y2+1)(9y21)81y^4 - 1 = (9y^2 + 1)(9y^2 - 1)

Factor the second term again:

9y21=(3y+1)(3y1)9y^2 - 1 = (3y + 1)(3y - 1)

Complete factorization:

81y41=(9y2+1)(3y+1)(3y1)81y^4 - 1 = (9y^2 + 1)(3y + 1)(3y - 1)

Factor Out the GCF First

Always check for a GCF before applying the difference of squares pattern.

Example 6: Factor 50x21850x^2 - 18

Step 1 — Factor out the GCF: The GCF of 50 and 18 is 2.

50x218=2(25x29)50x^2 - 18 = 2(25x^2 - 9)

Step 2 — Apply the difference of squares pattern: 25x2=(5x)225x^2 = (5x)^2 and 9=(3)29 = (3)^2.

2(25x29)=2(5x+3)(5x3)2(25x^2 - 9) = 2(5x + 3)(5x - 3)

Without factoring out the 2 first, you would not see the difference of squares pattern at all, since 50 and 18 are not perfect squares.

Example 7: Factor 3x312x3x^3 - 12x

Step 1 — Factor out the GCF: The GCF is 3x3x.

3x312x=3x(x24)3x^3 - 12x = 3x(x^2 - 4)

Step 2 — Apply the difference of squares:

3x(x24)=3x(x+2)(x2)3x(x^2 - 4) = 3x(x + 2)(x - 2)

The Sum of Squares Does NOT Factor

This is a critical distinction. While a2b2a^2 - b^2 factors beautifully, the sum of squares a2+b2a^2 + b^2 does not factor over the real numbers.

a2+b2(a+b)(ab)(wrong!)a^2 + b^2 \neq (a + b)(a - b) \qquad \text{(wrong!)}

a2+b2(a+b)2(wrong — that equals a2+2ab+b2)a^2 + b^2 \neq (a + b)^2 \qquad \text{(wrong — that equals } a^2 + 2ab + b^2\text{)}

There is simply no way to write x2+9x^2 + 9 as a product of two real-number binomials. When you encounter a sum of squares, it is already fully factored (over the reals). Leave it alone.

Quick test: Is it a difference (subtraction) of two perfect squares? If yes, factor it. If it is a sum (addition) of two squares, stop — it does not factor.

Difference of Squares with Subtraction in Disguise

Sometimes the expression is rearranged so the subtraction is not immediately obvious.

Example 8: Factor 25+4x2-25 + 4x^2

Rewrite in standard order:

4x225=(2x+5)(2x5)4x^2 - 25 = (2x + 5)(2x - 5)

Example 9: Factor 9x29 - x^2

This is already a difference of squares — just written with the constant first:

9x2=(3)2(x)2=(3+x)(3x)9 - x^2 = (3)^2 - (x)^2 = (3 + x)(3 - x)

You can also write it as (x29)=(x+3)(x3)-(x^2 - 9) = -(x + 3)(x - 3), but (3+x)(3x)(3 + x)(3 - x) is perfectly valid and more direct.

Real-World Application: Electrician — Power Difference in Parallel Circuits

An electrician compares the power dissipated by a resistive load at two different operating currents. Using the formula P=I2RP = I^2 R, the difference in power between current I1I_1 and current I2I_2 through the same resistance RR is:

ΔP=I12RI22R\Delta P = I_1^2 R - I_2^2 R

Factor out RR, then apply the difference of squares:

ΔP=R(I12I22)=R(I1+I2)(I1I2)\Delta P = R(I_1^2 - I_2^2) = R(I_1 + I_2)(I_1 - I_2)

If I1=8I_1 = 8 amps and I2=5I_2 = 5 amps with R=10R = 10 ohms:

ΔP=10(8+5)(85)=10×13×3=390 watts\Delta P = 10(8 + 5)(8 - 5) = 10 \times 13 \times 3 = 390 \text{ watts}

The factored form makes the calculation easier — you avoid squaring each current separately. It also reveals that the power difference depends on both the sum and the difference of the currents.

Common Mistakes to Avoid

  1. Trying to factor a sum of squares. Remember: a2+b2a^2 + b^2 does not factor over the reals. Only the difference a2b2a^2 - b^2 factors.
  2. Forgetting to factor completely. After applying the pattern, check whether either factor is itself a difference of squares (like x416x^4 - 16).
  3. Not factoring out the GCF first. Expressions like 50x21850x^2 - 18 do not look like a difference of squares until you factor out the 2.
  4. Misidentifying perfect squares. Remember that x3x^3 is not a perfect square (odd exponent), and numbers like 12, 18, or 20 are not perfect squares. The coefficient and every variable factor must be perfect squares.
  5. Confusing (ab)2(a - b)^2 with a2b2a^2 - b^2. The expression (ab)2=a22ab+b2(a - b)^2 = a^2 - 2ab + b^2 — it has three terms. The difference of squares a2b2a^2 - b^2 has only two terms and no middle term.

Practice Problems

Test your understanding with these problems. Click to reveal each answer.

Problem 1: Factor x249x^2 - 49

x2=(x)2x^2 = (x)^2 and 49=(7)249 = (7)^2.

x249=(x+7)(x7)x^2 - 49 = (x + 7)(x - 7)

Answer: (x+7)(x7)(x + 7)(x - 7)

Problem 2: Factor 9x219x^2 - 1

9x2=(3x)29x^2 = (3x)^2 and 1=(1)21 = (1)^2.

9x21=(3x+1)(3x1)9x^2 - 1 = (3x + 1)(3x - 1)

Answer: (3x+1)(3x1)(3x + 1)(3x - 1)

Problem 3: Factor 36a249b236a^2 - 49b^2

36a2=(6a)236a^2 = (6a)^2 and 49b2=(7b)249b^2 = (7b)^2.

36a249b2=(6a+7b)(6a7b)36a^2 - 49b^2 = (6a + 7b)(6a - 7b)

Answer: (6a+7b)(6a7b)(6a + 7b)(6a - 7b)

Problem 4: Factor x481x^4 - 81

x4=(x2)2x^4 = (x^2)^2 and 81=(9)281 = (9)^2.

x481=(x2+9)(x29)x^4 - 81 = (x^2 + 9)(x^2 - 9)

Factor x29x^2 - 9 again:

=(x2+9)(x+3)(x3)= (x^2 + 9)(x + 3)(x - 3)

Answer: (x2+9)(x+3)(x3)(x^2 + 9)(x + 3)(x - 3)

Problem 5: Factor 20x24520x^2 - 45

Factor out the GCF of 5 first:

20x245=5(4x29)20x^2 - 45 = 5(4x^2 - 9)

Now apply the difference of squares: 4x2=(2x)24x^2 = (2x)^2 and 9=(3)29 = (3)^2.

=5(2x+3)(2x3)= 5(2x + 3)(2x - 3)

Answer: 5(2x+3)(2x3)5(2x + 3)(2x - 3)

Problem 6: Can x2+16x^2 + 16 be factored?

No. This is a sum of squares. It does not factor over the real numbers.

Answer: x2+16x^2 + 16 is already fully factored (prime over the reals).

Problem 7: Factor 2x350x2x^3 - 50x

Factor out the GCF of 2x2x:

2x350x=2x(x225)2x^3 - 50x = 2x(x^2 - 25)

Apply the difference of squares:

=2x(x+5)(x5)= 2x(x + 5)(x - 5)

Answer: 2x(x+5)(x5)2x(x + 5)(x - 5)

Key Takeaways

  • The difference of squares pattern is a2b2=(a+b)(ab)a^2 - b^2 = (a + b)(a - b)
  • Both terms must be perfect squares connected by subtraction
  • The sum of squares a2+b2a^2 + b^2 does not factor over the real numbers
  • Always factor out the GCF first — it can reveal a hidden difference of squares
  • Always factor completely — check if either result is itself a difference of squares
  • This pattern appears frequently in physics, engineering, and trade calculations whenever you need the difference of two squared quantities

Return to Algebra for more topics in this section.

Last updated: March 29, 2026