Suppose $X$ is a nonnegative and continuous random variable with a survival function $S(x)$. Show that
$$\mathsf{Var}(X)=2\int_0^\infty tS(t) \, dt-\left( \int_0^\infty S(t) \, dt\right)^2$$
Using the fact that
$$f(x) =−\frac{dS(x)}{dx}$$
we have that
$$\begin{align*} \mathsf{Var}(X) &=\mathsf{E}(X^2)-\mathsf{E}(X)^2\\\\ &=\int_0^\infty t^2 f(t)\,dt-\left(\int_0^ \infty tf(t) \, dt \right)^2 \\\\ &=-\int_0^\infty t^2 \, dS(t)-\left(\int_0^\infty t \, dS(t) \right)^2 \\\\ &=-\left(t^2 S(t)\bigg\rvert_0^\infty-\int_0^\infty 2tS(t) \, dt \right) - \left(tS(t)\bigg\rvert_0^\infty-\int_0^\infty S(t) \, dt \right)^2 \end{align*}$$
I could get the desired result by showing
$$t^2 S(t) \bigg\rvert_0^\infty = tS(t) \bigg\rvert_0^\infty = 0 $$
but how do we know if $t$ and $t^2$ go to $\infty$ slower than $S(t)$?