I saw this equation in my book, but I don't know where it comes from. $F$ is the distribution function of a RV.
$$\int_a^b (x - a)dF(x) = \int_a^b (1 - F(x)) dx$$
$a > 0$ is arbitrary but $F(b) = 1$, not sure if that plays a part here.
I saw this equation in my book, but I don't know where it comes from. $F$ is the distribution function of a RV.
$$\int_a^b (x - a)dF(x) = \int_a^b (1 - F(x)) dx$$
$a > 0$ is arbitrary but $F(b) = 1$, not sure if that plays a part here.
This is just a corollary of the main result here.
For any random variable $X$ and $a>0$,
\begin{align} (X-a)\mathbf1_{a<X<b}&=\int_0^{X-a}\,dt\cdot\mathbf1_{a<X<b} \\&=\int_0^\infty \mathbf1_{X-a>t\,,\,a<X<b}\,dt \\&=\int_0^\infty \mathbf1_{a+t<X<b}\,dt \\&=\int_0^{b-a}\mathbf1_{X>a+t}\,dt \end{align}
Therefore,
\begin{align} \mathbb E[(X-a)\mathbf1_{a<X<b}]&=\color{blue}{\int (x-a)\mathbf1_{a<x<b}\,dF(x)}\qquad\qquad\,\,\small(\text{by definition}) \\&=\int \left(\int_0^{b-a}\mathbf1_{x>a+t}\,dt\right)dF(x) \\&=\int_0^{b-a} \underbrace{\int \mathbf1_{x>a+t}\,dF(x)}_{\large\mathbb E[\mathbf1_{X>a+t}]}\,dt\qquad\quad\small(\text{by Fubini's theorem}) \\&=\int_0^{b-a}\mathbb P(X>a+t)\,dt \\&=\int_0^{b-a} (1-F(a+t))\,dt \\&=\color{red}{\int_a^b(1-F(x))\,dx} \end{align}