Squares of Binomials

Learning goals

  • Expand (a+b)2(a + b)^2 as a2+2ab+b2a^2 + 2ab + b^2
  • Use (a−b)2=a2−2ab+b2(a - b)^2 = a^2 - 2ab + b^2 for a difference, keeping the last term positive
  • Show why the middle term cannot be dropped
  • Square the whole term, coefficient included
  • Factor a perfect-square trinomial by reading the pattern backward, pulling out a common factor first

Squaring a sum

To square any quantity is to multiply it by itself, so squaring the binomial a+ba + b means forming the product (a+b)(a+b)(a + b)(a + b). Before working through the algebra, look at a picture of it: cut a square into pieces and watch where each term in the answer comes from.

The picture makes the middle term impossible to miss. A square with side a+ba + b has area (a+b)2(a + b)^2. Cut it at the point where the length aa meets the length bb, in both directions. Those two cuts split the square into four regions: a square of area a2a^2, a square of area b2b^2, and two identical rectangles each of area abab. The two rectangles are exactly why the middle term is 2ab2ab and not just abab. There are genuinely two of them, one above the small square and one beside it. This picture needs aa and bb to be positive lengths; the algebra below proves the identity for any real numbers at all, including negative ones.

Area model for the square of a sumA square of side a plus b is divided by one vertical and one horizontal cut into a square of area a squared, two equal rectangles of area a b, and a square of area b squared, showing that the whole area a plus b squared equals a squared plus two a b plus b squared.ababa²ababb²(a + b)² = a² + 2ab + b²
A square of side a plus b divides into a square of area a squared, a square of area b squared, and two equal rectangles each of area a b. The two rectangles are why the middle term is twice a b.

The picture shows why the middle term is there. Algebra confirms it for every real number, not just positive lengths:

Why (a+b)2=a2+2ab+b2(a + b)^2 = a^2 + 2ab + b^2#

Squaring a quantity means multiplying it by itself, so (a+b)2(a + b)^2 is shorthand for the product (a+b)(a+b)(a + b)(a + b). Expand it the way you expand any product of two sums, multiplying every term of the first factor by every term of the second:

(a+b)(a+b)=a⋅a+a⋅b+b⋅a+b⋅b.(a + b)(a + b) = a\cdot a + a\cdot b + b\cdot a + b\cdot b.

The four products are a2a^2, then abab, then baba, then b2b^2. Because the order of multiplication does not matter, abab and baba are the same quantity, so the two middle products are equal and combine into a single 2ab2ab:

a2+ab+ba+b2=a2+2ab+b2.a^2 + ab + ba + b^2 = a^2 + 2ab + b^2.

So squaring a sum gives three terms, not two. The three are the square of the first term, the square of the last term, and a middle term twice the product of the sum’s two terms. That doubled middle term is there because a sum has two matching cross-products, one from each factor, and they land on top of each other.

Squaring a difference

A difference squared works in the very same way, and only one thing changes. Write (a−b)2(a - b)^2 as the product (a−b)(a−b)(a - b)(a - b) and expand it, carrying every sign along.

Why (a−b)2=a2−2ab+b2(a - b)^2 = a^2 - 2ab + b^2#

Write the square as a product and multiply every term of the first factor by every term of the second, keeping track of the signs:

(a−b)(a−b)=a⋅a−a⋅b−b⋅a+b⋅b.(a - b)(a - b) = a\cdot a - a\cdot b - b\cdot a + b\cdot b.

The first product is a2a^2, and the last is (−b)(−b)=b2(-b)(-b) = b^2, which is positive because a negative times a negative is positive. The two middle products are −ab-ab and −ba-ba, both negative, and they combine into −2ab-2ab:

a2−ab−ba+b2=a2−2ab+b2.a^2 - ab - ba + b^2 = a^2 - 2ab + b^2.

Only the middle term changed. Squaring a difference gives the same first square a2a^2 and the same last square b2b^2 as squaring a sum, but the middle term is now subtracted. The final term stays positive because the last term of a−ba - b is −b-b, and squaring −b-b gives +b2+b^2.

The two patterns are worth holding side by side, because they differ in exactly one place. In both, the first and last terms are the squares a2a^2 and b2b^2. The middle term is twice the product of the two terms, added when the binomial is a sum and subtracted when it is a difference.

Worked example 1 Expand (x+5)2(x + 5)^2 and (x−7)2(x - 7)^2

For (x+5)2(x + 5)^2, use (a+b)2=a2+2ab+b2(a + b)^2 = a^2 + 2ab + b^2 with a=xa = x and b=5b = 5. Square the first term, square the last term, and put twice their product in the middle:

(x+5)2=x2+2⋅x⋅5+52=x2+10x+25.(x + 5)^2 = x^2 + 2\cdot x\cdot 5 + 5^2 = x^2 + 10x + 25.

