I am being asked to prove the following: $$E[X] = \int_0^{\infty}xf_x(x)dx = \int_0^{\infty}(1-F_x(x))dx$$
for a distribution defined on $x\ge0$. Although I can find several related questions on math stack exchange, they all involve concepts Riemann-Stieltjes integrals which were never discussed in this course; there must be an easier way to solve the problem. Therefore, I attempted to solve the problem using simple calculus and came up with this:
$$E[X] = \int_0^{\infty}xf_x(x)dx =[x\int f_x(x)dx-\int\int f_x(x)dxdx]_{x=0}^{x=\infty} = [xF_x(x)-\int F_x(x)dx]_{x=0}^{x=\infty} = \lim_{x\to\infty}xF_x(x) - \lim_{x\to0}xF_x(x) - \int_0^{\infty}F_x(x)dx = \lim_{x\to\infty}xF_x(x) -\int_0^{\infty}F_x(x)dx$$
So if the above statement is true, then doesn't that imply that we are trying to show that because $\lim_{x\to\infty}(F_x(x))=1$ then $\int_0^{\infty}1dx = \lim_{x\to\infty}(xF_x(x))$? Is it simply enough to state that $$\int_0^{\infty}1dx = \lim_{x\to\infty}x - \lim_{x\to0}x = \lim_{x\to\infty}x = (\lim_{x\to\infty}x)(\lim_{x\to\infty}F_x(x)) = \lim_{x\to\infty}(xF_x(x))$$
I am concerned because it feels like I am equating two clearly infinite terms which sounds problematic in a formal proof. Is there another way to do this?