Let $X$ be a real continuous random variable with distribution $F$ with finite moments. I want to calculate

$$E[\vert X \vert] = \int_{-\infty}^{\infty} \vert x\vert dF(x)= -\int_{-\infty}^{0} x dF(x) + \int_{0}^{\infty} x dF(x).$$ But I want to obtain an alternative expression in order to get rid of the absolute value. I tried to split this variable using integration by parts $U=-x$, $dV = dF(x)$, then $dU= -dx$, $V=F(x)$ and

$$ -\int_{-\infty}^{0} x dF(x) = UV \Big\vert_{-\infty}^0 - \int_{-\infty}^0VdU$$

Then, $$ -\int_{-\infty}^{0} x dF(x) = \int_{-\infty}^0F(x)dx.$$

For the second integral this trick does not work as I get an infinite integral. How can I solve the second part? I think I should get something like $$ \int_{0}^{\infty} x dF(x) = \int_0^{\infty}1-F(x)dx,$$ but I am not sure how to prove it.

  • $\begingroup$ This result is demonstrated in many posts here, usually incidental to solving some other problem. For instance, you can find the (one-line) proof in the middle of my post at stats.stackexchange.com/a/209193/919 after the statement "the expectation of any positive distribution F is the integral of its survival function." $\endgroup$
    – whuber
    May 6, 2019 at 14:02

1 Answer 1


How about the following partial integration (formally written as an ordinary integral, not as a Stieltjes integral): $$\int_0^{\infty}x\cdot f(x)\;dx = -\int_0^{\infty}x\cdot(1-F(x))'\;dx = \underbrace{-x\cdot (1-F(x))\Big|_0^{\infty}}_{=0} + \int_0^{\infty}1-F(x) \; dx $$

  • $\begingroup$ I like your answer, although I am not specifying that the density actually exists. But, in such case, your answer would apply. $\endgroup$
    – expo
    May 6, 2019 at 20:33
  • $\begingroup$ When the derivative is interpreted in terms of distributions (aka generalized functions), this even holds for the discrete case. Remember that $\theta'=\delta$, i.e., the derivative of Heaviside's step-function is Diracs delta-distribution, which is the density of probability distribution with mass one at zero. $\endgroup$
    – cdalitz
    May 7, 2019 at 11:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.