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

I am trying to use residues to compute $$\int_0^\infty\frac{\log x}{(1+x)^3}\,\operatorname d\!x.$$My first attempt involved trying to take a circular contour with the branch cut being the positive real axis, but this ended up cancelling off the term I wanted. I wasn't sure if there was another contour I should use. I also had someone suggest using the substitution $x=e^z$, so the integral becomes $$\int_{-\infty}^\infty\frac{ze^z}{(1+e^z)^3}\,\operatorname d\!z$$so that the poles are the at the odd multiples of $i\pi$. I haven't actually worked this out, but it does not seem like the solution the author was looking for (this question comes from an old preliminary exam).

Any suggestions on how to integrate?

• Does this help? – Git Gud Aug 2 '13 at 12:31
• Integration by parts (one suffices). – Did Aug 2 '13 at 12:36
• @Did: The question specifies to use residues :) – Clayton Aug 2 '13 at 12:37
• @GitGud: Are you suggesting using a rectangle of finite height (the same kind of contour in the question you linked to)? It seems like it could work. I hadn't thought about using that kind of contour. – Clayton Aug 2 '13 at 12:38
• @Clayton I'm not suggesting anything, to be honest. It's just that the integrals don't seem that different so I brought it to your attention. – Git Gud Aug 2 '13 at 12:39

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$$

• Thanks! Is it a standard technique to increase the power of the logarithm when trying to solve such an integral? Or is it just one of many tricks from a bag that happens to work every now-and-then? – Clayton Aug 2 '13 at 12:45
• @Clayton: yes. It's almost like the way we derive the derivative of a power, in that we lose the highest power of the log in evaluating the integral along both sides of the real axis. (Along the other side, you let $z=e^{i 2 \pi}$; this is crucial. – Ron Gordon Aug 2 '13 at 12:46
• Hi @RonGordon, if the poles were at +/- i, would integrating along just the upper semi-circle be just fine too? And, how did you compute the triple pole? Did you expand in Laurent series? Thanks, – User001 Oct 30 '15 at 0:38
• A solution that I am comparing my work with uses just a semi-circular contour, so it doesn't have the cancellation problem -- but I wonder whether the solution is incorrect, especially on its work along the negative real axis. Thanks @RonGordon – User001 Oct 30 '15 at 0:41
• @LebronJames: I think you can do it that way if you are careful in defining the branch of the log. – Ron Gordon Oct 30 '15 at 0:49

\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}

• Thanks @RonGordon . I'll check it. – Felix Marin Aug 19 '13 at 16:17

## 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$.