Expected value given density $(E(g(x))$, stuck on integration, law of unconscious statistician)

182 Views Asked by At

so I need to show that: $$ E(X^n) = n\int_0^\infty x^{n-1}P(X>x) \, dx $$ where $X$ has density $f$, and $f(x)=0$ for all $x<0$, $n>0$. Here's what I did so far: $$ E(X^n) = \int_{-\infty}^\infty x^nf(x) \, dx = \int_0^{\infty} x^n f(x) \, dx $$ Now I've tried using integration by parts by letting $u = x^n, du=nx^{n-1}\,dx; dv=f(x)\,dx, v=F(x)$, so the integral becomes: $$ x^nF(x)|_0^{\infty} - \int_0^{\infty} nx^{n-1}F(x)\,dx= x^nF(x)|_0^{\infty} -\int_0^{\infty} nx^{n-1}P(X \le x)\,dx=\\ x^nF(x)|_0^{\infty} -\int_0^{\infty} nx^{n-1}P(X \le x)\,dx= x^nF(x)|_0^{\infty} -\int_0^{\infty} nx^{n-1}(1-P(X>x))\,dx $$ I think I'm really close, but just don't know where to go from here. Any ideas?

So sorry about that, I copied down the question wrong and never realized it. I hope this makes more sense now.

2

There are 2 best solutions below

1
On BEST ANSWER

NOTE The original portion of the answer refers to the previous edit of the question that concerned the non-positive RVs instead of nonnegative ones.

This cannot be true: since $P(X>x)=0 \,\forall{x}>0$, your right - hand side is always zero.

Actually, you have arrived at a correct expression in the end.

EDIT For your corrected problem formulation,

$$ EX^n=\int_0^\infty x^nf(x)dx = -\int_0^\infty x^n(P(X>x))^\prime_xdx=-x^nP(X>x)|_0^\infty + \int_0^\infty nx^{n-1}P(X>x)dx=\int_0^\infty nx^{n-1}P(X>x)dx. $$

9
On

Alternative route:

$$n\int_{0}^{\infty}x^{n-1}P\left(X>x\right)dx=\int_{0}^{\infty}\int_{0}^{\infty}nx^{n-1}1_{\left(x,\infty\right)}\left(y\right)dF\left(y\right)dx$$

Now switch the order of integration to arrive at: $$=\int_{0}^{\infty}\int_{0}^{\infty}nx^{n-1}1_{\left(x,\infty\right)}\left(y\right)dxdF\left(y\right)=\int_{0}^{\infty}\int_{0}^{y}nx^{n-1}dxdF\left(y\right)=\int_{0}^{\infty}y^{n}dF\left(y\right)=\mathbb EX^n$$