In an instruction question (so not homework) I am asked to prove the following:
Let $X$ be a non-negative random variable with finite second moment. I then have to show that: $$ E(X^2)= \int^\infty_0 2t \mathbb P(X>t)dt$$
Where I believe $\mathbb P(X>t)=\int_t^\infty f_X(x) dx$
It seems to me that some symmetry result was applied here and a step of integration by parts. I am familiar with the following interpretation of the expected value: $$ E(X^2)=\int_{-\infty}^\infty t^2 f_X(t) dt$$ Now if one would use a single step of integration by parts we would get something involving $2t$. I think this specifically would give us: $$ E(X^2)=[t^2 \int f_X(t) dt]_{-\infty} ^\infty - \int_{-\infty}^\infty 2t (\int f_X(t) dt) dt $$ But I am having some trouble getting a precise form for the quantities as you can tell. This means I have trouble writing it in the form that is desirable.
Any tips?