In short
Yes, the pattern keeps going. For any number of terms,
that is, n pure squares plus twice every distinct pair product. For n=2 you get 1 + 2(1) = 3 terms (one cross-pair). For n=3 you get 3 + 2(3) = 9 terms in the grid, collapsing to 6 distinct contributions. For n=4 you get 4 squares plus \binom{4}{2} = 6 pair products that each appear twice — 4 + 12 = 16 pieces in total. Why each pair appears twice: in the multiplication grid, a \cdot b sits in row a column b AND b \cdot a sits in row b column a. Two physical cells, same product.
You have just learnt that (a+b+c)^2 = a^2 + b^2 + c^2 + 2ab + 2bc + 2ca and your teacher said it was a special identity worth memorising. Then a question pops into your head while you are riding home in the auto: what about four terms? Five? A hundred? Is there a separate identity for each one, or is there a single rule that handles them all?
There is one rule. And once you see it, you will never need to memorise another "(\text{sum of four})^2" formula again — you will read it straight off a grid in your head.
The rule, stated cleanly
For any n real numbers x_1, x_2, \ldots, x_n:
Two parts. The first is the sum of every term squared individually — that gives you n contributions. The second is twice the sum of every product of two distinct terms — and the number of such distinct pairs is \binom{n}{2} = \dfrac{n(n-1)}{2}.
Total number of pieces in the expanded multiplication grid is n^2 — because you are multiplying an n-term sum by itself, so every term in the left bracket pairs with every term in the right bracket. Of those n^2 products, n sit on the main diagonal (the x_i \cdot x_i ones, giving x_i^2), and the remaining n^2 - n = n(n-1) are off-diagonal, pairing up into \dfrac{n(n-1)}{2} = \binom{n}{2} matching twins.
Why each pair appears exactly twice: when you write out (x_1 + \cdots + x_n)(x_1 + \cdots + x_n) as a multiplication table, the cell at row i column j holds x_i \cdot x_j and the cell at row j column i holds x_j \cdot x_i. These are two separate cells of the table — they look symmetric across the diagonal — and ordinary multiplication is commutative, so both cells store the same value x_i x_j. Collecting like terms means adding those two cells together, which gives 2 x_i x_j.
The 4x4 grid for (a+b+c+d)^2
Picture a square of side a + b + c + d. Mark off lengths a, b, c, d along the top edge, and the same down the left edge. Now extend each mark across the square — three horizontal cuts and three vertical cuts — and the big square breaks into a 4 \times 4 grid of 16 rectangles. Four sit on the diagonal; the other twelve come in matching pairs of identical area.
Worked examples
Example 1 — Full expansion of $(a+b+c+d)^2$
Read the grid row-by-row and write down all 16 products, then collect like terms.
Diagonal squares (4 pieces): a^2, b^2, c^2, d^2.
Off-diagonal pairs (12 pieces, 6 distinct products each appearing twice):
- \{a,b\}: row a col b gives ab, row b col a also gives ab → total 2ab.
- \{a,c\}: ac + ac = 2ac.
- \{a,d\}: ad + ad = 2ad.
- \{b,c\}: bc + bc = 2bc.
- \{b,d\}: bd + bd = 2bd.
- \{c,d\}: cd + cd = 2cd.
Why each pair gets a 2: multiplication is commutative, so a \cdot b and b \cdot a are the same number — but they sit in different cells of the multiplication grid, one above the diagonal and one below. Collecting like terms adds the two equal contributions, producing 2ab.
Add it all up:
Ten distinct terms. Sixteen pieces. The grid never lies.
Example 2 — Numerical sanity check with $(1+2+3+4)^2$
You know 1+2+3+4 = 10, so (1+2+3+4)^2 = 100. The identity must produce the same number, otherwise something is wrong.
Sum of squares: 1^2 + 2^2 + 3^2 + 4^2 = 1 + 4 + 9 + 16 = 30.
Cross-products (six distinct pairs, each doubled):
| pair | product | doubled |
|---|---|---|
| 1, 2 | 2 | 4 |
| 1, 3 | 3 | 6 |
| 1, 4 | 4 | 8 |
| 2, 3 | 6 | 12 |
| 2, 4 | 8 | 16 |
| 3, 4 | 12 | 24 |
Sum of the doubled column: 4 + 6 + 8 + 12 + 16 + 24 = 70.
Grand total: 30 + 70 = 100. Why this had to work: the identity is an algebraic equation that holds for every choice of values, so plugging in 1, 2, 3, 4 must reproduce the squared sum exactly. Any mismatch would mean an arithmetic slip somewhere.
Notice how the cross-terms (70) dominate the squares (30) — more than two-thirds of the total. This is the same lesson as the three-variable case: when you have several positive numbers in a sum, most of the squared sum lives in the cross-products, not in the individual squares. Forgetting the 2 \sum x_i x_j part means losing the bulk of the answer.
Example 3 — Five variables: $(a+b+c+d+e)^2$
Now n=5. Apply the rule.
Pure squares: a^2, b^2, c^2, d^2, e^2 — that is 5 pieces.
Distinct unordered pairs: \binom{5}{2} = \dfrac{5 \times 4}{2} = 10 pairs, namely \{a,b\}, \{a,c\}, \{a,d\}, \{a,e\}, \{b,c\}, \{b,d\}, \{b,e\}, \{c,d\}, \{c,e\}, \{d,e\}. Each contributes 2 \times (\text{product}), so the off-diagonal block has 2 \times 10 = 20 pieces.
Total piece count: 5 + 20 = 25 = 5^2. Why n^2: the multiplication grid for an n-term sum has n rows and n columns, so it always contains exactly n^2 cells. Of those, n are diagonal and n^2 - n are off-diagonal, splitting into \binom{n}{2} matching pairs.
So:
You did not need to memorise a "5-variable identity". You computed it from the rule. The same procedure will give you (x_1 + x_2 + \cdots + x_{100})^2 — that has 100 squares plus \binom{100}{2} = 4950 doubled cross-products, for 5050 distinct contributions and 10000 grid cells.
Where this rule shows up beyond algebra
This is not just a pretty pattern — it is a workhorse identity in three different parts of higher mathematics, and you will meet it again and again.
Variance in statistics. When you compute the variance of a list of numbers, you square the sum of deviations from the mean. The expansion uses exactly this rule: the variance formula \sigma^2 = \dfrac{1}{n} \sum (x_i - \bar{x})^2 expands into a sum of squares plus cross-terms, and recognising the structure lets you derive shortcut formulas like \sigma^2 = \overline{x^2} - \bar{x}^2.
Dot products in vector algebra. For a vector \mathbf{v} = (x_1, x_2, \ldots, x_n), the squared length is \mathbf{v} \cdot \mathbf{v} = x_1^2 + x_2^2 + \cdots + x_n^2 — only the diagonal squares, because the dot product takes matching components. But the squared sum of components, (x_1 + x_2 + \cdots + x_n)^2, includes all the cross-terms too. The difference between "squared length" and "squared sum of components" is precisely 2 \sum_{i<j} x_i x_j — the off-diagonal block of our grid.
Sums-of-squares decomposition. In number theory and competitive mathematics, you often want to write a number as a sum of squares — Fermat's theorem on sums of two squares, Lagrange's four-square theorem, and so on. The identity (x_1 + \cdots + x_n)^2 - 2\sum_{i<j} x_i x_j = \sum x_i^2 is the algebraic bridge between the squared sum (which is easy to compute when you know the total) and the sum of squares (which is what you actually want).
In all three settings the same dissection picture explains what is going on — the diagonal of a grid versus the off-diagonal pairs.
The general rule, in one sentence
If you ever forget the formula for (x_1 + x_2 + \cdots + x_n)^2, just remember: write the n \times n multiplication table of the sum with itself, take the n diagonal entries as pure squares, take the \binom{n}{2} off-diagonal pairs as doubled cross-products, and add. That sentence covers every case from n = 2 to n = a million.
References
- Wikipedia: Multinomial theorem — the full generalisation (x_1 + \cdots + x_n)^k for any power k, of which our k=2 rule is the simplest case.
- Wikipedia: Polarization identity — the same diagonal-vs-off-diagonal split applied to inner products of vectors.
- NCERT Class 9 Mathematics, Chapter 2: Polynomials — introduces the three-variable case with an area diagram, the direct ancestor of our 4 \times 4 grid.
- Art of Problem Solving: Symmetric sums — how the cross-term pattern \sum_{i<j} x_i x_j generalises to higher symmetric polynomials of the variables.
- Cut the Knot: Visual proofs of algebraic identities — small gallery of dissection-based proofs, including the multi-variable square identity.