Where did this statistics formula come from: $E[X^2] = \mu^2 + \sigma^2$ I am studying statistics and I need some guidance as to where this formula came from. All I know is that $\displaystyle E[X^2] = x^2 \sum_{i=0}^n p_{i}(x)$ 

Edit: Thanks to the Did's comment and as a alternative answer.
You can use the following definition:
If $X$ is any random variable with distribution $F_{X}(x)$, then
$$\mu_{X}=\int \limits_{0}^{+\infty}\left({1-F_{X}(x)}\right)dx-\int\limits_{-\infty}^{0}F_{X}(x)dx,$$
$$\sigma_{X}^{2}=\int \limits_{0}^{+\infty} 2x \left( {1-F_{X}(x)+F_{X}(-x) } \right)dx-\mu_{X}^2$$
and then show that 
$$E[X^2]=\int \limits_{0}^{+\infty} 2x \left( {1-F_{X}(x)+F_{X}(-x) } \right)dx$$
to conclude your equality.