For (x−7)2(x - 7)^2, use the difference pattern (a−b)2=a2−2ab+b2(a - b)^2 = a^2 - 2ab + b^2 with a=xa = x and b=7b = 7. The first and last terms are still squares, and only the middle term turns negative:

(x−7)2=x2−2⋅x⋅7+72=x2−14x+49.(x - 7)^2 = x^2 - 2\cdot x\cdot 7 + 7^2 = x^2 - 14x + 49.

Notice that the last term is +49+49 in the second one too. Squaring the −7-7 makes it positive, so a difference squared never ends in a negative constant.

Why the middle term cannot be dropped

The single most common error with these patterns is to square each piece and stop, writing (a+b)2=a2+b2(a + b)^2 = a^2 + b^2. That throws away the two cross-products entirely, and it is simply false. A quick number check settles it once and for all. Take a=3a = 3 and b=4b = 4:

(3+4)2=72=49,32+42=9+16=25.(3 + 4)^2 = 7^2 = 49, \qquad 3^2 + 4^2 = 9 + 16 = 25.

The two results are not equal, and the gap between them is 49−25=2449 - 25 = 24, which is exactly the missing middle term 2ab=2⋅3⋅4=242ab = 2\cdot 3\cdot 4 = 24. Whenever aa and bb are both nonzero, 2ab2ab is nonzero too, so squaring a sum is never the same as adding the squares. Keep all three terms, or the total comes out wrong.

Check your understanding

In the area model, a square of side a+ba + b splits into a square of area a2a^2, a square of area b2b^2, and two matching rectangles. Why does dropping those two rectangles make a2+b2a^2 + b^2 the wrong total?

Answer choices

Check your understanding

Expand (x+6)2(x + 6)^2.

Answer choices

Squaring binomials that carry coefficients

Nothing about the patterns requires aa and bb to be single letters. They can be terms with coefficients, and the rule is unchanged: square the whole term, coefficient and variable together. The trap is to square the variable but leave the coefficient behind. In (2x)2(2x)^2 the entire 2x2x is squared, so (2x)2=22x2=4x2(2x)^2 = 2^2 x^2 = 4x^2, not 2x22x^2. Once each term is squared correctly and their product is doubled for the middle, everything proceeds as before.

Worked example 2 Square (2x+3)2(2x + 3)^2

Take a=2xa = 2x and b=3b = 3. Square the first term, square the last term, and double their product:

(2x+3)2=(2x)2+2⋅(2x)⋅3+32=4x2+12x+9.(2x + 3)^2 = (2x)^2 + 2\cdot(2x)\cdot 3 + 3^2 = 4x^2 + 12x + 9.

The first term is (2x)2=4x2(2x)^2 = 4x^2, with the 22 squared as well as the xx. Nothing else about the pattern changes: 2x2x is treated as one whole term, the way a bare xx was treated before.

Worked example 3 Square (2a+5b)2(2a + 5b)^2

The pattern also handles a binomial built from two different variables instead of one. Take the first term to be 2a2a and the last to be 5b5b:

(2a+5b)2=(2a)2+2⋅(2a)⋅(5b)+(5b)2=4a2+20ab+25b2.(2a + 5b)^2 = (2a)^2 + 2\cdot(2a)\cdot(5b) + (5b)^2 = 4a^2 + 20ab + 25b^2.

Each outer term is squared in full, (2a)2=4a2(2a)^2 = 4a^2 and (5b)2=25b2(5b)^2 = 25b^2, and the middle term 20ab20ab is twice their product.

Check your understanding

Expand (3x−5)2(3x - 5)^2.

Answer choices

Reading the pattern backward: perfect-square trinomials

Every identity in algebra can be read in both directions. Read forward, a2+2ab+b2a^2 + 2ab + b^2 is what you get by squaring a+ba + b. Read backward, it tells you that any trinomial of that exact shape factors as a single square:

a2+2ab+b2=(a+b)2anda2−2ab+b2=(a−b)2.a^2 + 2ab + b^2 = (a + b)^2 \qquad \text{and} \qquad a^2 - 2ab + b^2 = (a - b)^2.

A trinomial that factors this way is called a perfect-square trinomial, and recognizing one lets you factor it instantly, with no searching through factor pairs. As in every example in this lesson, look for terms with whole-number coefficients, not any real number. Here is what to look for, worked through on one trinomial before the rule is stated in general.

Worked example 4 Factor 9x2−12x+49x^2 - 12x + 4

Test the two outer terms first. The first term 9x29x^2 is the square of 3x3x, since (3x)2=9x2(3x)^2 = 9x^2, and the last term 44 is the square of 22, since 22=42^2 = 4. Call these two terms A=3xA = 3x and B=2B = 2.

Now the middle term decides everything. For a perfect square it must be twice the product of AA and BB:

2AB=2⋅(3x)⋅2=12x.2AB = 2\cdot(3x)\cdot 2 = 12x.

The actual middle term is −12x-12x, which is −2AB-2AB, so the sign is negative and the trinomial fits the difference pattern:

