Here it is
\begin{align*} \mathbb{E}[X] &= \int_{0}^{\infty} xf_X(x)dx \quad \text{By definition } \\ &= \int_{0}^{\infty} \left ( \int_{0}^{x} \ dt \right )f_X(x)dx \quad \because \int_{0}^{x} \ dt = x \\ &= \int_{0}^{\infty} \left ( \int_{0}^{x}f_X(x) \ dt \right )dx \because f_X(x)\text{ is a constant in the inner integral}\\ &= \int_{0}^{\infty} \int_{0}^{x} f_X(x) \ dt dx\end{align*}
Now note that in the above double integral expression we are integrating first with respect to variable \(t\) holding variable \(x\) constant and then integrating with respect to variable \(x\).
As we see in the above plot we can interchange the order integration above i.e. integrate first wrt variable \(x\) by holding variable \(t\) constant and then integrating wrt variable \(t\) and we get the following
\begin{align*} \mathbb{E}[X] &= \int_{0}^{\infty} \int_{0}^{x} f_X(x) \ dt dx \quad \text{From the above expression} \\ &= \int_{0}^{\infty} \int_{t}^{\infty} f_X(x) \ dx dt \\ &= \int_{0}^{\infty}\left (\int_{t}^{\infty}f_X(x) dx \right ) dt \\ &= \int_{0}^{\infty}\left (1-F_X(t) \right ) dt \end{align*}
Note: This is only valid if rv \(X\) has a support in \(\mathcal{R}_+\)
Last edited by a moderator: Jun 5, 2017