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, keeping a plus sign before the last square
  • 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

Squaring means multiplying a quantity by itself: (a+b)2=(a+b)(a+b)(a + b)^2 = (a + b)(a + b). Picture a square with side a+ba + b. Split each side into lengths aa and bb, then cut across at those points. The four pieces have areas a2a^2, abab, abab, and b2b^2. The two matching rectangles contribute 2ab2ab together.

For example, with a=3a = 3 and b=4b = 4, the areas add to 9+12+12+16=499 + 12 + 12 + 16 = 49, the area of a square of side 77. The picture needs positive lengths. The algebra below works for all real aa and bb, including zero and negative values.

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 where the middle term comes from. Multiplying the binomial by itself gives the same result:

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

First use 33 and 44: (3+4)(3+4)=9+12+12+16=49(3+4)(3+4)=9+12+12+16=49. The two middle products both equal 1212. Now multiply each term of the first factor by each term of the second for any real aa and bb:

(a+b)(a+b)=a(a+b)+b(a+b)=a2+ab+ba+b2.\begin{aligned} (a + b)(a + b) &= a(a + b) + b(a + b) \\ &= a^2 + ab + ba + b^2. \end{aligned}

The middle products abab and baba are equal because multiplication can be done in either order. Combining them gives

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

The formula includes both outer squares and both cross-products, the middle products abab and baba. Those two equal products are the reason for 2ab2ab.

Squaring a difference

For a difference, the signs change but we still multiply every term.

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

For example, (5−2)2=25−10−10+4=9(5-2)^2=25-10-10+4=9. The two cross-products are subtracted; the final square is added.

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−b)−b(a−b)=a2−ab−ba+b2.\begin{aligned} (a - b)(a - b) &= a(a - b) - b(a - b) \\ &= a^2 - ab - ba + b^2. \end{aligned}

The first product is a2a^2. The last is (−b)(−b)=b2(-b)(-b) = b^2, since the two minus signs cancel. The middle products −ab-ab and −ba-ba combine into −2ab-2ab:

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

Compared with the sum formula, only the sign before 2ab2ab changes. The last term is still +b2+b^2. Here the minus in −2ab-2ab tells us to subtract 2ab2ab; it does not say the value is negative for every choice of aa and bb.

In either pattern, square both terms and double their product. Add that doubled product for a sum; subtract it for 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 the middle term is now subtracted:

(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

A common mistake is to square each piece and stop, writing (a+b)2=a2+b2(a + b)^2 = a^2 + b^2. The area example shows what this loses:

(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

The terms can include coefficients. Square the whole term: (2x)2=22x2=4x2(2x)^2 = 2^2x^2 = 4x^2, not 2x22x^2. Then double the product of the two whole terms to find the middle term.

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. The rest of the pattern is the same: treat 2x2x as one whole term, the way you treated a bare xx 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 a perfect-square trinomial. Recognizing the pattern saves a search through factor pairs. For recognition here, look for terms with integer coefficients, such as 3x3x and 22. The identities themselves hold for all real values of the variables.

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 check the middle term. 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.

So the test has three parts. Find a term AA with integer coefficients whose square is the first term, find a term BB with integer coefficients whose square is the last term, then check the middle term. If it is +2AB+2AB, use (A+B)2(A + B)^2; if it is −2AB-2AB, use (A−B)2(A - B)^2. Even when both outer terms are squares, the middle term has to match.

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, matching the middle term 10x10x would require (x+5)2(x+5)^2. But its last term is 2525, not 2020, so this trinomial does not fit either. Only the first of the three passes.

As with other factoring methods, first pull out any common factor. Then check the trinomial that 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.

Keep the factor of 33 you pulled out at the start in front of the answer:

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

The original coefficients 33, 1818, 2727 do not give an integer-coefficient binomial square. After removing the common factor, the remaining trinomial does.

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, a table could save a clerk pages of arithmetic. Could a table of squares help with multiplication too?

It could, because of the two formulas in this lesson. Square a sum, square a difference, and subtract the second result from the first. The outer squares cancel each other, and only the two middle terms are left. Together they come to four times the product of the original numbers.

In 18171817, Antoine Voisin published a table of quarter squares to help people multiply. For each whole number listed in the table, it stored one quarter of its square, rounded down. A clerk could look up the sum of two positive whole numbers, then their nonnegative difference, and subtract the two entries to get their product.

Why did rounding not spoil the answer? The sum and difference are either both even or both odd. For even numbers, dividing their squares by 44 leaves no remainder. For odd numbers, both exact quarter squares end in 0.250.25. The table drops the same quarter from both, so subtraction cancels the loss. A reconstruction of Voisin’s table shows how this method turned multiplication into two lookups and a subtraction. Later quarter-square tables and electronic multipliers used the same identity.

Your progress

See all your progress →