Expectation of nonnegative random variable when passed through nonnegative increasing differentiable function

expected valueintegrationprobability theoryrandom variables

I am having trouble proving the following result:

Let $X$ be a nonnegative random variable and $g:\mathbb{R}\rightarrow\mathbb{R}$ a nonnegative strictly increasing differentiable function. Then

$$\mathbb{E}g(X)=g(0)+\int_{0}^{\infty}g^{\prime}(x)\mathbb{P}(X>x)dx$$

I know that it should follow using integration by parts, but using integration by parts in the more abstract setting of probability is a bit confusing to me. Details would be appreciated.

Best Answer

$\mathbb E[g(X)] = \mathbb E[\int_0^{g(X)}dt] = \mathbb E[\int_{g(0)}^{g(X)}dt + \int_0^{g(0)} dt ] = \mathbb E[\int_{g(0)}^{g(X)}dt ] + \mathbb E[g(0)] = \mathbb E[\int_{g(0)}^{g(X)}dt ] + g(0) $

Now using the definition of expectation, we get: \begin{align*} \mathbb E\left[\int_{g(0)}^{g(X)}dt \right] &= \int_\Omega \int_{g(0)}^{g(X)}dt d\mathbb P(\omega) = \int_\Omega \int_0^\infty \chi_{(g(0),g(X(\omega))}(t)dtd\mathbb P(\omega)\\& = \int_0^\infty \int_\Omega \chi_{(g(0),g(X(\omega))}(t)d\mathbb P(\omega) dt =\int_0^\infty \mathbb P( g(0) < t <g(X)) dt \\&= \int_{g(0)}^\infty \mathbb P( g(0) < t <g(X)) dt \end{align*}

Use of Fubini due to all things being nonnegative (so we can swap order of integration).

Now, last thing $\mathbb P( t \in (g(0),g(X)) = \mathbb P( 0 <g^{-1}(t) < X) $

So, we get $\int_{g(0)}^\infty \mathbb P( g(0) < t <g(X)) dt = \int_{g(0)}^\infty \mathbb P(0 < g^{-1}(t) < X)dt = \int_0^\infty g'(s)\mathbb P( s < X) ds$

And we get $\mathbb E[g(X)] = g(0) + \int_0^\infty g'(s)\mathbb P(X>s)ds$