For every random variables $X$ and $Y$, show that $$\int_{-\infty}^{\infty} [P(X<x\le Y)-P(Y<x\le X)]dx=EY-EX.$$
I'm not sure how to approach this. I tried rewriting $P(X<x\le Y)=1-P(X<x, Y<x)$ and $P(Y<x\le X)=1-P(Y<x,X<x)$ but it just cancels.
For every random variables $X$ and $Y$, show that $$\int_{-\infty}^{\infty} [P(X<x\le Y)-P(Y<x\le X)]dx=EY-EX.$$
I'm not sure how to approach this. I tried rewriting $P(X<x\le Y)=1-P(X<x, Y<x)$ and $P(Y<x\le X)=1-P(Y<x,X<x)$ but it just cancels.
Copyright © 2021 JogjaFile Inc.
$$\int_\mathbb RP(X\lt x\leqslant Y)\,\mathrm dx=E\left(\int_\mathbb R\mathbf 1_{X\lt x\leqslant Y}\,\mathrm dx\right)$$ $$ \int_\mathbb R\mathbf 1_{X\lt x\leqslant Y}\,\mathrm dx=\mathbf 1_{X\lt Y}\int_X^Y\mathrm dx=(Y-X)^+$$ $$Y-X=(Y-X)^+-(X-Y)^+$$