# Second moment from survival function

Let X be a non-negative continuous random variable with probability density function f(x). Let $$G(t) = \int_{t}^{\infty} f(x)dx$$ Show that$$E(X^{2}) = 2\int_{0}^{\infty} tG(t)dt$$

My thoughts: I know that $$E(X^{2}) = \int_{-\infty}^{\infty} x^{2}f(x)dx$$, so here I need to prove $$x^{2}f(x)dx = tG(t)dt$$ I'm stuck in this step. Can someone explain how to prove this problem? Any clue would be appreciated. Many thanks.

Preamble

For any nonnegative random variable, \begin{align} E[X] &= \int_0^\infty xf(x)\,\mathrm dx \tag{1}\\ &=\int_0^\infty [1-F(t)]\,\mathrm dt\tag{2}\\ &= \int_0^\infty P\{X > t\}\,\mathrm dt\tag{3} \end{align} where the world will end if those square brackets in the integral on the right side of $(2)$ are ever opened and the integral is written as the difference of the integrals of $1$ and $F(t)$ over $(0,\infty)$. These integrals calculate the area between the line at height $1$ and the curve $F(t)$ (this is what $(2)$ is telling us) in two different ways.

$(2)$ can be interpreted as the standard Riemann integral (measure theorists: please hold your fire, I am not talking to you) which is finding the area by breaking it up into vertical narrow strips of height $[1-F(t)]$ and width $\Delta t$, and then making the strips become narrower and narrower, talking of upper and lower Riemann sums, taking limits, etc.

But, another way of finding the area is to divide it into very narrow horizontal strips with the strip of length $x$ whose lower side extends all the way from $0$ on the vertical axis to the point $(x, F(x))$ on the curve. The upper side of this horizontal strip is from the horizontal axis to the point $(x+\Delta x), F(x+\Delta x))$, that is, the width of this strip is $F(x+\Delta x) - F(x) \approx f(x)\Delta x$. Proceeding as before (making the strips narrower etc,) we see that the desired area can also be expressed as $(1)$.

End of preamble

From $(3)$, we can write \begin{align} E[X^2] &= \int_0^\infty P\{X^2 > t\}\,\mathrm dt\\ &= \int_0^\infty P\{X > \sqrt{t}\}\,\mathrm dt\\ &= \int_0^\infty 2yP\{X > y\}\,\mathrm dy&\scriptstyle{\text{substitute}~ y^2 = t, ~~2y\mathrm dy = \mathrm dt}\\ &= 2\int_0^\infty tG(t)\,\mathrm dt \end{align}

So, it is not quite as simple as proving that $x^{2}f(x)dx = tG(t)dt$ as you were trying to do (presumably by some kind of change of variable); we have to think about the matter a little differently.

As $G(t)=\int_t^\infty f(t)dt$ so $G(t)=1-F(t)$, then we have to prove $$E(X^2)=2\int_0^\infty t(1-F(t))\,\mathrm dt$$ Integrate the right hand side by parts taking $(1-F(t))$ as the first function to get \begin{align} 2\int_0^\infty t(1-F(t))\,\mathrm dt &=2\left((1-F(t))\frac{t^2}2 \right|^{\infty}_0 -2\int_0^\infty \frac{t^2}2(-f(t))\,\mathrm dt\\ &= 0+\int_0^\infty t^2f(t)\,\mathrm dt\\ &= \int_0^\infty t^2f(t)\,\mathrm dt\\ &= E[X^2] \end{align} and we are done.

• Thanks. Do you mean u=1-F(t), du=-f(t)dt, dv=2tdt, v=t^2? But then it should be uv - integral of vdu, so where does the item uv go? Mar 28, 2015 at 6:23
– SAAN
Mar 28, 2015 at 7:11
• I have edited your equations to improve the presentation. You might want to consider adding a few words of explanation for why the value of $(1-F(t))\frac{t^2}{2}$ approaches $0$ as $t \to \infty$. Of course, $1-F(t) \to 0$, but $t^2$ is increasing without bound.... Mar 28, 2015 at 15:00

Note that, $$\frac{d}{dx} \int_x^{\infty} f(t) ~ dt = -f(x)$$ (If you do not understand, ask why, and I will show you.)

Now, rewrite the integral for $E[X^2]$ as follows, $$E[X^2] = \int_{-\infty}^{\infty} x^2 \frac{d}{dx}\left\{-\int_t^{\infty} f(t) ~ dt \right\} ~ dx$$

Now proceed with "partial integration". That is the main idea, maybe one has to adjust the limits correctly (to lazy to do that), but in either case, I leave that up to you.

• Could you please explain the first equation? Thanks. Mar 28, 2015 at 3:53
• Dear Mr. Freshman. Let $F(x)$ be an anti-derivative of $f(x)$. It follows that $\int_x^{\infty} f(t) ~ dt = F(t) \bigg|_x^{\infty} = F(\infty) - F(x)$. But $F(\infty) = 1$ (since this is the total area of a probability mass function). Therefore, that integral equates to $1-F(x)$. When you differentiate, the constant goes away and $F'(x) = f(x)$. Mar 28, 2015 at 4:01
• I see, thanks. But why does the lower limit in the bracket changes to t? Should it still be x? Mar 28, 2015 at 4:23
• Dear Mr. Freshman. The use of a new symbol, such as $t$, is to avoid notational sloppiness. If I write, $\int_x^{\infty} ~ f(t) ~ dt$, you understand that to mean, find anti-derivative of $f(t)$, in terms of $t$, and then substitute $\infty$ and $x$ for it. But if I write everything in terms of $x$, look at it, $\int_x^{\infty} f(x) ~ dx$. There is an $x$ in the limit and inside the integral, but the $x$ in the limit is not being integrated, so the notation is sloppy. Mar 28, 2015 at 4:26
• Why F(infinity)=1? Or should it be cdf rather than pmf? Mar 28, 2015 at 6:37