Integrating $\int_0^\infty \frac{\log x}{(1+x)^3}\,\operatorname d\!x$ using residues

Consider the integral

$$\oint_C dz \frac{\log^2{z}}{(1+z)^3}$$

where $C$ is a keyhole contour in the complex plane, about the positive real axis. This contour integral may be seen to vanish along the outer and inner circular contours about the origin, so the contour integral is simply equal to

$$\int_0^{\infty} dx \frac{\log^2{x}-(\log{x}+i 2 \pi)^2}{(1+x)^3} = -i 4 \pi \int_0^{\infty} dx \frac{\log{x}}{(1+x)^3}+4 \pi^2 \int_0^{\infty} dx \frac{1}{(1+x)^3}$$

By the residue theorem, the contour integral is also equal to $i 2 \pi$ times the residue at the pole $z=-1=e^{i \pi}$. In this case, with the triple pole, we have the residue being equal to

$$\frac12 \left [ \frac{d^2}{dz^2} \log^2{z}\right]_{z=e^{i \pi}} = 1-i \pi$$

Thus we have that

$$-i 4 \pi \int_0^{\infty} dx \frac{\log{x}}{(1+x)^3}+4 \pi^2 \frac12 = i 2 \pi + 2 \pi^2$$

which implies that

$$\int_0^{\infty} dx \frac{\log{x}}{(1+x)^3} = -\frac12$$


\begin{align} &\bbox[10px,#ffd]{\int_{0}^{\infty}{\ln\left(x\right) \over \left(1 + x\right)^{3}}\,{\rm d}x} = \int_{0}^{\pi/2} {\ln\left(\tan^{2}\left(x\right)\right) \over \left\lbrack 1 + \tan^{2}\left(x\right)\right\rbrack^{3} } \,2\tan\left(x\right)\sec^{2}\left(x\right)\,{\rm d}x \\[5mm] = &\ 4\int_{0}^{\pi/2} \ln\left(\tan\left(x\right)\right) \tan\left(x\right)\cos^{4}\left(x\right)\,{\rm d}x = 4\int_{0}^{\pi/2} \ln\left(\tan\left(x\right)\right) \sin\left(x\right)\cos^{3}\left(x\right)\,{\rm d}x \\[5mm] &\ 4\int_{0}^{\pi/2} \ln\left(\sin\left(x\right)\right) \sin\left(x\right)\cos^{3}\left(x\right)\,{\rm d}x - 4\int_{0}^{\pi/2} \ln\left(\cos\left(x\right)\right) \sin\left(x\right)\cos^{3}\left(x\right)\,{\rm d}x \\[5mm] = &\ 4\int_{0}^{1} x\left(1 - x^{2}\right)\ln\left(x\right)\,{\rm d}x + 4\int_{1}^{0}x^{3}\ln\left(x\right)\,{\rm d}x = 4\int_{0}^{1} \left(x - 2x^{3}\right)\ln\left(x\right)\,{\rm d}x \\[5mm] = &\ 4\lim_{n \to 0}{{\rm d} \over {\rm d}n} \int_{0}^{1} \left(x^{n + 1} - 2x^{n + 3}\right)\,{\rm d}x = 4\lim_{n \to 0}{{\rm d} \over {\rm d}n} \left({1 \over n + 2} - {2 \over n + 4}\right) \\[5mm] = &\ 4\lim_{n \to 0} \left\lbrack -\,{1 \over \left(n + 2\right)^{2}} + {2 \over \left(n + 4\right)^{2}} \right\rbrack = 4 \left(-\,{1 \over 4} + {1 \over 8}\right) = -\,{1 \over 2} \end{align}


This approach is not using residues method but I'd like to post the general solution.


Let $$\mathcal{I}=\int_0^\infty\frac{x^{m-1}}{(1+x)^{m+n}}\ln x\ dx\tag1$$ Consider beta function $$ \text{B}(m,n)=\int_0^\infty\frac{x^{m-1}}{(1+x)^{m+n}}\ dx.\tag2 $$ Differentiating $(2)$ with respect to $m$ yields \begin{align} \frac{\partial}{\partial m}\text{B}(m,n)&=\int_0^\infty\frac{\partial}{\partial m}\left(\frac{x^{m-1}}{(1+x)^{m+n}}\right)\ dx\\ (\psi(m)-\psi(m+n))\text{B}(m,n)&=\int_0^\infty\frac{x^{m-1}}{(1+x)^{m+n}}\ln\left(\frac{x}{1+x}\right)\ dx\tag3\\ &=\mathcal{I}-\color{red}{\int_0^\infty\frac{x^{m-1}}{(1+x)^{m+n}}\ln (1+x)\ dx},\tag4 \end{align} where $\psi(\cdot)$ is the digamma function.

Setting $\color{red}{\displaystyle\ x=\frac1t\;\Rightarrow\;dx=-\frac{dt}{t^2}}$ to the second integral in $(4)$ yields $$ \int_0^\infty\frac{t^{n-1}}{(1+t)^{n+m}}\ln \left(\frac{1+t}{t}\right)\ dt=(\psi(m+n)-\psi(n))\text{B}(m,n).\tag5 $$ Plugging in $(5)$ to $(4)$ yields $$ \color{blue}{\int_0^\infty\frac{x^{m-1}}{(1+x)^{m+n}}\ln x\ dx=(\psi(m)-\psi(n))\text{B}(m,n)}.\tag6 $$


Thus, using $(6)$ and setting $m=1\; ;\; n=2$, we obtain $$ \large\int_0^\infty\frac{\ln x}{(1+x)^{3}}\ dx=(\psi(1)-\psi(2))\text{B}(1,2)=\color{blue}{-\frac12}, $$ where $\psi(1)= -\gamma$, $\ \psi(2)= 1-\gamma$, and $\displaystyle\ \text{B}(1,2)=\frac{\Gamma(1)\Gamma(2)}{\Gamma(3)}=\frac12$.