# sum of pairs and sum of squares $\left(\sum x_i\right)^2-2\sum_{cyc}x_ix_j=\sum x_i^2$

I was messing around today and came across the following which I believe to be true: $$\left(\sum x_i\right)^2-2\sum_{cyc}x_ix_j=\sum x_i^2$$ for a set of $$x=(x_1,x_2,...x_n)$$ where $$n\ge2$$ and it is easy to prove for small values manually but how would I prove this rigourously? I thought about using the usual method of a base case, $$n=k$$ then $$n=k+1$$ but I am not quite sure how to do this?

$$n=2$$ $$\sum x_i=x+y,\sum_{cyc}x_ix_j=xy,\sum x_i^2=x^2+y^2$$ now: $$(x+y)^2-2xy=x^2+y^2$$ is easily shown. I have done the same for $$n=3$$ but how should I go about doing the general case?

• The sum $\sum x_ix_j$ has to be symmetric, otherwise it is not true, e.g $n=4$ fails. – Arben Ajredini May 30 '20 at 18:46
• @ArbenAjredini ah I see, what determines whether or not the sum is symmetricl? – Henry Lee May 30 '20 at 18:47
• The symmetric sum for $n=4$ would be $x_1x_2+x_1x_3+x_1x_4+x_2x_3+x_2x_4+x_3x_4$ and the cyclic sum is $x_1x_2+x_2x_3+x_3x_4+x_4x_1$ . – Arben Ajredini May 30 '20 at 18:52
• Ah so is there a different term I can use to describe the sum of all pairs where $i\ne j$? – Henry Lee May 30 '20 at 19:39
• You can use $\sum_{sym} x_ix_j$ – Arben Ajredini May 31 '20 at 14:36

## 1 Answer

If you expand $$(x_1 + \cdots + x_n)(x_1 + \cdots + x_n)$$ you get $$n^2$$ addends: $$x_1^2, \ldots, x_n^2$$, as well as two each of $$x_i x_j$$ for $$i \ne j$$. The cyclic sum accounts for some of these latter terms, but misses terms like $$x_1 x_3$$ or $$x_2 x_4$$.