# Is $\sum_ix_iy_i=\sum_ix_i\sum_iy_i$?

I ask this because the equation for the center of mass of a system (made up of a number of small masses attached to each other) is given by:

$$\bar x=\frac{\sum_im_ix_i}{\sum_im_i}$$

If the operation in the question is valid then $\sum_ix_i$ would cancel and just leave $\sum_im_i$ which must be wrong. However, I don't know why the operation in the question is wrong. Can you explain?

• it should be $\bar x=\frac{\sum_im_ix_i}{\sum_im_i}$ – PepperSausage Feb 28 '15 at 21:12
• Check it with $x_i = y_i = 1$. $(1)(1) + (1)(1) = (1+1)(1+1)$? – Jair Taylor Feb 28 '15 at 21:13
• Thanks, I've changed it now. – RobChem Feb 28 '15 at 21:13
• Does $ab+cd=(a+c)(b+d)$? – whacka Feb 28 '15 at 21:14

$(x_1+x_2)(y_1+y_2) = x_1y_1+x_2y_2+x_1y_2+x_2y_1$: you have the "cross terms" $x_iy_j$ for $i\neq j$. This generalizes easily to $n$ instead of 2.

• Why can you factorize multiple integrals then, if this is the case? – RobChem Feb 28 '15 at 21:18
• The integrals have different variables -- the equivalent would be different indices for the summation. That is, the analogue of $\int\int dxdy f(x)g(y) = \left(\int dx f(x)\right) \left(\int dy g(y)\right)$ is $\sum_{i,j} x_i y_j = \left(\sum_i x_i\right)\left(\sum_j y_j\right)$, which is true. – Clement C. Feb 28 '15 at 21:18

Certainly not. This would imply, for instance that $x_1^2+x_2^2=(x_1+x_2)^2$.

• Why can you factorize multiple integrals then, if this is the case? – RobChem Feb 28 '15 at 21:15
• @RobChem You can factor $\iint f(x)g(y)dxdy$, not $\int f(x)g(x)dx$ – whacka Feb 28 '15 at 21:17
• This has nothing to do with Fubini's theorem. It's purely algebraic. – Bernard Feb 28 '15 at 21:19
• RobChem's comment was about factoring a double integral as a product of two integrals, not about interchanging them or making them one integral over a product space (as in Fubini's). And it is relevant: countable sums are special cases of integrals, just with the counting measure. – whacka Feb 28 '15 at 21:21
• Yes, but the indices in the sums are independent in the r.h.s., they are the same in the l.h.s. – Bernard Feb 28 '15 at 21:24

Suppose every $x_i = c$. Then

$$\sum x_i y_i = \sum cy_i = c\sum y_i \neq \sum c \sum y_i.$$

No, they are not the same. Let $x_1=\ldots=x_n=1$ and $y_=\ldots=y_n=1$.

Then $$\sum_{i=1}^nx_iy_1=\sum_{i=1}^n1=n$$ but $$\sum_{i=1}^nx_i\sum_{i=1}^ny_i=\sum_{i=1}^nx_i\sum_{i=1}^n1=\sum_{i=1}^nx_in=n\cdot n=n^2.$$

Clearly not, you can examine the correctness of the summation by putting some numbers in it.

$$\begin{array}{l}\sum\limits_i {{x_i}} {y_i}\left( {\begin{array}{*{20}{c}} = \\ \ne \end{array}} \right)\sum\limits_i {{x_i}} \sum\limits_i {{y_i}} \\{x_1} = 1,{x_2} = 2,{x_3} = 3;\\{y_1} = 4,{y_2} = 5,{y_3} = 6;\\\sum\limits_i {{x_i}} {y_i} = {x_1}{y_1} + {x_2}{y_2} + {x_3}{y_3} = 1 \times 4 + 2 \times 5 + 3 \times 6 = 32\\\left. {\begin{array}{*{20}{c}}{\sum\limits_i {{x_i}} = {x_1} + {x_2} + {x_3} = 1 + 2 + 3 = 6}\\{\sum\limits_i {{y_i}} = {y_1} + {y_2} + {y_3} = 4 + 5 + 6 = 15}\end{array}} \right| \Rightarrow \sum\limits_i {{x_i}} \sum\limits_i {{y_i}} = 90\\\left( {\sum\limits_i {{x_i}} {y_i} = 32} \right) \ne \left( {\sum\limits_i {{x_i}} \sum\limits_i {{y_i}} = 90} \right)\end{array}$$