Perfect Square Trinomial

Quickly factor trinomials of the form a2±2ab+b2a^2 \pm 2ab + b^2 by recognizing the perfect square pattern that gives (a±b)2(a \pm b)^2.

a2±2ab+b2=(a±b)2a^2 \pm 2ab + b^2 = (a \pm b)^2

Solve a problem with Perfect Square Trinomial

Type the problem. The solver will use Perfect Square Trinomial where Perfect Square Trinomial is the right tool, and tell you when it is not.

Drag one in or paste from the clipboard. JPEG, PNG or WebP. You get the transcription to check before anything is solved.

How to get a better answer
  • Paste the whole problem, including the instruction word — "simplify", "solve for x" and "factor" lead to three different answers.
  • Say what you have already tried. "I got x = 4 and the book says 2" turns a solution into a diagnosis.
  • Set the level in the settings button. A calculus shortcut is not a better answer if you have not met derivatives yet.
  • For a photo, get the whole problem in frame and hold the page flat — you get the transcription to fix before anything is solved.

What each symbol means

What Perfect Square Trinomial takes
aa
bb
Perfect Square Trinomial
SymbolMeaning
aaThe value or expression that, when squared, produces the first term of the trinomial; misidentifying aa causes the entire factorization to fail.
bbThe value or expression that, when squared, produces the last term of the trinomial; confusing bb with aa or making an arithmetic error here ruins the middle coefficient 2ab2ab.

When to use it

When you see a trinomial with two perfect square terms and need to factor it quickly.

Level

Usually taught in: Algebra I

Worked examples

1. Factor a trinomial with small integer coefficients

Problem

Factor x2+6x+9x^2 + 6x + 9.
  1. a=x,b=3(since a2=x2 and b2=9)a = x, \quad b = 3 \quad (\text{since } a^2 = x^2 \text{ and } b^2 = 9)

    We identify aa from the first term x2x^2 and bb from the last term 99.

  2. 2ab=2x3=6x2ab = 2 \cdot x \cdot 3 = 6x

    The middle term must equal 2ab=6x2ab = 6x, which it does, confirming this is a perfect square trinomial.

  3. x2+6x+9=(x+3)2x^2 + 6x + 9 = (x + 3)^2

    Since the pattern matches, we write the factorization directly as (a+b)2(a + b)^2 with a=xa = x and b=3b = 3.

Answer: (x+3)2(x + 3)^2

This is a textbook perfect square trinomial—the first and last terms are perfect squares, and the middle term equals exactly 2ab2ab. We recognized the pattern and factored directly.

2. Factor a trinomial with a leading coefficient greater than 1

Problem

Factor 4x212x+94x^2 - 12x + 9.
  1. a=2x,b=3(since a2=(2x)2=4x2 and b2=9)a = 2x, \quad b = 3 \quad (\text{since } a^2 = (2x)^2 = 4x^2 \text{ and } b^2 = 9)

    The first term is 4x2=(2x)24x^2 = (2x)^2, so a=2xa = 2x; the last term is 9=329 = 3^2, so b=3b = 3.

  2. 2ab=22x3=12x2ab = 2 \cdot 2x \cdot 3 = 12x

    With a=2xa = 2x and b=3b = 3, the product 2ab=12x2ab = 12x. Our trinomial has 12x-12x, so we use the minus version of the pattern.

  3. 4x212x+9=(2x3)24x^2 - 12x + 9 = (2x - 3)^2

    The trinomial matches a22ab+b2=(ab)2a^2 - 2ab + b^2 = (a - b)^2 with a=2xa = 2x and b=3b = 3.

Answer: (2x3)2(2x - 3)^2

Even though the leading coefficient is not 1, we can still recognize the perfect square pattern by taking square roots of the first and last terms to find aa and bb. The minus sign in the middle tells us to use (ab)2(a - b)^2 instead of (a+b)2(a + b)^2.

3. Factor a trinomial in a word problem about basketball scoring

Problem

A basketball player's scoring follows a pattern: in week nn, she scores n2+4n+4n^2 + 4n + 4 points total. Factor this expression to find another way to describe her scoring.
  1. a=n,b=2(since a2=n2 and b2=4)a = n, \quad b = 2 \quad (\text{since } a^2 = n^2 \text{ and } b^2 = 4)

    The scoring formula n2+4n+4n^2 + 4n + 4 has first term n2n^2 (so a=na = n) and last term 44 (so b=2b = 2).

  2. 2ab=2n2=4n2ab = 2 \cdot n \cdot 2 = 4n

    We verify that the middle term matches: 2ab=4n2ab = 4n, which is exactly what we have in the trinomial.

  3. n2+4n+4=(n+2)2n^2 + 4n + 4 = (n + 2)^2

    The trinomial matches a2+2ab+b2=(a+b)2a^2 + 2ab + b^2 = (a + b)^2, so her scoring in week nn equals (n+2)2(n + 2)^2.

Answer: (n+2)2(n + 2)^2

By recognizing this trinomial as a perfect square, we see that her weekly scoring in week nn equals (n+2)2(n + 2)^2. For instance, in week 3 she scores (3+2)2=25(3+2)^2 = 25 points, and in week 5 she scores (5+2)2=49(5+2)^2 = 49 points. The perfect square form makes predictions about her scoring pattern much easier.

