(a + b)² Formula — a²+2ab+b², Proof, Examples

#Math Formula
TL;DR
The a plus b whole square formula is (a+b)2=a2+2ab+b2(a + b)^2 = a^2 + 2ab + b^2 — the square of a binomial expands to the two squares plus twice their product. This article gives the formula, both an algebraic and a geometric (area) proof of where the 2ab2ab comes from, six worked examples, the sharp difference between (a+b)2(a+b)^2 and a2+b2a^2+b^2, and the mistakes that cost the most marks.
BT
Bhanzu TeamLast updated on June 22, 20268 min read

What Is the (a + b)² Formula?

The a plus b whole square formula expands the square of a binomial (a+b)(a + b) into a trinomial. For any real (or even complex) numbers aa and bb:

(a+b)2=a2+2ab+b2.(a + b)^2 = a^2 + 2ab + b^2.

Each term has a name worth knowing:

  • a2a^2 — the first square term, the square of the first quantity.

  • 2ab2ab — the middle term (or cross term), twice the product of the two quantities.

  • b2b^2 — the second square term, the square of the second quantity.

The companion identity is (a−b)2=a2−2ab+b2(a - b)^2 = a^2 - 2ab + b^2 — same shape, with the middle term flipped to minus. The two are mirror images, and confusing them is a common slip.

How Is the (a + b)² Formula Derived?

Two proofs are worth seeing — one algebraic, one geometric. They explain the same fact from different directions, and together they make the 2ab2ab impossible to forget.

Algebraic proof — just multiply it out. A square means "times itself," so (a+b)2=(a+b)(a+b)(a + b)^2 = (a + b)(a + b). Expand using the distributive property (the same move as FOIL):

(a+b)(a+b)=a⋅a+a⋅b+b⋅a+b⋅b=a2+ab+ba+b2.(a + b)(a + b) = a\cdot a + a\cdot b + b\cdot a + b\cdot b = a^2 + ab + ba + b^2.

Since ab=baab = ba, the two middle terms combine:

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

The 2ab2ab is not an extra rule — it is the two cross-products abab and baba that the distribution always produces.

Geometric proof — the area of a square. Draw a square whose side is (a+b)(a + b). Its total area is (a+b)2(a + b)^2. Now cut it with one horizontal and one vertical line at the point that splits each side into a length aa and a length bb. The square falls into four pieces:

  • one a×aa \times a square, area a2a^2,

  • one b×bb \times b square, area b2b^2,

  • two a×ba \times b rectangles, area abab each, totaling 2ab2ab.

The pieces must add up to the whole:

(a+b)2=a2+2ab+b2.(a + b)^2 = a^2 + 2ab + b^2.

The two abab rectangles are the middle term. Once a student has seen the square cut into four pieces, the dropped-2ab2ab mistake tends to disappear — the term has a shape, not just a position in a formula.

How Is (a + b)² Different from a² + b²?

This is the distinction the whole topic turns on. They are not equal:

(a+b)2=a2+2ab+b2,a2+b2=(a+b)2−2ab.(a + b)^2 = a^2 + 2ab + b^2, \qquad a^2 + b^2 = (a + b)^2 - 2ab.

(a+b)2(a + b)^2 means "add first, then square." a2+b2a^2 + b^2 means "square each, then add." The gap between them is exactly 2ab2ab. A quick numeric check settles it: with a=3a = 3, b=4b = 4, (3+4)2=49(3 + 4)^2 = 49 but 32+42=253^2 + 4^2 = 25 — a difference of 24=2(3)(4)24 = 2(3)(4). The relationship a2+b2=(a+b)2−2aba^2 + b^2 = (a+b)^2 - 2ab is itself a useful tool — see our a² + b² formula page for how it solves problems where only the sum and product are known.

Examples of the (a + b)² Formula

Example 1

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

Apply the formula with a=xa = x, b=5b = 5:

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

Final answer: x2+10x+25x^2 + 10x + 25.

Example 2

Expand (3x+4)2(3x + 4)^2.

A tempting shortcut is to square each term and add — to write (3x)2+42=9x2+16(3x)^2 + 4^2 = 9x^2 + 16.

Wrong path. Writing (3x+4)2=9x2+16(3x + 4)^2 = 9x^2 + 16. Check it at x=1x = 1: the real value is (3+4)2=49(3 + 4)^2 = 49, but 9+16=259 + 16 = 25. The shortcut is off by 2424 — and 24=2(3)(4)24 = 2(3)(4), the exact middle term that was dropped. Squaring a sum is not the same as summing the squares.

The break. The error treats squaring as if it distributed over addition: (p+q)2≠p2+q2(p + q)^2 \neq p^2 + q^2. The distribution produces two cross-terms, and they don't vanish.

