$\int_0^\infty\frac{\log x dx}{x^2-1}$ with a hint. I have to calculate $$\int_0^\infty\frac{\log x dx}{x^2-1},$$
and the hint is to integrate $\frac{\log z}{z^2-1}$ over the boundary of the domain $$\{z\,:\,r<|z|<R,\,\Re (z)>0,\,\Im (z)>0\}.$$
I don't understand. The boundary of this domain has a pole of the integrand in it, doesn't it? Doesn't it make this method useless?
 A: 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$.

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.
A: 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}$
$(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}
$$
A: This is somewhat similar to the answer by user17762, but instead I make use of the dilogarithm function, which can be related to the infinite series used in that answer:
$$ \operatorname{Li_2}(z) = -\int_0^z \frac{\ln(1-t)}{t} dt $$

$$ \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 $$
Substituting $u=\frac{1}{x}$ into the second integral yields:
$$ \int_1^\infty \frac{\log x}{x^2-1} dx = \int_0^1 \frac{\log x}{x^2-1} dx $$
$$ \int_0^\infty \frac{\log x}{x^2-1} dx = 2 \int_0^1 \frac{\log x}{x^2-1} dx $$
Now substituting $u=\frac{1-x}{1+x}$ yields:
\begin{align*}
\int_0^\infty \frac{\log x}{x^2-1} dx = 2 \int_0^1 \frac{\log x}{x^2-1} dx &= -\int_0^1 \frac{\log (1-u)}{u} du + \int_0^1 \frac{\log (1+u)}{u} du \\
&= -\int_0^1 \frac{\log (1-u)}{u} du + \int_0^{-1} \frac{\log (1-v)}{v} dv \\
&= \operatorname{Li_2}(1) - \operatorname{Li_2}(-1) \\
&= \frac{\pi^2}{6} - \frac{-\pi^2}{12} \\
&= \frac{\pi^2}{4}
\end{align*}
A: $$\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$$
A: Note
$$I(a)=\int_0^\infty\frac{\ln x}{(x+1)(x+a)}dx\overset{x\to\frac a x}
= \frac{1}{2}\int_0^\infty\frac{\ln a}{(x+1)(x+a)}dx= \frac{\ln^2a}{2(a-1)}
$$
Then
$$\int_0^\infty\frac{\ln x}{x^2-1}dx=I(-1)=-\frac14 [\ln(e^{i\pi})]^2=\frac{\pi^2}4
$$
