The following problem comes from page 184 Introduction to Probability 2nd edition, by Dimitri P. Bertsekas and John N. Tsitsiklis.
My questions:
$(1)$. When $X$ is continuous, we might have $\int_{0}^{+\infty}\mathbf{P}(X>x)=+\infty $ and $\int_{0}^{+\infty}\mathbf{P}(X<- x)=+\infty $ ( Considering Cauchy distribution:the cumulative distribution function $F(x)=\frac{1}{\pi}(\arctan x +\frac{\pi}{2})$ ). In that case,$\int_{0}^{+\infty}\mathbf{P}(X>x) - \int_{0}^{+\infty}\mathbf{P}(X<- x)=(+\infty)-(+\infty)$ makes nonsense. Whether the equation $\mathbf{E}[X]=\int_{0}^{+\infty}\mathbf{P}(X>x)-\int_{0}^{+\infty}\mathbf{P}(X<- x)$ in Problem $3^{*}$ have already implied both $\int_{0}^{+\infty}\mathbf{P}(X> x)$ and $\int_{0}^{+\infty}\mathbf{P}(X<- x)$ are convergence ?
$(2).$ In the solution of Problem $3^{*}$, why the equality $$\int_{0}^{\infty}\left(\int_{x}^{\infty}f_{X}(y)dy\right)dx=\int_{0}^{\infty}\left(\int_{0}^{y}f_{X}(y)dx\right)dy$$ holds from the views of Improper Riemann integrals ? It seems like Fubini's theorem in Riemann Integrals. Whether the Fubini's theorem still holds in Improper Riemman integrals ? I have little knowledge about Lebesgue integrals and Lebesgue measures, but I gauss the equality maybe hold in views of Lebesgue integrals.
I feel it necessary to revise as "Let $X$ be a discrete or continuous random variable with the expected value is well-defined (viz.$\int_{0}^{+\infty}|x|f_{X}(x)dx<+\infty$), show that $\mathbf{E}[X]=\int_{0}^{+\infty}\mathbf{P}(X> x)-\int_{0}^{+\infty}\mathbf{P}(X<- x).$ " From the revision,we ensure both $\int_{0}^{+\infty}\mathbf{P}(X> x)$ and $\int_{0}^{+\infty}\mathbf{P}(X<- x)$ are convergence,since $\int_{0}^{+\infty}|x|f_{X}(x)dx<+\infty.$ And then,if $\int_{0}^{+\infty}\mathbf{P}(X> x)<+\infty$,we have no difficulty to proof $\int_{0}^{+\infty}\left(\int_{x}^{+\infty}f_{X}(y)dy\right)dx=\int_{0}^{+\infty}\left(\int_{0}^{y}f_{X}(y)dx\right)dy$ in the views of Improper Riemann integrals.
The final conclusion:Let $X$ be a discrete or continuous random variable. Its expected value $\mathbf{E}[X]$ is well-defined (viz.$\int_{0}^{+\infty}|x|f_{X}(x)dx<+\infty$)$\Longleftrightarrow$Both $\int_{0}^{+\infty}\mathbf{P}(X> x)$ and $\int_{0}^{+\infty}\mathbf{P}(X<- x)$ are convergence.According to this conclusion,the Expectation of Cauchy distribution can not be well-defined.