Square of a sum (a + b)²

Enter a and b. The result is (a + b)² using the binomial identity a² + 2ab + b². For a = 3 and b = 4 the value is 49. The diagram shows the area of a square of side a + b. This page does not compute (a − b)² or symbolic expansions with letters instead of numbers.

Input

Summands

Result

Enter a and b. (a + b)² and the pieces a², 2ab, and b² appear here.

(a − b)² and the difference of squares a² − b² live on neighboring pages. One-number powers: power calculator.

How it works

How (3 + 4)² is computed
a²9
2ab24
b²16
(a+b)²49

The square of a sum is the algebraic identity (a + b)² = a² + 2ab + b². It holds for every pair of real numbers a and b. The calculator uses the numbers you enter in fields a and b and computes three pieces: a·a, 2·a·b, and b·b, then adds them. For a = 3 and b = 4 you get 9 + 24 + 16 = 49 — the same as 7².

The algebraic derivation starts from the definition of a square: (a + b)² = (a + b)(a + b). Distributing each factor of the first parenthesis over the second gives a·a + a·b + b·a + b·b. Because multiplication of real numbers is commutative, ab = ba, so the middle two terms become 2ab. In US classrooms the same expansion is often taught as FOIL (First, Outer, Inner, Last).

Geometric reading (for a ≥ 0, b ≥ 0): a square of side a + b has area (a + b)². After splitting each side into segments a and b you get four rectangles: square a×a, square b×b, and two rectangles a×b. Their areas sum to a² + 2ab + b². That picture belongs to classical Euclidean geometry (Elements, Book II — square identities).

Related identities: (a − b)² = a² − 2ab + b² (minus in the middle) and a² − b² = (a − b)(a + b) (difference of squares, a product). Neither is this calculator. A power with exponent 2 raises one number; here you always have two fields.

Worked examples on this page: 3 and 4 → 49; 2 and 2 → 16; 1 and 0 → 1; −1 and 4 → 9; 5 and 3 → 64; 0.5 and 1.5 → 4; 10 and 1 → 121; 4 and 3 → 49. The panel shows a², 2ab, b², the sum a + b, and a check (a + b)² beside the expansion.

Formula

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

Symbol a is the first summand (field a). Symbol b is the second (field b). The left side is the square of the sum; the right side is the expansion: first squared, twice the product, second squared.

Mathematical model: square of a binomial / square of a sum (degree-2 binomial identity), with the geometric counterpart in Euclid’s Elements, Book II.

Theory, FOIL, and geometry

Definition

The square of a sum of two real numbers a and b is the algebraic identity (a + b)² = a² + 2ab + b². The left-hand side is the square of a binomial; the right-hand side expands the product (a + b)(a + b) by distributivity. This calculator evaluates both sides and shows the terms a², 2ab, b² together with a geometric reading: the area of a square of side a + b split into a×a, b×b, and two a×b rectangles.

The identity belongs to the compact multiplication formulas (alongside (a − b)² and a² − b²). It holds in every commutative ring, in particular in ℝ and ℂ. MathWorld (Perfect Square) and classical elementary-algebra texts give the same expansion.

In classroom practice it helps to separate the mathematical formula from floating-point limits: this calculator reports the browser’s floating-point computation (about 15–16 significant digits), not a symbolic identity on paper. When inputs are extreme, check the domain first, then the floating-point range.

Historical and conceptual context

Geometric “completing the square” was known in Babylonian mathematics and in Euclid (Elements II). Symbolic algebra of the sixteenth–seventeenth centuries (Viète, Descartes) wrote it as (a + b)². The formula is a step toward solving quadratics by completing the square.

Conceptually the calculator does not solve equations — it only evaluates the identity for given a, b. Do not confuse it with (a + b²) or a + b²; the parentheses enclose the whole sum before squaring.

In classroom practice it helps to separate the mathematical formula from floating-point limits: this calculator reports the browser’s floating-point computation (about 15–16 significant digits), not a symbolic identity on paper. When inputs are extreme, check the domain first, then the floating-point range.

