I have been recently reading up on some material and was exposed to the Lebesgue integral, although I was unsure as to why if $EX < \infty$, we have that $$EX = \int_{-\infty}^0 xdF(x) - \int_0^\infty xd[1 - F(x)].$$ I know that $$EX = \int_{-\infty}^\infty xdF(x),$$ although I was wondering is it the same as the first equation above because intuitively the "rate of change" of $d[1 - F(x)]$ is simply the same as $dF(x)$ but negative? My second question would then be suppose that $\int_{-\infty}^0 xdF(x) $ exists. Then is this really equal to $-\int_{-\infty}^0 F(x)dx $? If so, then why?
Thank you very much!