The problem is:
Suppose $X\ge 0$ is a random variable, $p(x)$ is its probability density function. If $\operatorname EX$ exists, $r>0$, prove:
$$\operatorname EX^r = \int_0^\infty rx^{r-1}P(X>x) \, dx.$$
I see $\operatorname E X^r$ as $\int_{-\infty}^\infty x^r p(x) \, dx$, while $$\text{RHS}=\int_0^\infty \left(\int_x^\infty p(t)\,dt \right) dx^r = \left.\left(x^r\int_x^\infty p(t) \, dt\right)\right|_0^\infty-\int_0^\infty x^r p(x) \, dx.$$
However, when calculating $x^r \int_x^\infty p(t) \, dt$ as $x\to \infty$, it comes to a $0 \times \infty$ problem. How can I solve it?
Thanks.