Find $\int_{0}^{\infty} \frac{\log(x) }{\sqrt{x} (x+1)^{2}}\,dx$

METHODOLGY $1$: CONTOUR INTEGRATION

Enforce the substitution $x\mapsto x^2$ to find that

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


Let $f(z)$ be given by

$$f(z)=\oint_C \frac{\log^2(z)}{(z^2+1)^2}\,dz\tag2$$

where we choose to cut the plane along the positive real axis and where $C$ is the classical keyhole contour.


We then have from $(2)$

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


The left-hand side of $(3)$ becomes

$$\begin{align} \int_0^\infty \frac{\log^2(x)-\left(\log(x)+i2\pi\right)^2}{(x^2+1)^2}\,dx&=-i4\pi\int_0^\infty \frac{\log(x)}{(x^2+1)^2}\,dx\\\\& +4\pi^2\int_0^\infty \frac{1}{(x^2+1)^2}\,dx\tag4 \end{align}$$


Note that the imaginary part of the right-hand side of $(4)$ is $-\pi$ times the integral of interest on the right-hand side of $(1)$. Thus, we find that

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



METHODOLGY $2$: REAL ANALYSIS ONLY

We begin by enforcing the substitution $x\mapsto \tan(x)$ in the integral on the right-hand side of $(1)$ to reveal

$$\begin{align} 4\int_0^\infty \frac{\log(x)}{(x^2+1)^2}\,dx&=4\int_0^{\pi/2}\cos^2(x) \log(\tan(x))\,dx\\\\ &=4\int_0^{\pi/2}\cos^2(x) \log(\sin(x))\,dx\\\\&-4\int_0^{\pi/2}\cos^2(x) \log(\cos(x))\,dx\tag5 \\\\ &=4\int_0^{\pi/2}(2\cos^2(x)-1)\log(\sin(x))\,dx\tag6\\\\ &=4\int_0^{\pi/2}\cos(2x)\log(\sin(x))\,dx\tag7\\\\ &=4\left(-\int_0^{\pi/2}\cos^2(x)\,dx\right)\tag8\\\\ &=-\pi \end{align}$$ as expected.

In going from $(5)$ to $(6)$ we made use of the transformation $x\mapsto \pi/2 -x$ in the second integral on the right-hand side of $(5)$.

In going from $(7)$ to $(8)$, we used integration by parts with $u=\log(\sin(x))$ and $v=\sin(x)\cos(x)$


Substituting $ \small\left\lbrace\begin{aligned}u&=\frac{1}{\sqrt{x}}\\ -2\frac{\mathrm{d}u}{u^{2}}&=\frac{\mathrm{d}x}{\sqrt{x}}\end{aligned}\right. $, we get : \begin{aligned} \int_{0}^{+\infty}{\frac{\ln{x}}{\sqrt{x}\left(1+x\right)^{2}}\,\mathrm{d}x}&=-4\int_{0}^{+\infty}{\frac{y^{2}\ln{y}}{\left(1+y^{2}\right)^{2}}\,\mathrm{d}y}\\ &=2\left[\frac{y\ln{y}}{1+y^{2}}\right]_{0}^{+\infty}-2\int_{0}^{+\infty}{\frac{1+\ln{y}}{1+y^{2}}\,\mathrm{d}y}\\ &=-2\int_{0}^{+\infty}{\frac{\mathrm{d}y}{1+y^{2}}}-2\int_{0}^{+\infty}{\frac{\ln{y}}{1+y^{2}}\,\mathrm{d}y}\\ &=-\pi \end{aligned}

Because $ \int_{0}^{+\infty}{\frac{\ln{y}}{1+y^{2}}\,\mathrm{d}y}=0 $, and that can be proved substituting $ \small\left\lbrace\begin{aligned}u&=\frac{1}{y}\\ \mathrm{d}y&=-\frac{\mathrm{d}u}{u^{2}}\end{aligned}\right. \cdot $


As previous answers show, there are many ways to adress the problem of this integral.

Concerning the antiderivative, let first $x=t^2$ to make $$I=\int \frac{\log(x)}{\sqrt x(x+1)^2}\,dx=4\int \frac{\log(t)}{(t^2+1)^2}\,dt$$ Now, using partial fraction decomposition $$\frac{4}{(t^2+1)^2}=\frac{i}{t+i}-\frac{1}{(t+i)^2}-\frac{i}{t-i}-\frac{1}{(t-i)^2}$$ $$\int \frac{\log (t)}{t+k} \,dt=\text{Li}_2\left(-\frac{t}{k}\right)+\log (t) \log \left(\frac{k+t}{k}\right)$$ $$\int \frac{\log (t)}{(t+k)^2} \,dt=\frac{\log (t)}{k}-\frac{\log (t)}{k+t}-\frac{\log (k+t)}{k}$$ Combining everything and simplifying, we end with $$I=i \big(\text{Li}_2(i t)-\text{Li}_2(-i t)\big)+\frac{2 t \log (t)}{t^2+1}+2 (\log (t)-1) \tan ^{-1}(t)=$$

Now, using asymptotics

$$\color{blue}{J(a)=4\int_0^a \frac{\log(t)}{(t^2+1)^2}\,dt=-\pi+4\sum_{n=1}^\infty(-1)^n\,n\,\frac{ (2 n+1) \log (a)+1}{(2 n+1)^2\, a^{2 n+1}}}$$