Consider the integral $$\begin{align*} \int_{-\infty}^{\infty} \frac{\ln(1+x^{2})}{1+x^{2}} \ dx \end{align*}$$ Let $$\begin{align*} f(z) = \frac{\ln(1+z^{2})}{1+z^{2}} \end{align*}$$ I want to compute this integral by using residue. Since the integrand has no singularity on $\mathbb{R}$ , I consider the contour:
Then we have $$\begin{align*}
\left( \int_{-R}^{R} + \int_{\gamma_{1}} + \int_{\psi_{1}} + \int_{\gamma_{\rho} -} + \int_{\psi_{2}} + \int_{\gamma_{2}} \right) \frac{\ln(1+z^{2})}{1+z^{2}} \ dz = 0
\end{align*}$$ since there's no singularity inside the contour.
Then I think I can estimate that $$\begin{align*} \lim\limits_{R\to \infty} \int_{\gamma_{1}} \frac{\ln(1+z^{2})}{1+z^{2}} \ dz =0 \end{align*}$$ and $$\begin{align*} \lim\limits_{R \to \infty} \int_{\gamma_{2}} \frac{\ln(1+z^{2})}{1+z^{2}} \ dz =0 \end{align*}$$ and $$\begin{align*} \lim\limits_{\rho\to 0} \int_{\gamma_{\rho}} \frac{\ln(1+z^{2})}{1+z^{2}} \ dz =0 \end{align*}$$ Thus, we only need to consider the integration on $\psi_{1}$ and $\psi_{2}$.
Since $\pm i$ are branch point of $\ln(1+z^{2})$ . I define that $$\begin{align*} \arg(z-i) \in \left( \frac{\pi}{2}, \frac{5\pi}{ 2} \right) \\ \arg(z+i) \in \left( -\frac{\pi}{2} , \frac{3\pi }{2} \right) \end{align*}$$ Then on $\psi_{1}$ , we have $$\begin{align*} \int_{\psi_{1}} \frac{\ln|1+z^{2}| + i (\arg(z-i)+ \arg(z+i) )}{1+z^{2}} \ dz = \int_{\psi_{1}} \frac{\ln|1+z^{2}|}{1+z^{2}} \ dz + \int_{\psi_{1}} \frac{3\pi i}{1+z^{2}} \ dz \end{align*}$$ and $$\begin{align*} \int_{\psi_{2}} \frac{\ln|1+z^{2}| + i (\arg(z-i)+ \arg(z+i) )}{1+z^{2}} \ dz = \int_{\psi_{2}} \frac{\ln|1+z^{2}|}{1+z^{2}} \ dz+\int_{\psi_{2}} \frac{\pi i}{1+z^{2}} \ dz \end{align*}$$ Since $\psi_{1}$ and $\psi_{2}$ has opposite direction, we have the sum will be $$\begin{align*} -2\pi i\int_{\psi_{2}} \frac{1}{1+z^{2}} \ dz \end{align*}$$ where $z=iy$ . Thus, we only need to consider $$\begin{align*} -2\pi i \int_{1}^{\infty} \frac{1}{1+(iy)^{2}} i\ dy \end{align*}$$ However, the integral $$\begin{align*} \int_{1}^{\infty} \frac{dy}{1-y^{2}} \end{align*}$$ is not convergent.
What goes wrong here? Any help on this? Or can you just post the solution? Thanks!