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 &lt;\infty$) Then,
\begin{align}
\mathbb{E}[h(X)] = \int_0^\infty h'(s) P(X&gt;s) dt.
\end{align}

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

LINKED
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&gt;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&gt;s\}}\ \mathsf ds \right]=\int_0^\infty h'(s)\mathbb P(X&gt;s)\ \mathsf ds.
$$
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&gt;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&gt;s\}}\ \mathsf ds \right]=\int_0^\infty h'(s)\mathbb P(X&gt;s)\ \mathsf ds.
$$