# Thread: double summation question

1. ## double summation question

In the above pic xbar is a constant and so can come outside the summation and the second expression in the first line is equal to zero so the second line is just a rearrangement of $\sum u_i x_i \sum u_i$

I can't figure out how we get from $\sum u_i x_i \sum u_i$ to the $\sum ui^2x_i$ plus the double summation of i and i not equal to j of $u_iu_jx_j$

2. ## Re: double summation question

Hey kingsolomonsgrave.

You should try doing a quick expansion of the product. You will find that you can group the terms where both summands have the same index (i = j) and you will have a different expression where i != j.

As an example consider n = 2. You have

sigma (UiXi) * sigma(Ui) [1 to 2] = (U1X1 + U2X2)(U1 + U2)
= [U1^2X1 + U2^2X2] + [U1U2X1 + U1U2X2]
= sigma [1 to 2] (Ui^2*Xi) + sigma [i != j] [1 to 2] [1 to n] Ui*Uj*Xj

Use that pattern to show it for the general case of n > 1.