Show that $\int_0^\infty \frac{\ln x}{(x^2+1)(x^2-1)}dx=\frac{\pi^2}{8}$ How do I show that: $\int_0^\infty \frac{\ln x}{(x^2+1)(x^2-1)}dx=\frac{\pi^2}{8}$ using contours and residues
My attempt:
I know that the singular points are $i,-i,-1,1,0$
consider $f(z)= \frac{\ln z}{(z^2+1)(z^2-1)}$
and the branch $|z|>0$, $0<\theta<2\pi$ 
$u: z=r, \rho\le r \le R$ (u is the upper edge)
$-l: z=r, \rho\le r \le R$ (lower edge)
$\int_ufdz-\int_{-l}fdz=\int_\rho^R \frac{\ln r + i0}{(z^2+1)(z^2-1)}-\int_\rho^R \frac{\ln r + i2\pi}{(z^2+1)(z^2-1)}$
How do I continue from here? 
 A: First, enforcing the substitution $x\to 1/x$ reveals
$$\int_0^\infty \frac{\log(x)}{(x^2+1)(x^2-1)}\,dx=\int_0^\infty \frac{x^2\log(x)}{(x^2+1)(x^2-1)}\,dx\tag 1$$
From $(1)$ it is evident that  
$$\int_0^\infty \frac{\log(x)}{(x^2+1)(x^2-1)}\,dx=\frac12\int_0^\infty \frac{\log(x)}{x^2-1}\,dx\tag 2$$

We evaluate the integral $J$ defined by 
$$J=\oint_C \frac{\log^2(z)}{z^2-1}\,dz$$
where $C$ is the classical keyhole contour with (i) the branch cut along the non-negative real axis and (ii) with deformations around $z=1$.  Applying the residue theorem, it is easy to see that $J=i\pi^3$.  Therefore, we find that 
$$\begin{align}
J&=i\pi^3\\\\
&=\int_{0}^{\infty}\frac{\log^2(x)}{x^2-1}\,dx-\text{PV}\int_0^\infty \frac{\left(\log(x)+i2\pi\right)^2}{x^2-1}\,dx\\\\
&=-i4\pi\int_0^\infty \frac{\log(x)}{x^2-1}\,dx\\\\
&+\color{blue}{(4\pi^2)\text{PV}\left(\int_0^\infty \frac{1}{x^2-1}\,dx\right)}\\\\
&+\color{red}{(4\pi^2)\lim_{\epsilon \to 0^+}\int_{\pi}^{2\pi} \frac{1}{(1+\epsilon e^{i\phi})^2-1}\,(i\epsilon e^{i\phi})\,d\phi}\\\\
&=-i4\pi\int_0^\infty \frac{\log(x)}{x^2-1}\,dx+\color{blue}{0}+\color{red}{i2\pi^3}\tag 4
\end{align}$$
Finally, solving $(4)$ for the integral of interest yields
$$\frac12\int_0^\infty \frac{\log(x)}{x^2-1}\,dx=\frac{\pi^2}{8}$$ 


We now present an approach herein that relies on real analysis only.


Writing $\int_0^\infty \frac{\log(x)}{x^2-1}\,dx=\int_0^1 \frac{\log(x)}{x^2-1}\,dx+\int_1^\infty \frac{\log(x)}{x^2-1}\,dx$ and enforcing the substitution $x\to 1/x$ in the second integral, we find
$$\begin{align}
\int_0^\infty \frac{\log(x)}{(x^2+1)(x^2-1)}\,dx=\int_0^1 \frac{\log(x)}{x^2-1}\,dx\end{align}$$
We can use partial fraction expansion to write 
$$\begin{align}
\int_0^1 \frac{\log(x)}{x^2-1}\,dx&=-\frac12\int_0^1 \frac{\log(x)}{1+x}\,dx-\frac12\int_0^1 \frac{\log(x)}{1-x}\,dx\\\\
&=\frac12 \int_0^1 \frac{\log(1+x)}{x}\,dx-\frac12\int_0^1 \frac{\log(1-x)}{x}\,dx\\\\
&=\frac12 \sum_{n=1}^\infty \frac{(-1)^{n-1}}{n} \int_0^1 x^{n-1}\,dx+\frac12 \sum_{n=1}^\infty \frac{1}{n}\int_0^1 x^{n-1}\,dx\\\\
&=\frac12 \sum_{n=1}^\infty \frac{1-(-1)^n}{n^2}\\\\
&= \sum_{n=1}^\infty \frac{1}{(2n-1)^2}\\\\
&=\frac{\pi^2}{8}
\end{align}$$
Where we used $\sum_{n=1}^\infty\frac1{n^2}=\frac{\pi^2}{6}$ along with $\sum_{n=1}^\infty \frac{1}{(2n-1)^2}=\sum_{n=1}^\infty \frac{1}{n^2}-\sum_{n=1}^\infty \frac{1}{(2n)^2}=\frac34 \sum_{n=1}^\infty\frac1{n^2}=\frac{\pi^2}{8}$

And in THIS ANSWER, I showed using only real analysis that $\sum_{n=1}\frac1{n^2}=\frac{\pi^2}{6}$.

