# B Finding the mean using the CDF

1. Jul 28, 2016

### S_David

Hello all,

I have the random variable $X$ with CDF and PDF of $F_X(x)$ and $f_X(x)$, respectively. Now I have a function in terms of the random variable $X$, which is $e^{-X}$, and I want to find the mean of this function. Basically this can be found as

$$\int_0^{\infty}e^{-x}f_X(x)\,dx$$

where the range of the random variable $X$ is between $0$ and $\infty$. However, $X$ is a very complicated random variable (it's a function of a number of other independent random variables), and thus although the CDF is easy to find relatively, the PDF is not that nice expression after taking the derivative of the CDF function. So someone here pointed out to me that by using integration by parts, the above mean expression can by written as

$$\int_0^{\infty}e^{-x}f_X(x)\,dx=\left. -e^{-x}F_X(x)\right|_0^{\infty}+\int_0^{\infty}e^{-x}F_X(x)\,dx=\int_0^{\infty}e^{-x}F_X(x)\,dx$$

I just wanted to make sure: Is this mathematically correct?

Thanks

2. Jul 29, 2016

### S_David

Anyone on this?

3. Jul 29, 2016

### mathman

Looks good to me.