# How do you write an equation for the terms in an answer for a squared polynomial with x terms?

## For example ${\left(a + b\right)}^{2} = {a}^{2} + 2 a b + {b}^{2}$ the polynomial has two terms, the squared answer has 3 terms along with the pattern ${\left(a + b + c\right)}^{2} = {a}^{2} + {b}^{2} + {c}^{2} + 2 a b + 2 a c + 2 c b$ the polynomial has three terms and the squared answer has 6. and the pattern keeps going. How do I write an equation to show if x terms in polynomial then y terms in answer? so ${\left(a + b + c + d \ldots \ldots .\right)}^{2} = x$number of terms

Oct 20, 2017

$\frac{1}{2} \left({n}^{2} + n\right)$

#### Explanation:

$\left({\overbrace{{a}_{1} + {a}_{2} + \ldots + {a}_{n}}}^{\text{n terms")^2 = overbrace(a_1^2+a_2^2+...+a_n^2)^"n terms"+overbrace(2a_1a_2+2a_1a_3+...+2a_(n-1)a_n)^(""^nC_2 = 1/2(n^2-n) "terms}}\right)$

The total number of terms on the right hand side is:

$n + \frac{1}{2} \left({n}^{2} - n\right) = \frac{1}{2} \left({n}^{2} + n\right)$

Essentially the number of terms on the right hand side is ${n}^{2}$ counting multiplicity - that is, if you count each of the terms of the form $2 {a}_{j} {a}_{k}$ twice. Since we don't want to do that, we have to subtract $\frac{1}{2} \left({n}^{2} - n\right)$ from ${n}^{2}$ to get $\frac{1}{2} \left({n}^{2} + n\right)$.