# Evaluating $\int^{\infty}_{0}{\frac{\ln x}{(1+x^2)^2}dx}$

$$\int^{\infty}_{0}{\frac{\ln x}{(1+x^2)^2}dx}$$

I've done a similar one: $\int^{\infty}_{1}{\frac{\ln^n x}{x^2}dx}$ using IBP, but in this case I've tried IBP multiple times, differentiating all of the possible choices, and it's only getting more convoluted. Also, no substitution I've tried like $x=e^u$ or $u=1+x^2$made the integral simpler. I'd appreciate a hint at this point, since I don't think it can be that hard.

-
This wiki example also deals with this integral using contour integration and residue theorem:en.wikipedia.org/wiki/… – Lao-tzu Jan 12 '15 at 8:37

Substituting $x\leftarrow \tfrac{1}{x}$ shows that $$\int_0^\infty \frac{\log(x)}{(1+x^2)^2}dx = -\int_0^\infty \frac{x^2\log(x)}{(1+x^2)^2}dx$$ and therefore $$2\int_0^\infty \frac{\log(x)}{(1+x^2)^2}dx = \int_0^\infty \frac{1-x^2}{(1+x^2)^2}\log(x)dx.$$ Partial integration of the right hand side using that $$\frac{\partial}{\partial x}\left(\frac{x}{1+x^2}\right) = \frac{1-x^2}{(1+x^2)^2}$$ results in $$\int_0^\infty \frac{1-x^2}{(1+x^2)^2}\log(x)dx = \left[\frac{x\log(x)}{1+x^2}\right]_0^\infty -\int_0^\infty \frac{dx}{1+x^2} = 0 -\frac{\pi}{2}.$$ So the requested integral equals $-\frac{\pi}{4}$.

-
+1. Very neat answer. – user17762 Jan 5 '13 at 20:50
zzz why just write down the solution i gave 2 hours before ? – Louis La Brocante Jan 5 '13 at 23:53

Let $x=1/y$. We then get $$I = \int_0^{\infty} \dfrac{\ln(x)}{(1+x^2)^2} dx = \int_0^{1} \dfrac{\ln(x)}{(1+x^2)^2} dx + \int_1^{\infty} \dfrac{\ln(x)}{(1+x^2)^2} dx\\ = \int_0^{1} \dfrac{\ln(x)}{(1+x^2)^2} dx - \underbrace{\int_0^{1} \dfrac{x^2\ln(x)}{(1+x^2)^2} dx}_{x \to 1/x}\\ = \int_0^{1} (1-x^2)\left(\sum_{k=0}^{\infty} (-1)^{k}(k+1)x^{2k}\right) \log(x) dx\\ = \sum_{k=0}^{\infty}(-1)^k(k+1)\left(\int_0^1 x^{2k} \log(x) dx - \int_0^1 x^{2k+2} \log(x) dx \right)\\ = \sum_{k=0}^{\infty}(-1)^k(k+1)\left(- \dfrac1{(2k+1)^2} + \dfrac1{(2k+3)^2} \right) = -\dfrac{\pi}4$$ The last equality can be seen from below. $$\int_0^1 x^m \log(x) dx = -\dfrac1{(m+1)^2}$$ \begin{align} \sum_{k=0}^{\infty}(-1)^k(k+1)\left(- \dfrac1{(2k+1)^2} + \dfrac1{(2k+3)^2} \right) & = 1\left(-\dfrac1{1^2} + \dfrac1{3^2} \right)\\ & -2 \left(-\dfrac1{3^2} + \dfrac1{5^2} \right)\\ & +3 \left(-\dfrac1{5^2} + \dfrac1{7^2} \right)\\ & -4 \left(-\dfrac1{7^2} + \dfrac1{9^2} \right) + \cdots \end{align} $$\sum_{k=0}^{\infty}(-1)^k(k+1)\left(- \dfrac1{(2k+1)^2} + \dfrac1{(2k+3)^2} \right) = -\dfrac1{1^2} + \dfrac{3}{3^2} - \dfrac{5}{5^2} + \dfrac7{7^2} \mp \cdots\\ = -1 + \dfrac13 - \dfrac15 + \dfrac17 \mp \cdots = -\dfrac{\pi}4$$

-
How does the last equality follow? (The series and \$pi$) – Pedro Tamaroff Jan 5 '13 at 19:05
@PeterTamaroff Have added the details. – user17762 Jan 5 '13 at 19:06
I was thinking that a series expansion would be needed somewhere. Thanks for the answer! – user54147 Jan 5 '13 at 19:09
@Marvis : In the 3rd line , should the sum not be squared or something ? i guess i am missing something silly here . – Theorem Jan 5 '13 at 19:13
@Theorem I have used the fact that $$\dfrac1{(1+a)^2} = 1-2a + 3a^2 - 4a^3 \pm$$ I think you have thought it to be $$\dfrac1{(1+a)^2} = \left(\dfrac1{1+a} \right)^2 = \left(1-a + a^2 - a^3 \pm \right)^2$$ – user17762 Jan 5 '13 at 19:15

