# Prove a useful formula for computing expectations

Suppose $X$ is a non-negative random variable, and $h$ is a non-decreasing function on $\mathbb{R}_+$ such that $h(0)=0$ and $h$ is absolutely continuous on each bounded interval. ($h(a) = \int_0^a h'(s) ds$ for all $0\leq a <\infty$) Then, \begin{align} \mathbb{E}[h(X)] = \int_0^\infty h'(s) P(X>s) dt. \end{align}

I am thinking about partial integration, but it is not really obvious how to use this. Can somebody help me?

• Hint: Integrate the LHS and the RHS of the identity $$h(x)=\int_0^xh'(s)\,ds=\int_0^\infty h'(s)\,\mathbf 1_{x>s}\,ds.$$ Note that there is no problem of integrability since everything is nonnegative. – Did Mar 1 '16 at 11:45
Since $X\geqslant0$ a.s. and $h$ is increasing, we have $$\mathbb E[h(X)] = \int_0^\infty (1-F_{h(X)}(x)\ \mathsf dx = \int_0^\infty (1-F_X(h^{-1}(y))\ \mathsf dy,$$ where $$h^{-1}(y)=\min\{x: h(x)=y\}.$$ Applying the change of variables $s=g^{-1}(x)$, we have $$\mathbb E[h(X)]=\int_0^\infty(1-F_X(s))h'(s)\ \mathsf ds=\int_0^\infty h'(s)\mathbb P(X>s)\ \mathsf ds.$$
Alternatively, from @Did's hint we see that $$\mathbb E[h(X)] = \mathbb E\left[\int_0^\infty h'(s)\mathsf 1_{\{X>s\}}\ \mathsf ds \right]=\int_0^\infty h'(s)\mathbb P(X>s)\ \mathsf ds.$$
• Sorry but the expressions $\lim\limits_{t\to0}-h'(t)\mathsf dF(t)$ and $\lim\limits_{t\to\infty}-h'(t)\mathsf dF(t)$ are ill-formed. – Did Mar 1 '16 at 11:47
• The current integration by parts formula is wrong, why the term $-h'(t)f(t)|_0^\infty$? – Did Mar 2 '16 at 6:01