Difference of squares or perfect-square trinomial?

Recognize the pattern from term count, signs, square roots, and the middle coefficient—then expand to confirm rather than trusting appearance alone.

LaTeX article Updated July 13, 2026

a2b2=(ab)(a+b)a2±2ab+b2=(a±b)2a^2-b^2=(a-b)(a+b)\qquad a^2\pm2ab+b^2=(a\pm b)^2

Difference of squares needs subtraction

Both terms must be perfect squares and the operation between them must be subtraction. A sum of squares does not factor into real linear factors by this pattern.

Identify the square roots, then write the conjugate pair with opposite signs.

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

Perfect-square trinomials need the middle check

The first and last terms may be squares without the trinomial being a perfect square. Multiply their roots, double the product, and compare with the middle term.

The sign of the middle term chooses the sign inside the repeated binomial.

x210x+25=(x5)2x^2-10x+25=(x-5)^2

Factor the GCF before pattern matching

A common factor can hide the pattern or make the apparent square roots misleading. Remove it first and inspect what remains.

Patterns can repeat: after a difference of squares, one factor may itself factor again.

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

Worked example

Common mistakes

  • Factoring a sum of squares as real conjugates.
  • Checking only the first and last terms of a trinomial.
  • Stopping before removing a common factor.

Keep these ideas

  • Count terms and inspect signs.
  • Verify the ±2ab middle coefficient.
  • Factor completely, not just once.
Vocab
Polynomial
Math glossaryPolynomial
anxn++a1x+a0a_nx^n+\cdots+a_1x+a_0

A finite sum of terms with nonnegative integer variable exponents.

Learn more
Factoring
Math glossaryFactoring
x29=(x3)(x+3)x^2-9=(x-3)(x+3)

Rewrites a sum or difference as an equivalent product.

Learn more
Factor
Math glossaryFactor
(x2)(x+3)(x-2)(x+3)

A quantity multiplied as part of a product.

Learn more
Quadratic
Math glossaryQuadratic
ax2+bx+cax^2+bx+c

A degree-two polynomial equation or function.

Learn more
Zero-product property
Math glossaryZero-product property
ab=0a=0 or b=0ab=0\Rightarrow a=0\ \text{or}\ b=0

A product is zero only when at least one factor is zero.

Learn more
Math glossary