Formal properties

Domain: a, b ∈ ℝ (or ℂ). Identity: (a + b)² − a² − 2ab − b² = 0. Variants: (a − b)² = a² − 2ab + b²; a² − b² = (a − b)(a + b).

Homogeneity: scaling a ↦ λa, b ↦ λb multiplies both sides by λ². Symmetry: swapping a ↔ b leaves the result unchanged. For b = 0 it reduces to a².

In an inner-product space ||u + v||² = ||u||² + 2⟨u,v⟩ + ||v||² — the same pattern in Euclidean geometry.

In classroom practice it helps to separate the mathematical formula from floating-point limits: this calculator reports the browser’s floating-point computation (about 15–16 significant digits), not a symbolic identity on paper. When inputs are extreme, check the domain first, then the floating-point range.

Full derivation

Step 1. (a + b)² := (a + b)(a + b).

Step 2. Distributivity: a·a + a·b + b·a + b·b = a² + ab + ba + b².

Step 3. Commutativity of multiplication: ab = ba, so ab + ba = 2ab. Hence (a + b)² = a² + 2ab + b².

Step 4 (geometry). A square of side a + b (for a, b > 0) splits into an a×a square, a b×b square, and two a×b rectangles — summing areas recovers the right-hand side (Euclid II.4).

In classroom practice it helps to separate the mathematical formula from floating-point limits: this calculator reports the browser’s floating-point computation (about 15–16 significant digits), not a symbolic identity on paper. When inputs are extreme, check the domain first, then the floating-point range.

Special cases

Examples: (3 + 4)² = 49 = 9 + 24 + 16; (5 + (−2))² = 9 = 25 − 20 + 4; (1.5 + 0.5)² = 4. When a = b: (2a)² = 4a² = a² + 2a² + a².

For a = −b: (a + b)² = 0, and the right-hand side a² − 2a² + a² = 0. Negative side lengths in the diagram are read algebraically (signed areas), not as physical lengths.

In classroom practice it helps to separate the mathematical formula from floating-point limits: this calculator reports the browser’s floating-point computation (about 15–16 significant digits), not a symbolic identity on paper. When inputs are extreme, check the domain first, then the floating-point range.

Numerical and computational notes

The calculator computes left = (a + b) * (a + b) and right = a·a + 2·a·b + b·b in floating-point arithmetic and compares them. Extreme |a|, |b| may overflow. Comma and period are equivalent.

The calculator does not expand (a + b + c)² — only two summands.

In classroom practice it helps to separate the mathematical formula from floating-point limits: this calculator reports the browser’s floating-point computation (about 15–16 significant digits), not a symbolic identity on paper. When inputs are extreme, check the domain first, then the floating-point range.

Related concepts and authorities

Related: maximum of two numbers, linear interpolation (different geometry), the exponential (non-algebraic). The companion school identities are (a − b)² and the difference of squares.

Authorities: Euclid, Elements II; elementary algebra texts; MathWorld — Perfect Square Binomial; Wikipedia — Polynomial identities. Educational tool.

In classroom practice it helps to separate the mathematical formula from floating-point limits: this calculator reports the browser’s floating-point computation (about 15–16 significant digits), not a symbolic identity on paper. When inputs are extreme, check the domain first, then the floating-point range.

How to use

  1. Enter a, for example 3.
  2. Enter b, for example 4. Use a comma or a dot for decimals.
  3. Click Calculate or wait for the live result. 3 and 4 give 49.
  4. Check the panel: (a + b)², a², 2ab, b², a + b, the check, and the area diagram.
  5. Use the neighboring pages for (a − b)² and for a² − b².

Symbol glossary

(a + b)² = a² + 2ab + b². For a = 3 and b = 4 the result is 49. Domain: ℝ.

a
First term. Field “a”. With 3 and 4: a² = 9.
b
Second term. Field “b”. With 3 and 4: b² = 16.
2ab
Twice the product. With 3 and 4: 24. Geometrically two ab rectangles.
(a+b)²
Primary result. 3 and 4 → 49. 2 and 2 → 16. 1 and 0 → 1.

