# Is this definite integral possible to evaluate? $\int_0^\infty\frac{\log x}{(1+x^2)^2}\,dx$

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

I have tried to evaluate this by trying I.B.P. on various different products, and have also tried the substitution $x\mapsto1/x$. None of these work. I have put this into an online integration tool and it gives a solution using some function called "Li", but I have never been taught this, so do not want to use it. Is there some way of evaluating this definite integral, perhaps using complex analysis and contour integrals?

I have been able to evaluate similar integrals, such as $\int_0^\infty\frac{\log x}{1+x^2}\,dx=0$ and $\int_0^\infty\frac{1}{(1+x^2)^2}\,dx=\pi/4$, but it is this one which is proving to be a struggle.

• I also have tried parts with $u=\log x$, $v'=\frac1{(1+x^2)^2}$, but I believe this leads to a term $$\int_0^\infty\frac{\arctan x}{x}\,dx$$which again looks troublesome. – John Doe May 21 '17 at 11:20
• integrate $\log^2(x)/(1+x^2)^2$ over (for example) a keyhole in the complex plane. search the site properly this was done hundreds of times before here on this site (Especially user @Mark Viola posted something similar these days) – tired May 21 '17 at 11:28
• btw $\int dx \arctan(x)/x$ is a very good candiate for differentiation under the integral sign.... – tired May 21 '17 at 11:30
• If one can solve (click for solution) $$f(t)=\int_0^\infty\frac{\ln(x)}{t^2+x^2}\ dx$$ then take the derivative and set $t=1$. – Simply Beautiful Art May 21 '17 at 11:37

Take the keyhole contour of $f(z)=\left[\frac{\ln(z)}{1+z^2}\right]^2$ with $\gamma$ the radius of the inner circle and $\Gamma$ the radius of the outer circle to get

$$\lim_{(\gamma,\Gamma)\to(0^+,+\infty)}\int_{C_1}f(z)\ dz=\int_0^{+\infty}\left[\frac{\ln(x)}{1+x^2}\right]^2\ dx$$

$$\lim_{(\gamma,\Gamma)\to(0^+,+\infty)}\int_{C_3}f(z)\ dz=-\int_0^{+\infty}\left[\frac{\ln(x)+2\pi i}{1+x^2}\right]^2\ dx$$

$$\lim_{(\gamma,\Gamma)\to(0^+,+\infty)}\int_{C_2}f(z)\ dz=\lim_{(\gamma,\Gamma)\to(0^+,+\infty)}\int_{C_4}f(z)\ dz=0$$

And thus, we can see that

\begin{align}\lim_{(\gamma,\Gamma)\to(0^+,+\infty)}\oint_Cf(z)\ dz&=\int_0^{+\infty}\left[\frac{\ln(x)}{1+x^2}\right]^2\ dx-\int_0^{+\infty}\left[\frac{\ln(x)+2\pi i}{1+x^2}\right]^2\ dx\\&=\int_0^{+\infty}\frac{[\ln(x)]^2-[\ln(x)+2\pi i]^2}{(1+x^2)^2}\ dx\\&=\int_0^{+\infty}\frac{[\ln(x)]^2-[\ln(x)]^2-4\pi i\ln(x)+4\pi^2}{(1+x^2)^2}\ dx\\&=\int_0^{+\infty}\frac{-4\pi i\ln(x)+4\pi^2}{(1+x^2)^2}\ dx\\&=2\pi i\left(\operatorname{Res}_{z=i}(f(z))+\operatorname{Res}_{z=-i}(f(z))\right)\\&=\pi^2i\end{align}

By taking imaginary parts, we deduce that

$$\int_0^{+\infty}\frac{\ln(x)}{(1+x^2)^2}\ dx=-\frac\pi4$$

• In the third line of evaluating the integral, should it not be this: $$\int_0^{+\infty}\frac{[\ln(x)]^2-[\ln(x)]^2-4\pi i\ln(x)+4\pi^2}{(1+x^2)^2}\ dx$$? And if so, does this change the answer, or was this a typo (or am I missing something)? – John Doe May 21 '17 at 11:58
• @JohnDoe Ah yes, missed a negative, though it does not change the end result. – Simply Beautiful Art May 21 '17 at 12:02

Try the following integration by parts:

\begin{align} \int_{0}^{\infty}\frac{\ln{\left(x\right)}}{\left(1+x^{2}\right)^{2}}\,\mathrm{d}x &=\int_{0}^{\infty}\frac{2x}{\left(1+x^{2}\right)^{2}}\cdot\frac{\ln{\left(x\right)}}{2x}\,\mathrm{d}x\\ &=\left[\left(1-\frac{1}{1+x^{2}}\right)\frac{\ln{\left(x\right)}}{2x}\right]_{0}^{\infty}-\int_{0}^{\infty}\left(1-\frac{1}{1+x^{2}}\right)\frac{1-\ln{\left(x\right)}}{2x^{2}}\,\mathrm{d}x;~~~\small{I.B.P.s}\\ &=0-0+\int_{0}^{\infty}\frac{x^{2}}{1+x^{2}}\cdot\frac{\ln{\left(x\right)}-1}{2x^{2}}\,\mathrm{d}x\\ &=\frac12\int_{0}^{\infty}\frac{\ln{\left(x\right)}-1}{1+x^{2}}\,\mathrm{d}x.\\ \end{align}

