How to derive the formula for the expected value of a function of a continuous random variable If $X$ is a r.v. with density $f$ and $Y = g(X)$ then $$E[Y] = \int_{\Bbb R}g(x)f(x)$$
My text offers no demonstration of this. I am familiar with the Lebesgue integral in case the proof relies on measure-theoretic notions. Any help, either in the form of a derivation or reference to one would be much appreciated.
 A: $EY=Eg(X)=\int g(x)d\mu(x)$ where $\mu$ is the measure with density f, so $EY=\int g(x)f(x)dx$.
A: Here's a derivation for the Riemann Integral:
Let $F_X$/$F_Y$ and $f(x)$/$h(x)$ denote the CDF and pdf of $X$ and $Y = g(X)$ respectively. Recall that, by definition, the pdf is the derivative of the CDF. Thus we find the density $h(x)$ by finding $F_Y$ and using the fact that $h = F'_Y$. We thus have:
$F_Y(y) = Pr[Y \leq y] = Pr[g(X) \leq y] = Pr[ X \leq g^{-1}(y)] = F_X\left(g^{-1}(y)\right) = \left(F_X \circ g^{-1}\right)(y) \\ \implies h(y) = F'_Y(x) = \left(F_X \circ g^{-1}\right)'(y) = F'_X\left(g^{-1}(y)\right)\left(g^{-1}\right)'(y) = f\left(g^{-1}(y)\right)\left(g^{-1}\right)'(y) $
$ \\ $
Finally we make the $u$-substitution $$y = g(x) \implies x = g^{-1}(y) \text{ and } dx = \left(g^{-1}\right)'(y)  \ dy$$ and observe:
$$E[Y] = \int_{\mathbb{R}} yh(y) \ \mathrm{d}y = \int_{\mathbb{R}} y f\left(g^{-1}(y)\right) \left(g^{-1}\right)'(y) \ \mathrm{d}y = \int_{\mathbb{R}} g(x)f(x) \ \mathrm{d}x$$