A: $\newcommand{\bbx}[1]{\,\bbox[8px,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{\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}$

With the $\ds{\ln}$ branch cut
  $\ds{\pars{\left.\ln\pars{z}\right\vert_{\ z\ \not=\ 0} = \ln\pars{\verts{z}} + \,\mrm{arg}\pars{z}\ic\,,\ -\pi < \,\mrm{arg}\pars{z} < \pi}}$, I'll evaluate
  $\ds{\oint_{\mrm{C}}{\ln\pars{z} \over z^{4} - 1}\,\dd z}$ in a quarter circumference in the first quadrant:

\begin{align}
\int_{0}^{\infty}{\ln\pars{x} \over x^{4} - 1}\,\dd x &
\,\,\,\stackrel{\mrm{as}\ \epsilon\ \to\ 0^{+}}{\sim}\,\,\,
-\,\Re\int_{\infty}^{1 + \epsilon}
{\ln\pars{y} + \pi\ic/2 \over y^{4} - 1}\,\ic\,\dd y -
\Re\int_{0}^{-\pi}{\ln\pars{\ic + \epsilon\expo{\ic\theta}} \over
\pars{\ic + \epsilon\expo{\ic\theta}}^{4} - 1}
\,\epsilon\expo{\ic\theta}\ic\,\dd\theta
\\[3mm] &
-\,\Re\int_{1 - \epsilon}^{0}
{\ln\pars{y} + \pi\ic/2 \over y^{4} - 1}\,\ic\,\dd y
\\[1cm] & \stackrel{\mrm{as}\ \epsilon\ \to\ 0^{+}}{\sim}\,\,\,
-\,{1 \over 2}\,\pi\,\mrm{P.V.}\int_{0}^{\infty}{\dd y \over y^{4} - 1} +
\Re\int_{-\pi}^{0}{\pi\ic/2 \over 4i^{3}\epsilon\expo{\ic\theta}}\,
\epsilon\expo{\ic\theta}\ic\,\dd\theta
\\[5mm] & \stackrel{\mrm{as}\ \epsilon\ \to\ 0^{+}}{\to}\,\,\,
-\,{1 \over 2}\,\pi\,\lim_{\delta \to 0^{+}}
\bracks{\int_{0}^{1 - \delta}{\dd y \over y^{4} - 1} +
\int_{1 + \delta}^{\infty}{\dd y \over y^{4} - 1}}
\\[5mm] & =
-\,{1 \over 2}\,\pi\,\lim_{\delta \to 0^{+}}
\bracks{\int_{0}^{1 - \delta}{\dd y \over y^{4} - 1} +
\int_{1/\pars{1 + \delta}}^{0}{\pars{-1/y^{2}}\dd y \over 1/y^{4} - 1}}
\\[5mm] & =
-\,{1 \over 2}\,\pi\,\lim_{\delta \to 0^{+}}
\bracks{\int_{0}^{1 - \delta}{\dd y \over y^{4} - 1} -
\int_{0}^{1/\pars{1 + \delta}}{y^{2} \over y^{4} - 1}\,\dd y}
\\[5mm] & =
-\,{1 \over 2}\,\pi\,\lim_{\delta \to 0^{+}}
\bracks{\int_{0}^{1 - \delta}{1 - y^{2} \over y^{4} - 1}\,\dd y -
\int_{1 - \delta}^{1/\pars{1 + \delta}}{y^{2} \over y^{4} - 1}\,\dd y} =
{1 \over 2}\,\pi\int_{0}^{1}{\dd y \over y^{2} + 1}
\\[5mm] & =
\bbx{\phantom{^{2}}\pi^{2} \over 8}
\end{align}
By simplicity, I omitted the integral along the arc which vanishes out as the arc radius $\ds{R \to \infty}$. Indeed, as $\ds{R \to \infty}$ the magnitude of such integral behaves as $\ds{\pars{\pi/2}\ln\pars{R}/R^{3}}$.

Note that

\begin{align}
&0 < \verts{\int_{1 - \delta}^{1/\pars{1 + \delta}}{y^{2} \over y^{4} - 1}
\,\dd y} <
\verts{{1 \over 1 + \delta} - \pars{1 - \delta}}
{1/\pars{1 + \delta}^{2} \over 1 - \pars{1 - \delta}^{2}}
\,\,\,\stackrel{\mrm{as}\ \delta\ \to\ 0^{+}}{\to}\,\,\,{\large 0}
\end{align}
A: Hint : You should consider $$f(z) = \frac{\ln^2(z)}{(z^2+1)(z^2-1)}$$ where the logarithm is defined with the argument $\in [0,2\pi)$. Then use the standard keyhole contour. 
A: Observe that 
\begin{eqnarray*}
\frac{1}{(x^2+1)(x^2-1)}=\frac{1}{2(x^2-1)} + \frac{-1}{2(x^2+1)}
\end{eqnarray*}
So the original integral splits into the following two integrals
\begin{eqnarray*}
I_1=\int_{0}^{\infty} \frac{ln(x)}{2(x^2+1)} \\
I_2=\int_{0}^{\infty} \frac{ln(x)}{2(x^2-1)} .\\
\end{eqnarray*}
Both of these integrals can be evaluated by spliting the inteval into $[0,1]$ and $[1, \infty)$ and then doing the substitution $x=1/y$. The first integral is zero and the second integral will be 
\begin{eqnarray*}
I_1=0 \\
I_2=\int_{0}^{1} \frac{ln(x)}{(x^2-1)} dx \\
\end{eqnarray*}
Now geometrically expand $\frac{1}{(x^2-1)}$ and use
\begin{eqnarray*}
\int_{0}^{1} x^{n} \ln(x) dx =\frac{-1}{(n+1)^2} \\
I_2=-\int_{0}^{1} \sum_{n=0}^{\infty} x^{2n} ln(x) dx = \sum_{n=0}^{\infty} \frac{1}{(2n+1)^2} \\
\end{eqnarray*}
It well known that $\sum_{n=0}^{\infty} \frac{1}{(2n+1)^2}=\color{red}{\frac{\pi^2}{8}}$.