The rescue. Use the full formula with a=3xa = 3x, b=4b = 4:

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

Final answer: 9x2+24x+169x^2 + 24x + 16. (Check at x=1x = 1: 9+24+16=49=729 + 24 + 16 = 49 = 7^2. ✓)

Example 3

Use the formula to compute 52252^2 mentally.

Write 52=50+252 = 50 + 2 and apply the identity with a=50a = 50, b=2b = 2:

522=(50+2)2=502+2(50)(2)+22=2500+200+4=2704.52^2 = (50 + 2)^2 = 50^2 + 2(50)(2) + 2^2 = 2500 + 200 + 4 = 2704.

Final answer: 522=270452^2 = 2704 — no long multiplication needed.

Example 4

Expand (2x+3y)2(2x + 3y)^2.

With a=2xa = 2x, b=3yb = 3y:

(2x+3y)2=(2x)2+2(2x)(3y)+(3y)2=4x2+12xy+9y2.(2x + 3y)^2 = (2x)^2 + 2(2x)(3y) + (3y)^2 = 4x^2 + 12xy + 9y^2.

Final answer: 4x2+12xy+9y24x^2 + 12xy + 9y^2.

Example 5

Given a+b=7a + b = 7 and ab=10ab = 10, find a2+b2a^2 + b^2.

Rearrange the identity to isolate the sum of squares:

a2+b2=(a+b)2−2ab=72−2(10)=49−20=29.a^2 + b^2 = (a + b)^2 - 2ab = 7^2 - 2(10) = 49 - 20 = 29.

Final answer: a2+b2=29a^2 + b^2 = 29 — found without ever solving for aa or bb individually.

Example 6

Factor x2+14x+49x^2 + 14x + 49 back into a whole square.

Recognise the pattern a2+2ab+b2a^2 + 2ab + b^2. Here a2=x2a^2 = x^2 so a=xa = x; b2=49b^2 = 49 so b=7b = 7; and the middle term should be 2ab=2(x)(7)=14x2ab = 2(x)(7) = 14x — which matches. So it is a perfect square:

x2+14x+49=(x+7)2.x^2 + 14x + 49 = (x + 7)^2.

Final answer: (x+7)2(x + 7)^2. (The middle-term check is what confirms the factoring; without it, x2+14x+49x^2 + 14x + 49 might be mistaken for a non-square trinomial.)

Where the (a + b)² Formula Shows Up

This identity is one of the first algebraic tools that keeps paying off long after Class 8.

  • Completing the square. Solving any quadratic ax2+bx+c=0ax^2 + bx + c = 0 by completing the square rebuilds a perfect-square trinomial — running Example 6 in reverse. The quadratic formula itself is derived this way.

  • Mental arithmetic. Squaring numbers near a round figure (52252^2, 982=(100−2)298^2 = (100 - 2)^2) is instant with the identity, a trick rooted in Vedic mathematics and still taught for fast computation.

  • Statistics — variance. The shortcut formula for variance, Var(X)=E[X2]−(E[X])2\text{Var}(X) = E[X^2] - (E[X])^2, is a direct cousin of the a2+b2=(a+b)2−2aba^2 + b^2 = (a+b)^2 - 2ab rearrangement; the cross-term is what separates "mean of the squares" from "square of the mean."

  • Geometry and physics. Any area, energy, or distance expression involving a squared sum — kinetic-energy terms, the expansion of (u⃗+v⃗)⋅(u⃗+v⃗)(\vec{u} + \vec{v})\cdot(\vec{u} + \vec{v}) — carries the 2ab2ab cross term, which in vectors becomes the dot-product interaction term.

For Class 8 to Class 10 students, the immediate use is expansion and factoring — but completing the square and the variance shortcut mean this one identity reappears in algebra, calculus prep, and statistics.

Tripping Points to Avoid

Mistake 1: Dropping the middle term

Where it slips in: Writing (a+b)2=a2+b2(a + b)^2 = a^2 + b^2, treating squaring as if it distributed over addition.

Don't do this: Square each term separately and stop. The two cross-products ab+ba=2abab + ba = 2ab are part of the expansion, not optional.

The correct way: Always write all three terms, a2+2ab+b2a^2 + 2ab + b^2. In the McKinney TX Grade 8 cohort, this is the single most-repeated error on the first identities worksheet — it appears in close to half of first attempts, and it is the rusher archetype's signature: straight to "square both," no middle step.

Mistake 2: Confusing (a + b)² with (a − b)²

Where it slips in: Putting a minus on the middle term of a sum, or a plus on the middle term of a difference.

Don't do this: Assume the middle sign is always positive (or always negative). It tracks the sign inside the bracket.

