Formula for $E(X^4)$ as integral of complementary CDF of random variable $X$ So the question I have is
Let S be a non-negative random variable. By writing the probability as an expectation and using Fubini's theorm, show that
$ES^4=\int_0^\infty4t^3P(S>t)dt$
so I found on wikipedia http://en.wikipedia.org/wiki/Expected_value#General_definition

but it does not show how to prove it.
My attempt is somehow using the chain rule but i don't know how do you change S into t.
 A: Hint: Note that for $X$ non negative random variable, and $x>0$ and $\alpha > 1$


*

*$$x^\alpha = \int_0^x\alpha u^{\alpha-1}du$$

*$$E[X^\alpha] = \int_0^\infty x^\alpha dF(x)= \int_0^\infty \int_0^x\alpha u^{\alpha-1}du dF(x)$$
$$ = \int_0^\infty \int_0^\infty\alpha u^{\alpha-1}1_{\{u \leq x\}}du dF(x)$$


Swap the integrals using Fubini Tonelli theorem, get rid of the indicator function and you will have your result. Try the steps for yourself and let me know if you have problems.
A: I'm typing this on my phone so I hope there won't be that many typos. 
If you assume that your random variable is nice enough, then it has a density function $f (t)$ and a distribution function $F(t) = P ( X \leq t)$ such that
$$\frac {d}{dt} (1 - F) = -f$$
In this case you can compute
\begin{align*}
E [X] &= \int X dP = \int t^{\alpha} dP_X = \int t^{\alpha} \cdot f (t) dt \\
& = - \int t^{\alpha} (1-F)'(t) dt = -[t^{\alpha}(1-F(t))]_{t=0}^{\infty} + \int \alpha  t^{\alpha - 1} (1-F(t)) dt \\
& = \alpha \int t^{\alpha-1} P (X > t ) dt
\end{align*}
