<s>[INST] Evaluating $\int_1^\infty \frac{1}{x(x^2+1)}\ dx$ $$I=\int_1^\infty \frac{1}{x(x^2+1)}\ dx$$  
I tried to use partial fractions, but am unsure why I cann't evaluate it using partial fractions. Would appreciate any explanation about which step is incorrect.  
$$\frac{1}{x(x^2+1)} = \frac{1}{2} \left(\frac{1}{x}-\frac{1}{x+i} -\frac{1}{x-i}\right)$$
So
  $$I = \frac{1}{2}\int_1^\infty\frac{1}{x}-\frac{1}{x+i} -\frac{1}{x-i} \ dx \\ = \frac{1}{2}\left[\log |x| - \log(|x+i|) - \log(|x-i|)\right]_1^\infty  
$$
which evaluates to be $\infty$.
 [/INST] By enforcing the substitution $x=\frac{1}{z}$ the result is straightforward to find:
$$ \int_{1}^{+\infty}\frac{dx}{x(x^2+1)}=\int_{0}^{1}\frac{z\,dz}{z^2+1}=\left[\frac{1}{2}\log(1+z^2)\right]_{0}^{1}=\color{red}{\frac{\log 2}{2}}.$$
</s>