Evaluate $\int_0^{\infty} \frac{\log x }{(x-1)\sqrt{x}}dx$ (solution verification)
I tried to find the integral
$$I=\int_0^{\infty} \frac{\log x }{(x-1)\sqrt{x}}dx \tag1$$
I substituted $x=t^2, 2tdt=dx$ and chose $\log x$ and $\sqrt{x}$ to be principal values. We have
$$\int_0^{\infty} \frac{\log x}{(x-1)\sqrt{x}}dx=2 \int_0^{\infty} \frac{\log t^2}{(t^2-1)}dt \tag2$$
Then because it is an even function
$$2 \int_0^{\infty} \frac{\log t^2}{(t^2-1)}dt=2 \int_{-\infty}^{\infty} \frac{\log t}{(t^2-1)}dt \tag3$$
In the complex plane $z=1$ is a removable singularity of this function and $z=-1$ is a pole. So I chose the contour
$$\oint_\gamma = \int_{-R}^{-1-r}+ \int_{C_1}+\int_{-1+r}^{R}+\int_{C_2}=0 \tag4$$
where $C_1$ is a semi-circle $z=-1+r e^{i\phi}, \pi \ge \phi \ge 0$ and $C_2$ a semi-circle $z=R e^{i\phi}, 0 \le \phi \le \pi$. In the limit $R\to\infty, r\to 0$ the integral on $C_2$ is $0$ and $\int_{-R}^{-1-r}+\int_{-1+r}^{R}=\int_{-\infty}^{\infty}$ so we need to find
$$\lim_{r\to0} \int_{C_1} \frac{\log z}{(z^2-1)}dz = 0 \tag5$$
So $I$ should be zero. But if we compare with this question, we see it isn't. Where is my mistake?
EDIT 2: For clarity, I will compile all my corrections as an answer. Thanks to everyone who helped in the comments (and the other answers, too, of course)!
Solution 1:
The integrand is always positive except at $x=1$, where it is not defined. Hence, the integral cannot be zero. Below is an easy way to obtain the answer. $$I = \int_0^{\infty} \dfrac{\ln(x)}{(x-1)\sqrt{x}}dx = \int_0^1 \dfrac{\ln(x)}{(x-1)\sqrt{x}}dx + \int_1^{\infty} \dfrac{\ln(x)}{(x-1)\sqrt{x}}dx$$ $$\int_1^{\infty} \dfrac{\ln(x)}{(x-1)\sqrt{x}}dx = \int_1^0 \dfrac{\ln(1/x)}{(1/x-1)1/\sqrt{x}} \dfrac{-dx}{x^2} = \int_0^1 \dfrac{\ln(x)}{(x-1)\sqrt{x}}dx$$ Hence, $$I = 2\int_0^1 \dfrac{\ln(x)}{(x-1)\sqrt{x}}dx = -2 \sum_{n=0}^{\infty} \int_0^1 x^{n-1/2}\ln(x)dx = 2 \sum_{n=0}^{\infty} \dfrac1{(n+1/2)^2} = 8 \sum_{n=0}^{\infty}\dfrac1{(2n+1)^2}$$ Hence, $$I = \pi^2$$
Solution 2:
From your line (3), we have \begin{align} \int_{-\infty}^{\infty}\frac{\ln(t^2)}{t^2 - 1}dt &= \int_{\Gamma}f(t) + \int_{\gamma_1}f(t) + \int_{\gamma_2}f(t) + \int_{\gamma_3}f(t) \end{align} if we consider a key hole contour as picture below.
Let radius of $\Gamma$ be $R$, $\gamma_1$ be $\epsilon$, $\gamma_2$ be $\delta_2$, and $\gamma_3$ be $\delta_3$ be $$ f(z) = \frac{\ln(z^2)}{z^2 - 1} = \frac{2(\ln|z| + i\arg(z))}{z^2-1} $$ As $R\to\infty$, $\int_{\Gamma}\to 0$, and as $\epsilon\to 0$, $\int_{\gamma_1}\to 0$ by the estimation lemma. \begin{align} \int_0^{\infty}\frac{\ln(x)}{(x-1)\sqrt{x}}dx &= 2\int_{-\infty}^{\infty}\frac{\ln(z)}{z^2-1}dz\\ &=\int_{\gamma_2}f + \int_{\gamma_3}f\\ &= \pi i\text{Res}(f; -1) - \pi i\text{Res}(f; -1)\\ \end{align} the second residue at $-1$ is negative for being in the lower half.