Incidentally, the same method can be used to build a reduction formula for integrals of the form $\int_{0}^{\infty}\frac{\ln{\left(x\right)}}{\left(1+x^{2}\right)^{n}}\,\mathrm{d}x$.

• That's a nice result! I did encounter the expression $\int\frac{2x}{(1+x^2)^2}$ when I was solving this, but I just integrated it to $C-\frac{1}{(1+x^2)^2}$, but then I automatically set the constant to be $0$, since I figured that would be easier. This is very nice – John Doe May 21 '17 at 12:38
• @JohnDoe It usually is easier to set the constant to $0$, but for many improper integrals there will only be one value for $C$ where the integral converges. – David H May 21 '17 at 14:21

Change variable to $y = \frac1x$, we have

$$I = \int_0^\infty \frac{\log x}{(1+x^2)^2} dx = \int_\infty^0 \frac{-\log y}{(1+y^{-2})^2}\left(-\frac{dy}{y^2}\right) = - \int_0^\infty \frac{y^2\log y}{(1+y^2)^2}dy$$ This leads to \begin{align} I &= -\frac12\int_0^\infty \log(x) \frac{x^2-1}{(x^2+1)^2}dx = -\frac12\int_0^\infty\log(x) \frac{x-x^{-1}}{(x+x^{-1})^2}\frac{dx}{x}\\ &= -\frac12\int_0^\infty\log(x)\frac{x-x^{-1}}{(x+x^{-1})^2}\frac{d(x+x^{-1})}{x-x^{-1}} = -\frac12\int_0^\infty \log(x) \frac{d(x+x^{-1})}{(x+x^{-1})^2}\\ &= \frac12\int_0^\infty \log(x) \left(\frac{1}{x+x^{-1}}\right)' dx = \frac12\int_0^\infty \left[ \left(\frac{\log x}{x+x^{-1}}\right)' - \frac{(\log x)'}{x+x^{-1}} \right] dx\\ &= \left[ \frac{\log x}{x+x^{-1}}\right]_0^\infty -\frac12\int_0^\infty \frac{dx}{1+x^2}\\ &= -\frac{\pi}{4} \end{align}

• You missed a small thing at the end with your $?\to\infty$ – Simply Beautiful Art May 21 '17 at 11:42
• Sorry, could you elaborate on the integration by parts at the end? You let $u=\frac1{x+x^{-1}}$, then what? The $x$ doesn't rearrange nicely to put the $\log x$ into the form $\log f(u)$ – John Doe May 21 '17 at 11:52
• @John Doe, there is no change of variable at that part. I rewrite the last part of answer and I hope it is clearer. – achille hui May 21 '17 at 14:19
• Ohhh, ok I see, I think it was just unfamiliar with the notation, in that you wrote $d(x+x^{-1})$, but it makes sense now. Thanks :) – John Doe May 21 '17 at 19:46
• @JohnDoe When you see an expression like $\int fdg$, it doesn't always mean change variable to $g$. It can mean $\int f(x(t))g'(x(t))x'(t)dt$ for any parametrization of the integral. It can also mean it is a Riemann–Stieltjes integral. – achille hui May 21 '17 at 19:57

The substitution $x= \frac{1}{y}$ on the interval $(1,\infty)$ followed by the substitution $y=\tan(t)$ and integration by parts yield \begin{gather*} \int_{0}^{\infty}\dfrac{\ln(x)}{(1+x^2)^2}\, dx = \int_{0}^{1}\dfrac{\ln(x)}{(1+x^2)^2}\, dx - \int_{0}^{1}\dfrac{y^2\ln(y)}{(1+y^2)^2}\, dy = \int_{0}^{1}\dfrac{(1-y^2)\ln(y)}{(1+y^2)^2}\, dy = \\[2ex] \int_{0}^{\pi/4}\cos(2t)\ln(\tan(t))\, dt = \left[\dfrac{1}{2}\sin(2t)\ln(\tan(t))\right]_{0}^{\pi/4}- \int_{0}^{\pi/4}\underbrace{\dfrac{\sin(2t)}{2\tan(t)\cos^2(t)}}_{=1}\, dt = -\dfrac{\pi}{4}. \end{gather*}


The last integral in \eqref{1} vanishes outIt just changes its sign under $\ds{x \to 1/x}$.