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

Calculate $$\int _0^\infty \dfrac{\ln x}{(x^2+1)^2}dx.$$ I am having trouble using Jordan's lemma for this kind of integral. Moreover, can I multiply it by half and evaluate $\frac{1}{2}\int_0^\infty \frac{\ln x}{(x^2+1)^2}dx$?


Solution 1:

Here is a 'real-analysis route'.

Step 1. We have $$ \int_0^{+\infty}\frac{\ln x}{x^2+1} dx=0 \tag1$$ as may be seen by writing $$ \begin{align} \int_0^{+\infty}\frac{\ln x}{x^2+1} dx&=\int_0^1\frac{\ln x}{x^2+1} dx+\int_1^{+\infty}\frac{\ln x}{x^2+1} dx\\\\ &=\int_0^1\frac{\ln x}{x^2+1} dx-\int_0^1\frac{\ln x}{\frac{1}{x^2}+1} \frac{dx}{x^2}\\\\ &=0. \end{align} $$ Step 2. Assume $a>0$. We have $$ \int_0^{+\infty}\frac{\ln x}{x^2+a^2} dx=\frac{\pi}{2}\frac{\ln a}{a} \tag2$$ as may be seen by writing $$ \begin{align} \int_0^{+\infty}\frac{\ln x}{x^2+a^2} dx&= \int_0^{+\infty}\frac{\ln (a \:u)}{(a \:u)^2+a^2} (a \:du)\\\\ &=\frac1a\int_0^{+\infty}\frac{\ln a +\ln u}{u^2+1} du\\\\ &=\frac{\ln a}{a}\int_0^{+\infty}\frac{1}{u^2+1} du+\frac1{a}\int_0^{+\infty}\frac{\ln u}{u^2+1} du\\\\ &=\frac{\ln a}{a}\times \frac{\pi}2+\frac1{a}\times 0\\\\ &=\frac{\pi}{2}\frac{\ln a}{a}. \end{align} $$ Step 3. Assume $a>0$. We have $$ \int_0^{+\infty}\frac{\ln x}{(x^2+a^2)^2} dx=\frac{\pi}{4}\frac{\ln a-1}{a^3} \tag3$$ since sufficient conditions are fulfilled to differentiate both sides of $(2)$.

Putting $a:=1$ in $(3)$ gives

$$ \int_0^{+\infty}\frac{\ln x}{(x^2+1)^2} dx=\color{blue}{-\frac{\pi}{4}}. $$

Solution 2:

Here is how to do it using complex analysis.

First of all in this case you can't compute $\frac{1}{2}\int_{-\infty}^\infty \frac{\ln x}{(x^2+1)^2}$ since it does not equal your integral (why?).

Now take $R>1$, $r<1$ and $\gamma$ a "keyhole" contour as shown below enter image description here

Lets take the branch cut of the logarithm with domain $\mathbb{C} \setminus \{iy: y \leq 0\}$, in which one $\ln(x) \in \mathbb{R}$ if $x \in \mathbb{R}^+$.

Now, on one side the Residue theorem tells us that if $f(z)=\frac{\ln(z)}{(z^2+1)^2} $ $$ \int_\gamma f(z)dz = 2\pi i \cdot \text{Res}(f(z), i) = 2\pi i \left( \lim_{z\to i} \frac{d}{dz}\left[ (z-i)^2 \frac{\ln(z)}{(z+1)^2(z-i)^2}\right]\right) = -\frac{\pi}{2}+ i \frac{\pi^2}{4} $$ On the other side is easily seen that the integral over the half semicircle connecting $R$ with $-R$ (lets call it $I_{C_1}$) goes to zero as $R$ goes to infinity, since $$ |I_{C_1}|=\left|\int_0^\pi \frac{\ln(Re^{it})iRe^{it}}{(R^2e^{2it}+1)^2}dt\right| \underset{R \to \infty}{\longrightarrow} 0 $$ And that the one over semicircle connecting $-r$ with $r$ (this one will be called $I_{C_2}$) goes to zero as $r$ goes to $0$ because $$ |I_{C_2}|=\left|\int_\pi^0 \frac{\ln(re^{it})ire^{it}}{(r^2e^{2it}+1)^2}dt\right| \underset{r \to 0}{\longrightarrow} 0 $$ Hence \begin{align} \int_\gamma f(z)dz & = \int_r^R \frac{\ln(x)}{(x^2+1)^2}dx + \int_{-R}^{-r} \frac{\ln(x)}{(x^2+1)^2}dx + I_{C_1} + I_{C_2} \\ & = \int_r^R \frac{\ln(x)}{(x^2+1)^2}dx - \int_{R}^{r} \frac{\ln(-y)}{(y^2+1)^2}dy + I_{C_1} + I_{C_2}\\ & = \int_r^R \frac{\ln(x)}{(x^2+1)^2}dx + \int_{r}^{R} \frac{\ln(-y)}{(y^2+1)^2}dy + I_{C_1} + I_{C_2}\\ & = \int_r^R \frac{\ln(x)}{(x^2+1)^2}dx + \int_{r}^{R} \frac{\ln|y| + i \pi}{(y^2+1)^2}dy + I_{C_1} + I_{C_2}\\ & = 2\int_r^R \frac{\ln(x)}{(x^2+1)^2}dx + i \pi \underbrace{\int_{r}^{R} \frac{dy}{(y^2+1)^2} }_{J}+ I_{C_1} + I_{C_2}\\ \end{align} However, as an indefinite integral $J$ can be compute by trigonometric substitution, as follows, let $y=\tan(u)$ then $$ \int \frac{dy}{(y^2+1)^2} = \int \cos^2(u) du = \frac{1}{4}\sin(2u)+\frac{1}{2}u = \frac{1}{4}\sin(2\tan^{-1}(y))+\frac{1}{2}\tan^{-1}(y) $$ Hence we have $$ \lim_{R\to \infty}\lim_{r\to 0}J=\int_0^\infty \frac{dy}{(y^2+1)^2} = \frac{1}{4}\sin(\pi)+\frac{\pi}{4} - \left( \frac{1}{4}\sin(0)+0\right) = \frac{\pi}{4} $$ Therefore, finally we conclude that \begin{align} -\frac{\pi}{2}+ i \frac{\pi^2}{4} & = \lim_{R\to \infty}\lim_{r\to 0} \left( \int_\gamma f(z)dz \right) \\ & = \lim_{R\to \infty}\lim_{r\to 0} \left( 2\int_r^R \frac{\ln(x)}{(x^2+1)^2}dx + i \pi \int_{r}^{R} \frac{dy}{(y^2+1)^2}+ I_{C_1} + I_{C_2}\right) \\ & = 2 \int_0^\infty \frac{\ln(x)}{(x^2+1)^2}dx + i \pi \left(\frac{\pi}{4}\right) + 0 + 0 \end{align}

Thus $$ \int_0^\infty \frac{\ln(x)}{(x^2+1)^2}dx = \frac{1}{2}\left( -\frac{\pi}{2}+ i \frac{\pi^2}{4} -i \frac{\pi^2}{4} \right) = -\frac{\pi}{4} $$