For exam preparation I try to solve the following question:
Does the expected value exist for the density function $\frac{1}{\pi} \int_{-\infty}^{\infty} \frac{1}{x^2+1} \; \mathrm{d}x$
As I understand it I need to show that $\int_{-\infty}^{\infty}xf(x)\;dx$ converges
$$ \text{finding antiderivative}\\ \\ \frac{1}{\pi} \int_{-\infty}^{\infty} \frac{x}{x^2+1} \; \mathrm{d}x\\ \\ \text{substitute}\;u = x^2+1, du = 2x\\ \\ \frac{1}{2\pi} \int_{-\infty}^{\infty} \frac{1}{u} \; \mathrm{d}u = \frac{ln(\lvert u \rvert)}{2\pi} \Big|_{-\infty}^{\infty}\\ \\ \text{back substitution I get}\\ \\ \frac{ln(x^2+1)}{2\pi} \Big|_{-\infty}^{\infty} = 0 $$
So the integral exist and converges. What I am doing wrong here?
Any comment is appreciated. Thank you.