Integral $\int_0^\infty \frac{\ln(x)}{1-x^2} \; dx$ using residue theorem I want to compute the integral
$$
I = \int_0^\infty \frac{\ln(x)}{1-x^2} \; dx.
$$
Here is my attempt: First, in order to extend the integral to the interval $(-\infty,\infty)$ I write
$$
I = \frac{1}{2}\int_0^\infty \frac{\ln(x^2)}{1-x^2} \; dx = \frac{1}{4}\int_{-\infty}^\infty \frac{\ln(x^2)}{1-x^2} \; dx.
$$
Now, let $R>2$ and $0 < \epsilon< 1/2$ and define
\begin{align*}
C_0 &= \{Re^{it} \, : \, 0\leq t\leq \pi\}\\
C_1 &= \{\epsilon e^{it} \, : \, 0\leq t\leq \pi\}\\
C_2 &= \{-1+\epsilon e^{it} \, : \, 0\leq t\leq \pi\}\\
C_3 &= \{1+\epsilon e^{it} \, : \, 0\leq t\leq \pi\}\\
C_4 &= [-R,R]\setminus(]-1-\epsilon,-1+\epsilon[\cup ]-\epsilon,\epsilon[\cup]1-\epsilon,1+\epsilon[),
\end{align*}
and write
$$
C = C_0 \cup C_1 \cup C_2\cup C_4 \cup C_4.
$$
The function $f(z) = \frac{\ln(z^2)}{1-z^2}$ is holomorphic, where $\ln$ denotes a branch of the logarithm. Then, we have that
$$
\int_C f(z)\; dz = 0,
$$
hence
$$
\int_{C_4} f(z)\; dz = -\sum_{j=0}^3 \int_{C_j} f(z)\; dz,
$$
and
$$
\int_{-\infty}^\infty \frac{\ln(x^2)}{1-x^2} \; dx = \lim_{\begin{subarray}{c} \epsilon\to 0 \\ R\to\infty  \end{subarray}} -\sum_{j=0}^3 \int_{C_j} f(z)\; dz.
$$
My problem (if the above is correct) is that I'm unable to compute the integrals over the curves $C_j$. I think that the integral over the curve $C_0$ tends to $0$ as $R\to\infty$ but I cannot have information about the remaining ones.
 A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\on}[1]{\operatorname{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
Integrate
$\ds{\bbox[5px,#ffd]{\oint_{\cal C}
{\ln\pars{z} \over 1 - z^{2}}\dd z}}$ over a quarter circle -of radius $\ds{R \to \infty}$- in the complex plane first quadrant: There isn't any pole "inside" $\ds{\cal C}$:

\begin{align}
0 & = \oint_{\cal C}
{\ln\pars{z} \over 1 - z^{2}}\dd z =
\int_{0}^{\infty}{\ln\pars{x} \over 1 - x^{2}}\dd x
\\[2mm] + &\
\overbrace{\left.\int_{\theta\ =\ 0}^{\theta\ =\ \pi/2}\
{\ln\pars{z} \over 1 - z^{2}}\dd z\,\right\vert_{\,z\ =\ R\exp\pars{\ic\theta} \atop R \to \infty}}^{\ds{=\ 0}}\
\quad \quad+\
\int_{\infty}^{0}{\ln\pars{y} + \pi\ic/2 \over 1
+ y^{2}}\,\ic\dd y
\\[5mm] & =
\int_{0}^{\infty}{\ln\pars{x} \over 1 - x^{2}}\dd x -
\ic\int_{0}^{\infty}{\ln\pars{y} \over 1 + y^{2}}\,\dd y +
{\pi \over 2}\
\underbrace{\int_{0}^{\infty}{\dd y \over 1 + y^{2}}}_{\ds{\pi \over 2}}
\end{align}

Take $\ds{\Re}$eal $\ds{\cal P}$art in both sides
$\ds{\implies
\bbx{\int_{0}^{\infty}{\ln\pars{x} \over 1 - x^{2}}\dd x = -\,{\pi^{2} \over 4}}}$.
A: For large $R$,$$\int_{C_0}f(z)dz=\int_0^\pi f(Re^{it})iRe^{it}dt=\int_0^\pi\frac{2\ln R+2it}{1-R^2e^{2it}}iRe^{it}dt\sim-\frac{\ln R}{R}\int_0^\pi\frac{2idt}{e^{it}}\to0.$$The small arcs are clockwise, so pick up a $-$ sign. For small $\epsilon$,$$\int_{C_1}f(z)dz=-\int_0^\pi\frac{2\ln\epsilon+2it}{1-\epsilon^2e^{2it}}i\epsilon e^{it}dt\sim-\epsilon\ln\epsilon\int_0^\pi 2ie^{it}dt\to0.$$Whereas a careful branch choice for $\ln z^2=2\ln z$ is required for $z\approx-1<0$ viz.$$\int_{C_2}f(z)dz=-\int_0^\pi\frac{\ln[(\epsilon e^{it}-1)^2]}{1-(\epsilon e^{it}-1)^2}i\epsilon e^{it}dt=-\int_0^\pi\frac{2\pi i+2\epsilon e^{it}}{1-(\epsilon e^{it}-1)^2}i\epsilon e^{it}dt\sim-\int_0^\pi\pi dt=\pi^2,$$we conclude with the more straightforward$$\int_{C_3}f(z)dz=-\int_0^\pi\frac{\ln[(\epsilon e^{it}+1)^2]}{1-(\epsilon e^{it}+1)^2}i\epsilon e^{it}dt\sim\epsilon\int_0^\pi ie^{it}dt\to0$$so$$I=\frac14\int_{\Bbb R}f(x)dx=-\frac{\pi^2}{4}.$$
