# Proof of an alternative form of expectation of a function of a random variable.

How to prove the following statement?

Let X be a positive r.v. and $$f : \mathbb{R}^{+} \rightarrow \mathbb{R}$$ a differentiable function with continuous derivative and such that $$f(X)$$ is integrable. Then $$\mathrm{E}[f(X)]=f(0)+\int_{0}^{+\infty} f^{\prime}(t) \mathrm{P}(X \geq t) d t$$

The hint is to use Fubini Theorem or Tonelli's theorem for the third equality of the following equations.

$$\begin{array}{c}{\mathrm{E}[f(X)]=\int_{0}^{+\infty} f(x) d \mu(x)=\int_{0}^{+\infty} d \mu(x)\left(f(0)+\int_{0}^{x} f^{\prime}(t) d t\right)} \\ {=f(0)+\int_{0}^{+\infty} f^{\prime}(t) d t \int_{t}^{+\infty} d \mu(x)=f(0)+\int_{0}^{+\infty} f^{\prime}(t) \mathrm{P}(X \geq t) d t}\end{array}$$

But I can't verify the conditions. The Lebesgue measure and probability measure are both $$\sigma$$-finite. But I don't know how to do with the rest about integrability or non-negativeness.

Is this statement true or we really need additional conditions?

• @LeeDavidChungLin In case where f(t)=t, $f'(t)=1$, we can directly apply Tonelli's theorem because 1 is non negative. So they are not really the same. – 陈通昱 Apr 12 at 16:29
• @LeeDavidChungLin Posts you cited solve the special case where f(t)=t, but here it's more general. The special case where $f(t)=t^\lambda$ is also solved. – 陈通昱 Apr 12 at 16:39
• @LeeDavidChungLin it's not the same f – 陈通昱 Apr 12 at 16:42
• @LeeDavidChungLin Note the rhs of the statement, it's not arbitrary – 陈通昱 Apr 12 at 16:46

We can prove the equality from basic definitions. Notice that $$\mathbb{E} f(X) = \int\limits_\mathbb{R} f(x) dF_X (x) = \int\limits_0^\infty f(x) dF_X (x), \tag{1}$$ where $$F_X (x) = \mathbb{P}(X \leq x)$$ is the cdf of $$X$$, and we used the positivity of $$X$$ to change the integration range to $$[0,\infty)$$ instead of $$\mathbb{R}$$. Now fix any $$A>0$$ large, and apply integration by parts in the integral $$\int\limits_0^A f(x) d \mathbb{P}(X \leq x) = f(A) \mathbb{P}(X \leq A) - f(0) \mathbb{P}(X \leq 0) - \int\limits_0^A f'(x) \mathbb{P}(X \leq x) dx = \\ f(A) \mathbb{P}(X \leq A) + \int\limits_0^A f'(x) [ \mathbb{P}(X > x) - 1 ]dx = \\ f(A) \mathbb{P}(X \leq A) - f(A) + f(0) + \int\limits_0^A f'(x) \mathbb{P}(X > x)dx.$$ Now taking $$A\to \infty$$ in the last expression completes the proof of the desired equality.
• How do we know the convergence of $f(A) \mathbb{P}(X \leq A) - f(A)$? – 陈通昱 Apr 26 at 17:41
• @陈通昱, thanks for pointing this out! You're right of course, we still need to show that $f(X) \mathbb{P}(X \geq A) \to 0$ as $A \to \infty$. I'll try to update the answer if I get something useful, for now what I wrote holds under the extra assumption that $f(A) \mathbb{P}(X \geq A) \to 0$ as $A \to \infty$. – Hayk Apr 27 at 8:59