= Solution
Let $S(x)=\mathbb P(X>x)=1-F_X(x)$ for $x\geq0$. Since $f_X=0$ on the negative half-line, $X\geq0$ almost surely. We have $S'=-f_X$ almost everywhere. On a finite interval, <integration by parts> gives
$$
\int_0^R x f_X(x)\,dx
=-\int_0^R xS'(x)\,dx
=-RS(R)+\int_0^R S(x)\,dx.
$$
The lower endpoint contributes zero. The stated hypothesis gives $RS(R)\to0$ as $R\to\infty$. Taking the increasing limits of the two nonnegative <integrals> proves the <tail-integral identity>
$$
\boxed{\mathbb E(X)=\int_0^{\infty}\mathbb P(X>x)\,dx}.
$$
The equality allows the value $+\infty$; the boundary hypothesis alone does not force a finite expectation. In fact the formula for nonnegative $X$ also follows directly from <Tonelli theorem>, without that additional boundary hypothesis, by integrating $x=\int_0^{\infty}\mathbf1_{\{t<x\}}\,dt$ against the <probability density function>.
Back to article page