<s>[INST] 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? 
 [/INST] 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}$.

</s>