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.