# Proving $\mathbb{E}(g(X)) = \int_{\mathbb{R}} g(x) f(x) dx$

Let $X$ be a random variable on a probability space $(\Omega, \mathcal{F}, P)$ and let $g$ be a Borel-measurable function on $\mathbb{R}$. In Shreve II (p 28) he proves, using the standard machine, that $$\mathbb{E}(g(X)) = \int_{\mathbb{R}} g(x)\, d(P \circ X^{-1})(x),$$ where $P \circ X^{-1}$ is the pushforward measure on $\mathbb{R}$. He then again uses the standard machine to prove that, for a continuous random variable $X$, that $$\mathbb{E}(g(X)) = \int_{\mathbb{R}} g(x) f(x) d\lambda(x),$$ where $f$ is the probability density function of $X$ and $\lambda$ is the Lebesgue measure on $\mathbb{R}$.

My question is, is the standard machine really necessary for this second part? By definition of a continuous random variable, $f = \frac{d(P \circ X^{-1})}{d \lambda}$, and so $$\int_{\mathbb{R}} g(x)\, d(P \circ X^{-1})(x) = \int_{\mathbb{R}} g(x)f(x) d\lambda(x)$$ since $f$ is the Radon-Nikodym derivative of $P \circ X^{-1}$ w.r.t. $\lambda$.

Perhaps I am overlooking some integrability conditions?

As the Radon-Nykodim derivative is defined for measures on the same measurable space, and while probability $P$ is defined on the probability space $\Omega$, the standard machine is necessary to have the two measures $\lambda$ and $P \circ X^{-1}$ both defined on $\mathbb{R}$. That is, \begin{align*} \mathbb E(g(X)) &=\lim_{n\rightarrow \infty}\sum_{m=-\infty}^{\infty}\sum_{i=1}^{2^n}\Big(\frac{i-1}{2^n}+m\Big)P\Big(\frac{i-1}{2^n}+m \leq g(X) < \frac{i}{2^n}+m\Big)\\ &=\lim_{n\rightarrow \infty}\sum_{m=-\infty}^{\infty}\sum_{i=1}^{2^n}\Big(\frac{i-1}{2^n}+m\Big)P \circ X^{-1}\bigg(g^{-1}\Big[\frac{i-1}{2^n}+m, \ \frac{i}{2^n}+m\Big)\bigg)\\ &=\int_{\mathbb{R}} g(x)\, d(P \circ X^{-1})(x)\\ &= \int_{\mathbb{R}} g(x) f(x) d\lambda(x), \end{align*} where $f = \frac{d(P \circ X^{-1})}{d \lambda}$ is the Radon Nykodim derivative.
• the two measures $P \circ X^{-1}$ and $\lambda$ are both defined on $(\mathbb{R}, \mathcal{B})$, which is why I believe (correct me if I'm wrong!) the Radon-Nikodym $f$ above is valid. – bcf Jul 2 '15 at 16:12
• @bcf, you can show the third equation from the definition of Radon Nykodim derivative, however, it is only a one-line proof, as for any Borel set $B$, $P \circ X^{-1}(B) = \int_B f(x) d\lambda$. – Gordon Jul 2 '15 at 17:08