# How is this equation about expected value true?

$$X$$ is a stochastic variable. We have $$E(X) = \mu$$ and $$Var(X) = \sigma^2$$

Then $$E(X^2) = \mu^2 + \sigma^2$$

We have data $$X_1, X_2, X_3 , \ldots, X_n$$ from that distribution.

Then we have: $$\sum_{i=1}^n (X_i - \bar{X})^2 = \sum_{i=1}^n X_i^2-n\left( \bar{X}\right)^2$$

And we have: $$E[\sum_{i=1}^n X_i^2]= \sum_{i=1}^n E[X_i^2]$$

But why is this equation below true?

$$\sum_{i=1}^n E(X_i^2)=\sum_{i=1}^n E(X^2)$$

What is the proof of that?

• @KitterCatter No, it's correct. Here, $\bar{X}$ is the sample mean $\bar{X} = \sum_i X_i / n$. – JiK May 17 '19 at 9:23

We have data $$X_1, X_2, \ldots, X_n$$ from that distribution.
Hence, $$X_1^2, \ldots, X_n^2$$ must share the same distribution and hence the same expectation too.
An alternative view can also be $$X_1, \ldots , X_n$$ has the same variance and expectation. Since $$E[X^2]=Var(X)+(E(X))^2$$, they must share the same expectation when they are squared too.