Does anyone see how I could shorten the following formula $\sum_{j=1}^n \left( \sum_{i \neq j}^n (x_i-x_j) x_i\right)^2$?

68 Views Asked by At

Does anyone see how I could shorten the following formula

$$ \sum_{j=1}^n \left( \sum_{i \neq j}^n (x_i-x_j) x_i\right)^2$$

I'm hoping to get something involving the sum of squares formula.

1

There are 1 best solutions below

0
On

Let \begin{align} S_1&=\sum_{i=1}^n x_i\\ S_2&=\sum_{i=1}^n x_i^2\\ T&=\sum\limits_{i<j} x_i x_j \end{align} Then $$S_1^2=\left(\sum_{i=1}^n x_i\right)^2=S_2+2T$$ and \begin{align} \sum_{j=1}^n \left(\sum_{i=1}^n (x_i-x_j) x_i\right)^2 &= \sum_{j=1}^n \left(\sum_{i=1}^n x_i^2-x_j \sum_{i=1}^n x_i \right)^2\\ &= \sum_{j=1}^n \left(S_2-x_j S_1 \right)^2\\ &= \sum_{j=1}^n (S_2^2-2 S_1 S_2 x_j+ S_1^2x_j^2)\\ &= n S_2^2-2 S_1^2 S_2 +S_1^2 S_2\\ &= n S_2^2-S_1^2 S_2 \\ &= n S_2^2-(S_2+2T) S_2\\ &= (n-1) S_2^2-2T S_2 \end{align}