Suppose I have scalar random variables $$X_1 + \cdots + X_n,$$ defined on some probability space and let $S_n$ be their sum.
How can I prove the identity $$\mathbb{E}|S_n|^2=\sum_i^n\sum_j^n\mathbb{E}X_i\overline{X_j} \quad ?$$
(I know this question is relatively trivial, but it's been a long time since I've had to deal with probability/measure theory and so I got very rusty.)
$$|S_n|^2=S_n\cdot\overline{S_n}=\sum_iX_i\cdot\sum_j\overline{X_j}=\sum_{i,j}X_i\overline{X_j}$$