TITLE: Variance formula in terms of the CDF for a continuous nonnegative random variable.
QUESTION [8 upvotes]: Is there a formula for the variance of a (continuous, non-negative) random variable in terms of its CDF?
The only place I saw such formula was is Wikipedia's page for the Variance (https://en.wikipedia.org/wiki/Variance).
Unfortunately, I was not able to prove the expression there. 
Please, can anyone help?

REPLY [3 votes]: Another potential derivation for $E[X^2]$ uses the tail-probability equality.
$Y = X^2$ is a nonnegative random variable, so the tail-probability equality applies:
$$E[Y] = \int_{y=0}^{\infty} Pr[Y \geq y] dy $$
Replace $Y = X^2$ and $y$ with appropriate expressions of $X$ and $x$:
$$E[X^2] = \int_{x^2=0}^{\infty} Pr[X^2 \geq x^2] dx^2 $$
Because we are assuming that $X$ is nonnegative, $Pr[X^2 \geq x^2] = Pr[X \geq x]$. We also change our variable of integration from $x^2$ to $x$ (essentially $u$-substitution) by noting that $dx^2 = 2xdx$. Making these changes, we get
$$E[X^2] = 2\int_{x=0}^{\infty}x Pr[X \geq x] dx $$
If you want it in CDF form, make the replacement $Pr[X \geq x] = 1 - F_X(x)$:
$$E[X^2] = 2\int_{x=0}^{\infty}x (1 - F_X(x)) dx $$