Expected value expressed by CDF. I have found following formula for expected value:
$$\operatorname{E}[X] = \int_0^\infty \int_0^x \! \mathrm{d}t \, \mathrm{d}F(x) = \int_0^\infty \int_t^\infty \! \mathrm{d}F(x)\mathrm{d}t = \int_0^\infty \! (1-F(t))\,\mathrm{d}t$$
and I don't understand this equality:
$$\int_0^\infty \int_0^x \! \mathrm{d}t \, \mathrm{d}F(x) = \int_0^\infty \int_t^\infty \! \mathrm{d}F(x)\mathrm{d}t.$$
Firstly I have thought that it is just Fubini but the ranges of the integrals doesn't match. Probably it's something obvious but for now I cannot come up with an idea so I'd be glad for any tip.

Prescribe function $f\left(x,t\right)$ by $\left(x,t\right)\mapsto1$
if $t<x$ and $\left(x,t\right)\mapsto0$ otherwise. 
Applying
Fubini you find:
$$\int_{0}^{\infty}\!\!\int_{0}^{x}dtdF\left(x\right)=\int_{0}^{\infty}\!\!\int_{0}^{\infty}f\left(x,t\right)dtdF\left(x\right)=\int_{0}^{\infty}\!\!\int_{0}^{\infty}f\left(x,t\right)dF\left(x\right)dt=\int_{0}^{\infty}\!\!\int_{t}^{\infty}dF\left(x\right)dt$$
