Allday Education

Factoring Binomials (Difference of Squares)

A difference of squares is a two-term polynomial where both terms are perfect squares and they are being subtracted: x216x^{2} - 16, 9x2259x^{2} - 25, 4x2494x^{2} - 49. Every one of them factors the same way: a2b2=(a+b)(ab)a^{2} - b^{2} = (a + b)(a - b).

The pattern works because multiplying (a+b)(ab)(a + b)(a - b) makes the middle terms cancel — Outer gives ab-ab and Inner gives +ab+ab, and they wipe each other out, leaving just a2b2a^{2} - b^{2}. Factoring runs that product in reverse: spot the two squares, write one plus and one minus.

Spotting the pattern

Three things must be true: exactly two terms, a subtraction between them, and both terms perfect squares. In x216x^{2} - 16, the first term is x2x^{2} (the square of xx) and 16=4216 = 4^{2}, so it qualifies with a=xa = x and b=4b = 4.

Coefficients count too. 9x29x^{2} is a perfect square because 9x2=(3x)29x^{2} = (3x)^{2} — take the square root of the coefficient and halve the exponent. So 9x2259x^{2} - 25 factors with a=3xa = 3x and b=5b = 5.

Once you have aa and bb, the answer writes itself: (a+b)(ab)(a + b)(a - b). The order of the two factors does not matter.

A sum of squares does not factor

The subtraction is not optional. x2+36x^{2} + 36 is a sum of squares, and it does not factor over the real numbers. Try it: (x+6)(x6)=x236(x + 6)(x - 6) = x^{2} - 36, and (x+6)(x+6)=x2+12x+36(x + 6)(x + 6) = x^{2} + 12x + 36. No pair of binomials produces x2+36x^{2} + 36, because any middle terms either cancel (giving a difference) or survive (giving a trinomial).

On a test, "cannot be factored" is the correct answer for a sum of squares — writing (x+6)(x6)(x + 6)(x - 6) for x2+36x^{2} + 36 is the trap the question is checking for.

Check for a GCF first

Some binomials hide the pattern behind a common factor. 4x2364x^{2} - 36 is technically a difference of squares as written, but factoring the GCF of 44 first gives 4(x29)4(x^{2} - 9), and then the difference of squares finishes it: 4(x+3)(x3)4(x + 3)(x - 3).

GCF first, pattern second — that order keeps the numbers small and guarantees a completely factored answer.

Worked examples

Example 1: the basic pattern

Factor x249x^{2} - 49.

Identify the squaresx2=(x)2,49=72x^{2} = (x)^{2}, \quad 49 = 7^{2}
Apply the pattern with a=xa = x, b=7b = 7a2b2=(a+b)(ab)a^{2} - b^{2} = (a + b)(a - b)
Write the factors(x+7)(x7)(x + 7)(x - 7)

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

Example 2: a coefficient on the squared term

Factor 4x2254x^{2} - 25.

Identify the squares4x2=(2x)2,25=524x^{2} = (2x)^{2}, \quad 25 = 5^{2}
Apply the pattern with a=2xa = 2x, b=5b = 5(2x+5)(2x5)(2x + 5)(2x - 5)

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

Example 3: GCF first

Factor 4x2364x^{2} - 36 completely.

Factor out the GCF of 444(x29)4(x^{2} - 9)
Identify the squares insidex2=(x)2,9=32x^{2} = (x)^{2}, \quad 9 = 3^{2}
Apply the pattern4(x+3)(x3)4(x + 3)(x - 3)

Answer: 4(x+3)(x3)4(x + 3)(x - 3)

Try one yourself

Common questions

Why do the middle terms cancel when I multiply (a+b)(ab)(a + b)(a - b)?

FOIL it: First gives a2a^{2}, Outer gives ab-ab, Inner gives +ab+ab, Last gives b2-b^{2}. The Outer and Inner terms are opposites, so they add to zero — leaving a2b2a^{2} - b^{2} with no middle term.

Can x2+36x^{2} + 36 be factored some other way?

Not with real numbers. A sum of squares has no real factoring — the check is quick: no two real binomials multiply to it. (In Algebra 2 you will factor it with imaginary numbers, but for now the answer is that it does not factor.)

How do I know if a term like 9x29x^{2} is a perfect square?

Ask two questions: is the coefficient a perfect square, and is the exponent even? 9x2=(3x)29x^{2} = (3x)^{2} passes both. Something like 8x28x^{2} fails, because 88 is not a perfect square.

Does the order (a+b)(ab)(a + b)(a - b) versus (ab)(a+b)(a - b)(a + b) matter?

No. Multiplication is commutative, so both orders are the same answer. What matters is that one factor has a plus and the other has a minus between the same two terms.

Want the video version?

Allday Everyday Math has video lessons, practice, and an AI tutor for every topic, Pre-Algebra through Algebra 2.

Try it for $1