9x2−12x+4=(3x−2)2.9x^2 - 12x + 4 = (3x - 2)^2.

Expanding (3x−2)2(3x - 2)^2 back to 9x2−12x+49x^2 - 12x + 4 confirms the factorization.

That example passed a short test with three parts, and every perfect-square trinomial passes the same one. The first term must be the square of some whole-number term AA. The last term must be the square of some whole-number term BB. And the middle term must equal 2AB2AB, up to its sign: positive gives (A+B)2(A + B)^2, negative gives (A−B)2(A - B)^2. If the middle term does not match 2AB2AB, or if there is no middle term at all, the trinomial is not a perfect square this way. (Sticking to whole-number coefficients is what keeps AA and BB easy to spot by inspection.)

Worked example 5 Which trinomials are perfect squares?

Run each one through the same three conditions: the first term is the square of some term, the last term is the square of some term, and the middle term equals twice the product of those two terms.

For 16x2+24x+916x^2 + 24x + 9, the outer terms are squares, since (4x)2=16x2(4x)^2 = 16x^2 and 32=93^2 = 9, and twice their product is 2⋅4x⋅3=24x2\cdot 4x\cdot 3 = 24x, which matches the middle term. So it is a perfect square:

16x2+24x+9=(4x+3)2.16x^2 + 24x + 9 = (4x + 3)^2.

For 4x2+94x^2 + 9, the outer terms are still squares, (2x)2=4x2(2x)^2 = 4x^2 and 32=93^2 = 9, but there is no middle term at all. A perfect square would need a middle term of 2⋅2x⋅3=12x2\cdot 2x\cdot 3 = 12x, so without it this is not a perfect-square trinomial.

For x2+10x+20x^2 + 10x + 20, the first term is a square, (x)2=x2(x)^2 = x^2. But no whole number squares to give 2020, so the last term is not a perfect square. The pattern needs both outer terms to be perfect squares, so this trinomial does not fit either. Only the first of the three passes.

Before running the test, make sure the trinomial is in lowest terms: if every coefficient shares a common whole-number factor, pull that factor out first, the same way you would before any other factoring, and then run the test on what remains.

Worked example 6 Factor 3x2+18x+273x^2 + 18x + 27

Before testing anything, check for a common numerical factor. Here 33, 1818, and 2727 are all multiples of 33, so pull it out first:

3x2+18x+27=3(x2+6x+9).3x^2 + 18x + 27 = 3\left(x^2 + 6x + 9\right).

Now run the three-part test on what is left inside the parentheses. The outer terms are squares, (x)2=x2(x)^2 = x^2 and 32=93^2 = 9, and twice their product is 2⋅x⋅3=6x2\cdot x\cdot 3 = 6x, which matches the middle term with a positive sign:

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

The factor of 33 pulled out at the start does not disappear. It stays in front of the answer:

3x2+18x+27=3(x+3)2.3x^2 + 18x + 27 = 3(x + 3)^2.

Testing the original coefficients 33, 1818, 2727 directly against the pattern would fail, even though the trinomial is a perfect square once the common factor is removed.

Check your understanding

Factor 2x2+20x+502x^2 + 20x + 50 completely.

Answer choices

Common mistakes

Practice

Multiple Choice Questions (MCQ)

Progressively harder sets of questions. Each opens on its own page.

Core practice

Practice problems at the level of the course, to be worked out on paper. Hints one at a time, then the answer or the full worked solution, with your progress kept in this browser.

Core practice Work it out on paper 10 problems Start →
More practice (optional)

Extra sets, as hard as the Challenge set. Each one opens on its own page.

More resources (optional)

Other explanations of this lesson, if you want a second take.

A bit of history (optional)

Before calculators, multiplying two large numbers by hand was slow and easy to botch. Squaring one was kinder. There was only a single number to carry through the work. So people asked a strange question. Could one table of squares be made to do all the multiplying?

It could, and this lesson holds the reason. Square a sum, square a difference, and subtract the second result from the first. The outer squares cancel each other. All that survives is the two middle terms. Together they come to four times the product of the original numbers.

In 18171817 a French table-maker named Antoine Voisin published a book of quarter squares. A square number is exactly divisible by four only when the number squared is even; square an odd number and the true quarter always ends in the same leftover 0.250.25. Voisin’s table stored just the whole-number part, so every entry it held was really one quarter of a square, rounded down. To multiply two numbers, a clerk added them and looked the total up, then subtracted them and looked that difference up. A sum and a difference of the same two numbers are always both even or both odd, so the two lookups discarded the very same leftover quarter, and it canceled away when one entry was taken from the other. The result was still the exact product, and nothing was ever multiplied by hand. New quarter-square tables built on the same idea kept being published for over a century, and the same shortcut was eventually built into electronic multipliers.

So the middle term is not a nuisance to be remembered. It is the only part of the pattern that knows anything about the product. Each outer square depends on one of the numbers alone. Drop it, and you throw away the piece the whole trick rests on.