Examples

Example 1

  • a = 3
  • b = 4

49

What is (3 + 4)²? 49 (= 7²).

Example 2

  • a = 2
  • b = 2

16

What is (2 + 2)²? 16.

Example 3

  • a = 1
  • b = 0

1

What is (1 + 0)²? 1.

Example 4

  • a = −1
  • b = 4

9

What is (−1 + 4)²? 9.

Example 5

  • a = 5
  • b = 3

64

What is (5 + 3)²? 64 (= 8²).

Example 6

  • a = 0.5
  • b = 1.5

4

What is (0.5 + 1.5)²? 4.

Example 7

  • a = 10
  • b = 1

121

What is (10 + 1)²? 121 (= 11²).

Example 8

  • a = 4
  • b = 3

49

What is (4 + 3)²? 49 (same as 3 and 4).

Related calculators

Common questions

What is (3 + 4)²?

49. Expansion: 3² + 2·3·4 + 4² = 9 + 24 + 16 = 49. That is the same as 7².

What does the square-of-a-sum identity mean?

(a + b)² = a² + 2ab + b². It is an algebraic identity: the square of a sum of two real numbers equals the sum of their squares and twice their product.

How do you derive (a + b)² from multiplication?

(a + b)² means (a + b)(a + b). Expanding gives a·a + a·b + b·a + b·b = a² + ab + ba + b². Because ab = ba, the middle terms become 2ab.

What is the geometric reading?

For a ≥ 0 and b ≥ 0, the area of a square of side a + b splits into a square a², a square b², and two rectangles of area ab each. Those four areas sum to a² + 2ab + b². The picture appears in Euclid’s Elements, Book II.

How does this differ from (a − b)² and from a² − b²?

(a − b)² = a² − 2ab + b² — the middle term has a minus. The difference of squares a² − b² = (a − b)(a + b) is a product, not the square of a sum. Neighboring calculators cover those other identities.

Does the order of a and b change the result?

No. 3 and 4 and 4 and 3 both give 49, because addition and 2ab are commutative.

Is a negative a allowed?

Yes. The domain is ℝ. For a = −1 and b = 4 the result is (−1 + 4)² = 9. With negatives the area diagram is only a sketch using |a| and |b|; the algebraic result stays correct.

What do 2 and 2 give, and what about 1 and 0?

2 and 2 give 16, because 4 + 8 + 4. 1 and 0 give 1, because only a² remains.

What is FOIL for the square of a sum?

FOIL stands for First–Outer–Inner–Last when multiplying two binomials. For (a + b)(a + b) it produces a², ab, ba, and b² — exactly a² + 2ab + b².

Is this the same as the power calculator?

No. A power calculator raises one number to an exponent. Here you always have two terms a and b and the expansion a² + 2ab + b². You may check the result as (a + b)², but the fields and diagram belong to this binomial identity.

How do I calculate (a + b)²?

Use (a + b)² = a² + 2ab + b². For a = 3 and b = 4: 9 + 24 + 16 = 49. Equivalently add a + b first, then square the sum.

What is (5 + 3)²?

64. Expansion: 25 + 30 + 9 = 64, which is 8². That is Example 5 on this page.

Does (a + b)² equal a² + b²?

No. The middle term 2ab is missing. For 3 and 4: a² + b² = 25, while the correct result is 49. Dropping 2ab is a common mistake.

Does the calculator compute the square of a difference (a − b)²?

No. This page is only the square of a sum. (a − b)² = a² − 2ab + b² belongs on a related page, or enter a negative b into the same sum identity.

What is (10 + 1)²?

121. Expansion: 100 + 20 + 1. That is a quick 11² and Example 7 on this page.

For a = 3 and b = 4, (a + b)² = 49 because 9 + 24 + 16. Checking 7² gives the same number. Difference of squares is on the neighboring page.

Knowledge sources

The identity, FOIL expansion, and geometric note below come from standard references.

Page Updated November 2, 2026.