Compute $\int_0^\infty \frac{\log(x)}{\sqrt{x}(x+1)} \ dx$ using the Residue Theorem

complex-analysisimproper-integralsresidue-calculus

I have made the following attempt (I won't put every detail, but if necessary, I will edit the question).

I consider $\Gamma_{R,\varepsilon}$ as the following path:

enter image description here

and consider computing $\int_\Gamma \frac{\log^2(x)}{\sqrt{x}(x+1)} \ dx$:

\begin{equation}
\begin{aligned}
2\pi i\operatorname{Res}\left(\frac{\log^2(x)}{\sqrt{x}(x+1)},-1\right) & = \lim_{\substack{R\to\infty \\ \varepsilon\to0^+}}\int_\Gamma \frac{\log^2(x)}{\sqrt{x}(x+1)} \ dx = \int_0^\infty \frac{\log^2(x)}{\sqrt{x}(x+1)} \ dx – \int_0^\infty \frac{(\log(x)+2\pi i)^2}{\sqrt{x}(x+1)} = \\
& = \int_0^\infty \frac{\log^2(x)-\log^2(x)-4\pi i \log(x) + 4\pi^2}{\sqrt x(x+1)}\ dx = \int_0^\infty \frac{-4\pi i \log(x) + 4\pi^2}{\sqrt x(x+1)}\ dx
\end{aligned}
\end{equation}

Therefore,

\begin{equation}
\begin{aligned}
\int_0^\infty \frac{\log(x)}{\sqrt{x}(x+1)} \ dx & = -\frac{1}{4\pi i}\left( 2\pi i\operatorname{Res}\left(\frac{\log^2(x)}{\sqrt{x}(x+1)},-1\right) – \int_0^\infty \frac{4\pi^2}{\sqrt{x}(x+1)\ dx} \right) \\
& = -\frac 12 \operatorname{Res}\left(\frac{\log^2(x)}{\sqrt{x}(x+1)},-1\right)-\pi i\int_0^\infty \frac{1}{\sqrt{x}(x+1)}\ dx = \\
& = \frac 12 \pi^2i – \pi^2i = -\frac 12\pi^2i
\end{aligned}
\end{equation}

If I compute the original integral in a calculator, the result is $0$. Could anyone please help me out telling me what is wrong with my reasoning?

Best Answer

On the "lower" part of the branch cut we have

$$\begin{align} \int_{\gamma_3} \frac{\log^2(z)}{\sqrt{z}(z+1)}\,dz&=-\int_0^\infty\frac{(\log(x)+i2\pi)^2}{\sqrt{xe^{i2\pi}}(x+1)}\,dx\\\\ &=\int_0^\infty \frac{(\log(x)+i2\pi)^2}{\sqrt{x}(x+1)}\,dx \end{align}$$

This might not be fit for purpose here.

But we also have on the lower branch cut that

$$\begin{align} \int_{\gamma_3} \frac{\log(z)}{\sqrt{z}(z+1)}\,dz&=-\int_0^\infty\frac{(\log(x)+i2\pi)}{\sqrt{xe^{i2\pi}}(x+1)}\,dx\\\\ &=\int_0^\infty \frac{(\log(x)+i2\pi)}{\sqrt{x}(x+1)}\,dx \end{align}$$

Therefore, we find that

$$\begin{align} 2\int_0^\infty \frac{\log(x)}{\sqrt{x}(x+1)}\,dx+2\pi i \int_0^\infty \frac{1}{\sqrt{x}(x+1)\,dx}&=2\pi i \text{Res}\left(\frac{\log(z)}{\sqrt{z}(z+1)}, z=-1\right)\\\\ &=2\pi i \frac{\log(e^{i\pi})}{\sqrt{e^{i\pi}}}\\\\ &=i2\pi^2\tag1 \end{align}$$

Equating the real and imaginary parts of the right and left hand sides of $(1)$, we find that

$$\int_0^\infty \frac{\log(x)}{\sqrt{x}(x+1)}\,dx=0$$

and that

$$\int_0^\infty \frac{1}{\sqrt{x}(x+1)}\,dx=\pi$$