Let X be a random variable that takes on nonnegative values and has distribution function $F(x)$. $E(X) = \int_{0}^{\infty}1-F(x)dx$
The proof my book gives is:
This statement was included at the end with respect to the last inequality:
Since both terms are non-negative, the only way this can happen is for the inequality to be an equality and the limit to be 0.
Based on the integration by parts formula, looks like $u = x$ and $dv = f(x)dx = dF(x)$ since $E(X) = \int_{0}^{\infty}xf(x)dx$.
It appears that $v = F(x)-1$; why is it not $F(x)$? Given that $dF(x)/dx = f(x)$ so I thought the antiderivative of $f(x)$ would be $F(x)$?
How is $a(1-F(a))$ is less or equal to $\int_{a}^{\infty} xf(x)dx$ (in the middle part)?
I don't really understand the purpose of the last equation; why do we have $E(X)$ on both sides of the inequality?