$\int_0^\infty\frac{\log x dx}{x^2-1}$ with a hint.

$$\int_0^{\infty} \dfrac{\log(x)}{1-x^2} dx = \int_0^{1} \dfrac{\log(x)}{1-x^2} dx + \int_1^{\infty} \dfrac{\log(x)}{1-x^2} dx$$ $$\int_1^{\infty} \dfrac{\log(x)}{1-x^2} dx = \int_1^0 \dfrac{\log(1/x)}{1-1/x^2} \left(-\dfrac{dx}{x^2} \right) = \int_1^0 \dfrac{\log(x)}{x^2-1} dx=\int_0^1 \dfrac{\log(x)}{1-x^2}dx$$ Hence, $$\int_0^{\infty} \dfrac{\log(x)}{1-x^2} dx = 2\int_0^{1} \dfrac{\log(x)}{1-x^2} dx$$ Now note that in $(0,1)$, we have $$\dfrac1{1-x^2}= \sum_{k=0}^{\infty} x^{2k} \,\,\,\,\,\,\,\, \text{(Geometric/Taylor series)}$$ $$\int_0^{1} \dfrac{\log(x)}{1-x^2} dx = \int_0^1 \left( \sum_{k=0}^{\infty} x^{2k} \right)\log(x) dx = \sum_{k=0}^{\infty} \int_0^1 x^{2k} \log(x) dx = -\sum_{k=0}^{\infty}\dfrac1{(2k+1)^2}$$ (If $\displaystyle \int_0^{1} \dfrac{\log(x)}{1-x^2} dx$, exists, we can afford to swap the integral and summation thanks, to dominated convergence theorem.)

Hence, $$\int_0^{\infty} \dfrac{\log(x)}{1-x^2} dx = - \sum_{k=0}^{\infty} \dfrac2{(2k+1)^2} =-\dfrac{\pi^2}4$$ Your integral is $$\int_0^{\infty} \dfrac{\log(x)}{x^2-1} dx = - \int_0^{\infty} \dfrac{\log(x)}{1-x^2} dx = \dfrac{\pi^2}4$$


Following the hint, let $$f(z) = \frac{\log z}{z^2-1}$$ where $\log$ is the principal branch of the complex logarithm. Since $z=1$ is a simple zero for $z^2-1$ and $\log 1 = 0$, the function $f$ has a removable singularity at $z=1$.

enter image description here

Integrate $f$ along the contour. It's easy to check (using standard estimates) that the integral of $f$ along the two quarter-circles tend to $0$ as $R \to \infty$ and $r \to 0^+$. The function $f$ is holomorphic on and inside the contour, so Cauchy's integral theorem will give you (after passing to the limit)

$$ \int_0^\infty \frac{\log x}{x^2-1}\,dx - \int_0^\infty \frac{\log it}{(it)^2-1}\,i\,dt = 0 $$ i.e. $$ \int_0^\infty \frac{\log x}{x^2-1}\,dx = -\int_0^\infty \frac{\log t + i\pi/2}{t^2+1}\,i \,dt = \frac{\pi^2}{4} \tag{*}$$

using $\int_0^\infty \frac{\log t}{1+t^2}\,dt = 0$ (see e.g. this question) and the elementary $\int_0^\infty \frac{1}{1+t^2}\,dt = \frac{\pi}{2}$.

Added As pointed out by robjohn, just take the real part of (*) to finish it off.


While similar to mrf's answer, this is simplified by equating the real and imaginary parts of $(3)$.


Since there are no singularities inside the contour in the hint, we get $$ \oint\frac{\log(z)}{z^2-1}\mathrm{d}z=0\tag{1} $$ Breaking the countour into four pieces as follows

$\hspace{4.5cm}$enter image description here

$(1)$ and the triangle inequality yield $$ \left|\color{#00A000}{\int_{1/R}^R\frac{\log(x)}{x^2-1}\mathrm{d}x} \color{#C00000}{-\int_{1/R}^R\frac{\log(ix)}{-x^2-1}\mathrm{d}ix}\right| \le\color{#0000FF}{\frac{\log(R)+\pi/2}{1-1/R^2}\frac{\pi}{2R}} +\color{#800080}{\frac{\log(R)+\pi/2}{R^2-1}\frac{\pi R}{2}}\tag{2} $$ which, as $R\to\infty$, guarantees $$ \begin{align} \int_0^\infty\frac{\log(x)}{x^2-1}\mathrm{d}x &=\int_0^\infty\frac{\log(ix)}{-x^2-1}\mathrm{d}ix\\ &=-i\int_0^\infty\frac{\log(x)}{x^2+1}\mathrm{d}x +\frac\pi2\int_0^\infty\frac1{x^2+1}\mathrm{d}x\tag{3} \end{align} $$ By equating the real and imaginary parts in $(3)$, we get not only the desired answer $$ \int_0^\infty\frac{\log(x)}{x^2-1}\mathrm{d}x=\frac{\pi^2}{4}\tag{4} $$ but also $$ \int_0^\infty\frac{\log(x)}{x^2+1}\mathrm{d}x=0\tag{5} $$