<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] put $x = \tan \theta$ given integral is
$$\int_{\frac{\pi}{4}}^{\frac{\pi}{2}} \frac{\sec^2 \theta}{\tan \theta \sec^2 \theta} = \frac{d(\sin \theta)}{\sin \theta} = \ln [|\sin \theta|]^{\frac{\pi}{2}}_{\frac{\pi}{4}} = 0-\ln \frac{1}{\sqrt{2}}=\ln \sqrt{2}$$
</s>