Is $E[X^2] = E[|X|^2]$? Let $X$ be a random variable with mean 0 and variance $\sigma^2$.
Then $E[X^2] = E[|X|^2]$ but when we write them as
$$
E[X^2] = \text{Var}[X] + E[X]^2 = \sigma,
$$
and
$$
E[|X|^2] = \text{Var}[|X|] + E[|X|]^2,
$$
they are not equal.
What is going on here, am I mistaken in thinking $E[X^2] = E[|X|^2]$?
 A: There's nothing paradoxical about concluding $$ \text{Var}[X] + E[X]^2 = \text{Var}[|X|] + E[|X|]^2. $$
Intuitively, $\text{Var}[|X|]$ is (potentially) smaller than $\text{Var}[X]$ because the absolute value might erase or reduce the difference between some samples.
On the other hand, the magnitude of $E[|X|]$ is (potentially) larger than the magnitude of $E[X]$, because positive and negative values of $X$ tend to cancel each other out in $E[X]$ while they pull in the same direction in the case of $E[|X|]$.
The conclusion above just says that these two opposite effects cancel each other out exactly.
A: Since $X^2=|X|^2$, if $E[X^2]$ exists then $E[X^2]=E[|X|^2]$, so if $\sigma_X$ is finite $\mu_X^2+\sigma_X^2=\mu_{|X|}^2+\sigma_{|X|}^2$.
A: The variance $\operatorname{Var}X$ is not necessarily equal to the variance $\operatorname{Var}|X|$ and $\operatorname EX$ is not necessarily equal to $\operatorname E|X|$ (they would be equal if $X\ge0$ almost surely). However,
$$
\operatorname{Var}X+(\operatorname EX)^2=\operatorname{Var}|X|+(\operatorname E|X|)^2
$$
and
$$
\operatorname EX^2=\operatorname E|X|^2.
$$