Common mistakes

Where Perfect Square Trinomial usually goes wrong
Answer came out wrong
Factoring x2+5x+6x^2 + 5x + 6 as (x+2.5)2(x + 2.5)^2 because the first term is a perfect square.
Check: is the last term a perfect square? Here 66 is not a perfect square. Use Factoring Trinomials instead: (x+2)(x+3)(x + 2)(x + 3).
Factoring x2+7x+9x^2 + 7x + 9 as (x+3)2(x + 3)^2 even though the middle term should be 2(1)(3)=6x2(1)(3) = 6x, not 7x7x.
Check: does 2ab=2(x)(3)=6x2ab = 2(x)(3) = 6x equal the middle term 7x7x? No. Use Factoring Trinomials or the Quadratic Formula instead.
Writing 4x212x+9=(4x9)24x^2 - 12x + 9 = (4x - 9)^2 by taking a=4xa = 4x and b=9b = 9 directly from the terms.
Take square roots: 4x2=2x\sqrt{4x^2} = 2x and 9=3\sqrt{9} = 3. Check: 2ab=2(2x)(3)=12x2ab = 2(2x)(3) = 12x, which matches the middle term, confirming (2x3)2(2x - 3)^2.
The mistakeWhy it is wrongThe fix
Factoring x2+5x+6x^2 + 5x + 6 as (x+2.5)2(x + 2.5)^2 because the first term is a perfect square.Not every trinomial with a perfect square first term is a perfect square trinomial; the last term must also be a perfect square, and the middle term must equal exactly 2ab2ab.Check: is the last term a perfect square? Here 66 is not a perfect square. Use Factoring Trinomials instead: (x+2)(x+3)(x + 2)(x + 3).
Factoring x2+7x+9x^2 + 7x + 9 as (x+3)2(x + 3)^2 even though the middle term should be 2(1)(3)=6x2(1)(3) = 6x, not 7x7x.The pattern a2+2ab+b2a^2 + 2ab + b^2 is rigid; if the middle coefficient does not equal exactly 2ab2ab, the trinomial is not a perfect square, and this factorization is incorrect.Check: does 2ab=2(x)(3)=6x2ab = 2(x)(3) = 6x equal the middle term 7x7x? No. Use Factoring Trinomials or the Quadratic Formula instead.
Writing 4x212x+9=(4x9)24x^2 - 12x + 9 = (4x - 9)^2 by taking a=4xa = 4x and b=9b = 9 directly from the terms.The bases aa and bb are the square roots of the first and last terms, not the terms themselves. Here a=4x2=2xa = \sqrt{4x^2} = 2x and b=9=3b = \sqrt{9} = 3, not 4x4x and 99.Take square roots: 4x2=2x\sqrt{4x^2} = 2x and 9=3\sqrt{9} = 3. Check: 2ab=2(2x)(3)=12x2ab = 2(2x)(3) = 12x, which matches the middle term, confirming (2x3)2(2x - 3)^2.

Tips and when to use something else

  • Always verify that all three pieces fit the pattern: the first term must be a perfect square, the last term must be a perfect square, and the middle term must equal exactly 2ab2ab.
  • Perfect square trinomials always have both a ++ and - version: a2+2ab+b2=(a+b)2a^2 + 2ab + b^2 = (a+b)^2 and a22ab+b2=(ab)2a^2 - 2ab + b^2 = (a-b)^2; the sign of the middle term determines which form to use.
  • If the trinomial does not fit the pattern, switch to Factoring Trinomials (using the AC method or trial-and-error) or the Quadratic Formula instead of forcing a perfect square factorization.
  • Mastering perfect square trinomials speeds up algebra and prepares you for completing the square in quadratics and simplifying radicals in calculus.

Frequently asked questions

How do I know if a trinomial is a perfect square?
Check three things: the first term is a perfect square, the last term is a perfect square, and the middle term equals 2ab2ab where aa and bb are the square roots of the first and last terms. If all three conditions hold, it's a perfect square trinomial.
What is the difference between a2+2ab+b2a^2 + 2ab + b^2 and a2+2abb2a^2 + 2ab - b^2?
The first is a perfect square trinomial that factors as (a+b)2(a+b)^2. The second is not a perfect square trinomial because the last term is negative. Perfect square trinomials must have both a2a^2 and b2b^2 as positive perfect squares; they cannot have a negative constant term.
Can I use perfect square trinomials if the leading coefficient is not 1?
Yes! As long as the first term is a perfect square (like 4x2=(2x)24x^2 = (2x)^2 or 9x2=(3x)29x^2 = (3x)^2), you can still use the pattern. Extract the square root of the leading coefficient and the constant, check that 2ab2ab matches the middle term, and factor. For example, 4x212x+9=(2x3)24x^2 - 12x + 9 = (2x - 3)^2.
Why is it called a perfect square trinomial?
Because the trinomial factors into a perfect square—a binomial multiplied by itself, like (a+b)2(a+b)^2 or (ab)2(a-b)^2. The word 'perfect' emphasizes that it is an exact square, not an approximation or remainder.

Need a different method?

The full solver is not scoped to one formula — type any problem and it will pick the method.

Open the math solver

Reviewed 2026-09-18