<s>[INST] contour integration of $\int_0^\infty \frac{\ln(x)}{x^2-1}dx$ I asked for a problem for few days ago, regarding integration of 
$$I=\int_0^\infty \frac{\ln(x)}{x^2-1}dx$$
I know that I could do the substitution $x=it$ and do the integral where the denominater is $x^2+1$ and so on... But I tried anyway to create a contour and compute my integral. Down below my contour $C$ can be seen.

Let $f(z)=\ln(z)/(z^2+1)$. I compute my residue and obtain 0. I.e. $\oint_C f(z)dz=0$. The following are also giving me zero, i.e. $$\begin{align} 
\int_{\gamma_R}f(z)=0\\
\int_{\gamma_r}f(z)=0
\end{align}$$
by the estimation lemma. So now my integral is,
$$0=e^{\pi/3i}\int_r^R \frac{\ln|z|+\pi/3i}{z^2-1}dz+e^{2\pi/3i}\int_r^R \frac{\ln|z|+2\pi/3i}{z^2-1}dz$$
I rewrite the above to
$$0=(e^{\pi/3i}+e^{2\pi/3i})\int_r^R \frac{\ln(x)}{z^2-1}dz+(\frac{\pi}{3}ie^{\pi i/3}+\frac{2\pi}{3}ie^{2\pi i/3})\int_r^R \frac{1}{z^2+1}dz$$
And calculating the above gives me,
$$\int_r^R \frac{\ln(x)}{z^2-1}dz=\frac{\pi^2}{4}+\frac{i\sqrt{3}\pi^2}{36}$$
But if I compute the integral $I$ in Maple, I obtain $I=\frac{\pi^2}{4}$. My questions:


*

*Are my contour plot correct?

*Are my integrals correct, i.e. arc and residue?

*If yes to 1. and 2. Can I just drop the imaginary part and just use the real part?

 [/INST] \begin{eqnarray*}
\int_0^\infty\int_0^\infty\frac{dxdy}{(1+y)(1+x^2y)}
&=&\int_0^\infty\frac{dy}{1+y}\int_0^\infty\frac{dx}{1+x^2y}\\
&=&\int_0^\infty\frac{dy}{1+y}\int_0^\infty\frac{1}{y}\frac{dx}{\frac{1}{y}+x^2}\\
&=&\int_0^\infty\frac{dy}{1+y}\int_0^\infty\frac{1}{y}\frac{1}{\frac{1}{\sqrt{y}}}arctan \frac{x}{\frac{1}{\sqrt{y}}}|_0^\infty\\
&=&\frac{\pi}{2}\int_0^\infty\frac{dy}{\sqrt{y}(1+y)}\\
&=&\frac{\pi}{2}2\int_0^\infty\frac{dt}{1+t^2}\\
&=&\frac{\pi^2}{2}
\end{eqnarray*}
\begin{eqnarray*}
\int_0^\infty\int_0^\infty\frac{dxdy}{(1+y)(1+x^2y)}
&=&\int_0^\infty\frac{dx}{1-x^2}\int_0^\infty\left(\frac{x^2}{1+x^2y}-\frac{1}{1+y}\right)dy\\
&=&\int_0^\infty\frac{1}{1-x^2}\left(\ln\frac{1+x^2y}{1+y}\big|_0^\infty\right)dx\\
&=&2\int_0^\infty\frac{\ln x dx}{1-x^2}
\end{eqnarray*}
Thus
\begin{eqnarray*}
\int_0^\infty\frac{\ln x dx}{1-x^2}=\frac{\pi^2}{4}.
\end{eqnarray*}
</s>