Show that $E(Y^p)=\int_{0}^{\infty}px^{p-1}P(Y\geq x)dx$ Studying some probability theory and I came across this question. Show that if $Y$ is a non-negative random variable, and $p>0$, $$E(Y^p)=\int_{0}^{\infty}px^{p-1}P(Y\geq x)dx$$
I'm a bit stuck on this question: I know that by Markov's inequality, $\frac{E(Y^p)}{y^p}\geq P(Y>y)$ since $Y=\lvert Y\rvert$ here. Also, $y^p=\int_{0}^y px^{p-1}dx$ and I believe these two facts can be used to solve the problem, but I'm not sure how exactly.
Could anyone give me some help, point me in the right direction?
 A: If you are willing to use Tonelli's theorem (as opposed to something more elementary) you have
$$\int_0^\infty px^{p-1} P(Y \ge x) \, dx = \int_0^\infty px^{p-1} \int_\Omega \mathbb{1}_{\{Y \ge x\}} \, dP dx = \int_\Omega \int_0^\infty px^{p-1} \mathbb{1}_{\{Y \ge x\}} \, dxdP.$$
The inner integral evaluates as
$$\int_0^\infty px^{p-1} \mathbb{1}_{\{Y \ge x\}} \, dx = \int_0^Y px^{p-1} \, dx = Y^p.$$
A: If $Y$ has density $f(y)$, the trick is to (1) put $y^p=\int_0^y px^{p-1}\,dx$ in the formula for $E(Y^p)$, obtaining a double integral,
then (2) interchange the order of integration:
$$\begin{align}
E(Y^p) &= \int_{y=0}^\infty y^pf(y)\,dy\\
&\stackrel{(1)}=\int_{y=0}^\infty\left(\int_{x=0}^y px^{p-1}\right)f(y)\,dy\\
&=\int_{y=0}^\infty\left(\int_{x=0}^y px^{p-1}f(y)\right)\,dy\\
&\stackrel{(2)}=\int_{x=0}^\infty\left(\int_{y=x}^\infty px^{p-1}f(y)\right)\,dx\\
&=\int_{x=0}^\infty px^{p-1}\left(\int_{y=x}^\infty f(y)\right)\,dx\\
&=\int_{x=0}^\infty px^{p-1} P(Y\ge x)\,dx
\end{align}
$$
A: \begin{align*}  E [ Y^p] & = E [\int_0^{Y^p} ds ]\\
 & = E [ \int_0^\infty {\bf 1}_{[0,Y^p)}(s) ds ] \\
 & = \int_0^\infty P(s< Y^p) ds \\
 & = \int_0^\infty P(Y > s^{1/p} ds \\
 & \underset{x=s^{1/p}}{=} \int_0^\infty P(Y>x) p x^{p-1} dx.
\end{align*} 
