Expansion of $\bigl(\sum x_i\bigr)^4$ Show that $$(\sum_{i=1}^n X_i)^4=\sum_{i=1}^n X_i^4+4\sum_{i\neq j}^n X_i^3X_j+3\sum_{i\neq j}^n X_i^2X_j^2+6\sum_{i\neq j\neq k}^n X_i^2X_jX_k+\sum_{i\neq j\neq k\neq l}^n X_iX_jX_kX_l$$ Please show it step by step.Thanks in advance.

When you raise a sum to the fourth power, you are trying to multiply that sum by itself four times (or is it three times?). Each term from the first copy will be multiplied by each term from the second copy, which in turn will be multiplied by each term from the third copy, and lastly by each term from the fourth.
So in the expanded and uncondensed product, every term will consist of a degree-four monomial. I suppose you might write $X_iX_jX_kX_\ell$. But what if all four indices are the same? You'd have $X_i^4$. And for any particular $i$ only one of the degree-four monomials will be that $X_i^4$. So $\sum\limits_iX_i^4$ accounts for some of the degree-four monomials in the expanded product.
Now what if $i=k$ and $j=\ell$, but $k\neq j$? Then there would be a monomial $X_i^2X_j^2$. This time, for any particular pair $i$ and $j$, there are actually six ways to obtain a monomial $X_i^2X_j^2$. Count all of the ways that the index $i$ could have arisen twice from the four original sums: $$X_iX_iX_jX_j,\quad X_iX_jX_iX_j,\quad X_iX_jX_jX_i,\quad  X_jX_jX_iX_i,\quad X_jX_iX_jX_i,\quad\text{ and }\quad X_jX_jX_iX_i.$$ However, if you plan to sum over $i\neq j$, then each $X_i^2X_j^2$ arises twice. So the expanded product of four sums has 3 copies of $X_i^2X_j^2$, and then again 3 more copies when $i$ and $j$ trade places. So $3\sum\limits_{i\neq j}X_i^2X_j^2$ accounts for more of the degree-four monomials in the expanded product.
Continue these considerations, with $i=k=\ell\neq j$, $i=\ell\neq j\neq k\neq i$, and lastly with all four indices different.