$$f(z)=\frac{\log z}{(1+z^2)^2} = \frac{\log z}{(z+i)^2(z-i)^2}$$

where we use the principal branch of the logarithm.

$$P.V.\int_{-R}^R f(z)\, dz = \int_{\epsilon}^R f(z)\, dz+\int_{-R}^\epsilon f(z)\, dz = \int_{\epsilon}^R f(z)\, dz + \int_{\epsilon}^R\frac{\log z+i\pi}{(1+z^2)^2}\, dz =$$

$$= 2\int_{\epsilon}^R f(z)\, dz + i\pi\int_{\epsilon}^R \frac{dz}{(1+z^2)^2}$$

Then, considering the contour $\Gamma$ that traverses $-R$ to $R$ (indented at $z=0$ around $\epsilon e^{i \theta}$) and then travels back along $Re^{i \theta}$, there is only one pole of $f(z)$ in $\Gamma$. As $R \to \infty$, the integral around the arc disappears, so

$$2\pi i \operatorname*{Res}_{z = i} f(z) = 2\int_{\epsilon}^\infty f(z)\, dz + \int_{0}^\pi f(\epsilon e^{i \theta})i\epsilon e^{i \theta}\, d\theta + i\pi\int_{\epsilon}^\infty \frac{dz}{(1+z^2)^2}$$

and as $\epsilon \to 0$, we see the RHS becomes

$$2\int_{0}^\infty f(z)\, dz + \frac{i \pi^2}{4}$$

The poles are of order 2, thus

$$\operatorname*{Res}_{z = i} f(z) = \lim_{z \to i}\,\frac{d}{dz}(z-i)^2f(z) = \frac{\pi+2 i}{8}$$

Thus

$$-\frac{\pi}{2}+ \frac{i \pi^2}{4} = 2\int_{0}^\infty f(z)\, dz + \frac{i \pi^2}{4}$$

and we finally find

$$\int_{0}^\infty \frac{\log z}{(1+z^2)^2}\, dz = -\frac{\pi}{4}$$

$\blacksquare$

-
+1 Argon...I like the $\blacksquare$ (and your answer of course!) – amWhy Jan 6 '13 at 1:14
Haha, @amWhy, I felt it needed that finishing touch! – Argon Jan 7 '13 at 1:44

Too late to the party (as I always am) but here's a solution that hasn't been posted yet.

Let $\displaystyle I(\lambda) = \int_{0}^{\infty} \frac{\ln{x}}{\lambda+x^2}\;{dx}$. Then $\displaystyle I'(\lambda) = -\int_{0}^{\infty} \frac{\ln{x}}{(\lambda+x^2)^2}\;{dx}$. Put $x \mapsto \sqrt{\lambda} {x}$ then:

\begin{aligned}I(\lambda) & = \frac{1}{2\sqrt{\lambda}}\int_{0}^{ \infty}\frac{\ln(\lambda)}{1+x^2}\;{dx}-\frac{1}{\sqrt{\lambda}}\int_{0}^{ \infty}\frac{\ln{x}}{1+x^2}\;{dx} \\& = \frac{\pi}{4\sqrt{\lambda}}\log(\lambda)- \frac{1}{\sqrt{\lambda}}\int_{0}^{ \infty}\frac{\ln{x}}{1+x^2}\;{dx} \\& =\frac{\pi}{4\sqrt{\lambda}}\log(\lambda)-\frac{1}{\sqrt{\lambda}}\int_{0}^{\pi/2}\ln(\tan{x)} \\& = \frac{\pi}{4\sqrt{\lambda}}\log(\lambda)-\frac{1}{\sqrt{\lambda}}J \end{aligned}

Let $\displaystyle x \mapsto \frac{\pi}{2}-x$ then we have $\displaystyle J = \int_{0}^{\pi/2}\ln\left(\cot{x}\right)\;{dx}$ thus $\displaystyle 2J = \int_{0}^{\pi/2}\ln(1)\;{dx} = 0.$

Therefore $\displaystyle I'(\lambda) = \frac{\pi}{4\sqrt{\lambda}}\log(\lambda)$. We have $\displaystyle I'(\lambda) = \frac{\pi}{8 \lambda \sqrt{\lambda} }(2-\log{\lambda})$ and $\displaystyle -I'(1) = -\frac{\pi}{4}$.

P.S. $J$ can be calculated by $x \mapsto \frac{1}{x}$ as it gives us $J = -J$ readily but that substitution was embedded in previous solutions I wanted to present a fresh perspective. Also from the very beginning we could have let $x \mapsto \sqrt{x}\tan{x}$. By differentiating both sides $n$-times we could get a nice generalisation too.

-

Did you try taking $u=\frac{1}{x}$ ? You get usually something very similar to the first integral and then IBP could help.

-
After doing that I find that the original integral is equal to: $$\int^{\infty}_{0}{\frac{u^2\ln u}{1+u^2}du}$$ – user54147 Jan 5 '13 at 18:50
Yes you're right, the denominator should be squared, I misLaTeXed. – user54147 Jan 5 '13 at 19:02