Let $X$ be a continuous random variable with CDF $F$. Suppose that $P(X>0)=1$ and that $E(X) < \infty$. Show that $E(X) = \int_{0}^{\infty}P(X>x)dx$
I start out with the definition of expectation: $$E(X) = \int_{-\infty}^{\infty}xdF(x)$$ Proceed with intergration by parts, letting $u =x$ and $v' = dF(X)$: $$E(X)=xF(x)\rvert_{-\infty}^{\infty}-\int_{-\infty}^{\infty}F(x)dx$$ $$=xF(x)\rvert_{-\infty}^{\infty}-\int_{-\infty}^{\infty}[1-P(X>x)]dx$$ let $t \rightarrow \infty$: $$E(X)=\lim_{t\rightarrow\infty}tF(t)-\lim_{t\rightarrow\infty}-tF(-t)-[\lim_{t\rightarrow\infty}t-\lim_{t\rightarrow\infty}-t]+\int_{-\infty}^{\infty}P(X>x)dx$$ $$\lim_{t\rightarrow\infty}t-0-\lim_{t\rightarrow\infty}2t+\int_{-\infty}^{0}P(X>x)dx +\int_{0}^{\infty}1dx$$ $$=\int_{-\infty}^{0}P(X>x)dx$$ I am not sure where my faulty logic is here, but I presume I did something naughty with the limits (I am quite rusty on my calculus), or I am misunderstanding how to use the fact that $P(X>0)=1$. Why did I end up with $\int_{-\infty}^{0}P(X>x)dx$ and not $\int_{0}^{\infty}P(X>x)dx$?