# Thread: proof of expectation with CDF

1. ## proof of expectation with CDF

Hey guys! I need help in completing the proof.
The proof starts like this
$E[X]=E[X^+]-E[X^-]=\int_{0}^{\infty} xdF_x^+(x)\, dx - \int_{0}^{\infty} xdF_x^-(x)\,dx$
$= \int_{-\infty}^{\infty} xdF_x(x)\, dx
$

I cant find the reason for the last line. Please give me a clue.

2. Remember that:

$\int_a^b f(x)dx=-\int_b^a f(x)dx$, and try to work from there using the properties of the propability function

3. ^Thank you for the clue!