The correct way: (a+b)2=a2+2ab+b2(a + b)^2 = a^2 + 2ab + b^2 (plus middle); (a−b)2=a2−2ab+b2(a - b)^2 = a^2 - 2ab + b^2 (minus middle). The first and last terms are positive either way — only the middle term carries the sign.

Mistake 3: Misreading the cross term when terms have coefficients

Where it slips in: Expanding (3x+4)2(3x + 4)^2 and writing the middle term as 2(3)(4)=242(3)(4) = 24 instead of 2(3x)(4)=24x2(3x)(4) = 24x — forgetting the variable.

Don't do this: Take 2ab2ab from the bare coefficients and lose the variable that belongs in aa.

The correct way: Treat the whole term as aa. For (3x+4)2(3x + 4)^2, a=3xa = 3x, so 2ab=2(3x)(4)=24x2ab = 2(3x)(4) = 24x. The second-guesser archetype gets the structure right, then "simplifies away" the variable because the all-numbers version felt cleaner.

Conclusion

  • The a plus b whole square formula is (a+b)2=a2+2ab+b2(a + b)^2 = a^2 + 2ab + b^2 — two squares plus twice the product.

  • The 2ab2ab middle term comes from the two cross-products of the distribution, shown geometrically as two equal rectangles in a square of side a+ba + b.

  • (a+b)2(a + b)^2 is not a2+b2a^2 + b^2; they differ by exactly 2ab2ab.

  • The most common errors are dropping the middle term, confusing it with (a−b)2(a - b)^2, and losing the variable in the cross term.

  • The identity powers completing the square, fast mental arithmetic, the variance shortcut, and vector dot-product expansions.

Practice These Before Moving On

  1. Expand (2x+7)2(2x + 7)^2.

  2. Compute 1032103^2 using the formula.

  3. Given a+b=9a + b = 9 and ab=14ab = 14, find a2+b2a^2 + b^2.

If Problem 1 gave you 4x2+494x^2 + 49, return to Mistake 1 — the 28x28x middle term is missing. For the related cube identities, see a³ + b³ formula.

Want a live Bhanzu trainer to walk your child through algebraic identities and the Class 8 polynomials chapter? Book a free demo class — online globally.

Was this article helpful?

Your feedback helps us write better content

Frequently Asked Questions

What is the a plus b whole square formula?
It is the algebraic identity (a+b)2=a2+2ab+b2(a + b)^2 = a^2 + 2ab + b^2 — the square of a binomial equals the sum of the squares plus twice the product.
Is (a + b)² the same as a² + b²?
No. (a+b)2=a2+2ab+b2(a + b)^2 = a^2 + 2ab + b^2, while a2+b2a^2 + b^2 is missing the 2ab2ab middle term. They differ by exactly 2ab2ab: a2+b2=(a+b)2−2aba^2 + b^2 = (a + b)^2 - 2ab.
Why is there a 2ab term?
Because (a+b)2=(a+b)(a+b)(a + b)^2 = (a + b)(a + b) produces two cross-products, abab and baba, which add to 2ab2ab. Geometrically, they are the two equal rectangles inside a square of side a+ba + b.
What is the difference between (a + b)² and (a − b)²?
Only the sign of the middle term. (a+b)2=a2+2ab+b2(a + b)^2 = a^2 + 2ab + b^2; (a−b)2=a2−2ab+b2(a - b)^2 = a^2 - 2ab + b^2. The squared terms stay positive in both.
How do I use the formula to square a number like 98?
Write 98=100−298 = 100 - 2 and use (a−b)2(a - b)^2: 982=1002−2(100)(2)+22=10000−400+4=960498^2 = 100^2 - 2(100)(2) + 2^2 = 10000 - 400 + 4 = 9604.
Can the formula extend to three terms?
Yes. (a+b+c)2=a2+b2+c2+2ab+2bc+2ca(a + b + c)^2 = a^2 + b^2 + c^2 + 2ab + 2bc + 2ca — every pair of terms contributes a cross-product, so three terms give three cross-terms.
✍️ Written By
BT
Bhanzu Team
Content Creator and Editor
Bhanzu’s editorial team, known as Team Bhanzu, is made up of experienced educators, curriculum experts, content strategists, and fact-checkers dedicated to making math simple and engaging for learners worldwide. Every article and resource is carefully researched, thoughtfully structured, and rigorously reviewed to ensure accuracy, clarity, and real-world relevance. We understand that building strong math foundations can raise questions for students and parents alike. That’s why Team Bhanzu focuses on delivering practical insights, concept-driven explanations, and trustworthy guidance-empowering learners to develop confidence, speed, and a lifelong love for mathematics.
Related Articles
Book a FREE Demo ClassBook Now →