Writing the expected value of a random variable in terms of its cumulative distribution function My professor said that an alternative expression for the expected value of a random variable can be written as: 
$$ E[X] = \int_{0}^{\infty} (1-F_X(x)) \, dx - \int_{-\infty}^0 F_X(x) \, dx $$ 
No proof was provided and I cannot find any such representation online. 
How is this possible? 

Hint: Write $F_X(x) = E[I\{X \le x\}]$ and use Fubini's theorem.
