Expectation function of random variable Lebesgue integral If $X$ is a random variable and $h$ a Borel measurable function, let $\mathbb{P}^{x}$ be the distribution of $X$. I now have problems proving that $h(X)\in L^1(\Omega,\mathcal F,\mathbb{P})$ if and only if $h\in L^1(\mathbb{R},\mathcal B,\mathbb{P}^{x})$, in which case $$\mathbb{E}h(X)=\int_{\mathbb{R}}h d\mathbb{P}^{x}.$$
 A: We use the definition of Lebesgue integral: first, as the sum of two integrable functions is integrable, and $f$ is integrable if and only if so are $f^+:=\max(f,0)$ and $f^-:=f^+-f$. So we just have to show the result when $h$ is non-negative. 


*

*If $h(X)\in L^1(\Omega,\mathcal F,\mathbb P)$, then we can find a sequence $\{h_n\}$ of simple functions such that $h_n\uparrow h$ almost everywhere. We get by Fatou's lemma 
$$\int_{\Bbb R}h(x)d\mathbb P^x\leq \liminf_{n\to +\infty}\int_{\Bbb R}h_n(x)d\mathbb P^x.$$
We can show that for each simple function $s$, we have $\int_{\Bbb R}s(x)d\mathbb P^x=\int_\Omega s(X(\omega))d\mathbb P(\omega)$ (by definition of integration of simple functions and pullback of a measure). Since $h_n\leq h$ for all $x$, 
$$\int_{\Bbb R}h(x)d\mathbb P^x\leq \liminf_{n\to +\infty}\int_\Omega h_n(X(\omega))d\mathbb P(\omega)\leq \int_{\Omega}h(X(\omega))d\mathbb P(\omega)<\infty$$

*Conversely, if $h\in L^1(\Bbb R,\mathcal B(\Bbb R),\mathbb P^x)$, we have by a similar argument 
$$\int_{\Omega}h(X(\omega))d\mathbb P(\omega)\leq \liminf_{n\to +\infty}\int_\Omega h_n(X(\omega))d\mathbb P(\omega)\leq\int_{\Bbb R}h(x)d\mathbb P^x <\infty.$$
This proves the equivalence. 


The last two displayed equations show that when one of the two conditions is satisfied, we have equality. (actually, we have equality in $\overline{\Bbb R}$) 
