Identity for the expected value I want to show the following identity
$$\mathbb{E}X=\int_0^\infty \Pr(X>t) dt$$
where $X$ is a continuous random variable taking positive values.
We have
\begin{align}\int_0^\infty \Pr(X>t) dt&=\int_0^\infty \int_t^\infty1P_X(ds)dt\\&=\int_{-\infty}^\infty1_{(0,\infty)}(t)\int_t^\infty P_X(ds)dt \\ &=\int1_{(0,\infty)}(t)\int1_{(t,\infty)}(s)P_X(ds)dt \end{align}
I am not sure how to continue from here
 A: Edit: First, I'll deal with the case where $P$ is absolutely continuous, with a density $p_X(s)$. We have shown that
$$ \int_0^\infty \Pr(X > t) dt = \iint_R p_X(s) \ dsdt,$$
where $p_X(s)$ is the density for $X$ and $R$ is the region
$$ R = \{ (s, t) \in \mathbb R^2 \ : \  0 < t < \infty, \  t < s < \infty \}.$$
Now notice that the region $R$ can also be described like this:
$$ R =\{ (s, t) \in \mathbb R^2 \ : \  0 < s < \infty, \  0 < t < s \} .$$
So an alternative, equivalent way of writing the double integral is:
$$ \iint_R p_X(s) \ ds dt = \int_0^\infty ds \int_0^s dt p_X(s) = \int_0^\infty ds \left( p_X(s) \int_0^s 1 dt \right) = \int_0^\infty ds \ s p_X(s) = \mathbb E[X].$$

However, if we don't assume that $X$ is absolutely continuous (so we don't have a density  $p_X(s)$), we can still proceed as follows:
\begin{align} \mathbb E[X] & = \int_\Omega X(s) dP(s) \\ &= \int_\Omega \mu \left( [0, X(s))\right) \ dP(s) \\
&= (P \times \mu) \left( \left\{ (s,t) \in \Omega \times [0, \infty) : 0 \leq t < X(s) \right\}\right) 
\\
&= \int_{[0, \infty)}  \ P (\{ s \in \Omega : X(s) > t \}) \ d\mu(t)
\\
&= \int_0^\infty  \Pr(X > t) dt
\end{align}
Here, $\Omega$ is the probability space, and $\mu$ is the Lebesgue measure, and I'm assuming that $X(s) \geq 0$ on $\Omega$.
A: If the integrand is a nonnegative function then switching the order of integration is allowed, so:
$$\begin{aligned}\mathbb{E}X & =\int_{0}^{\infty}sP_{X}\left(ds\right)\\
 & =\int_{0}^{\infty}\int_{0}^{\infty}\mathbf{1}_{\left(0,s\right)}\left(t\right)dtP_{X}\left(ds\right)\\
 & =\int_{0}^{\infty}\int_{0}^{\infty}\mathbf{1}_{\left(0,s\right)}\left(t\right)P_{X}\left(ds\right)dt\\
 & =\int_{0}^{\infty}\int_{0}^{\infty}\mathbf{1}_{\left(t,\infty\right)}\left(s\right)P_{X}\left(ds\right)dt\\
 & =\int_{0}^{\infty}P\left(X>t\right)dt
\end{aligned}
$$
