I want to verify the following result using the residue theorem:

$$\int_0^\infty \frac{\log(x)}{x^2+a^2}dx = \frac{\pi}{2a}\log a, \, a > 0.$$

Here are my ideas:

At first I might want to show that this function is in fact a well defined improper Riemann integral, but I didn't come up with any nice solution yet.

I want to integrate the function $f(z) := \frac{\log(z)}{z^2+a^2}$ along the contour $C:= \gamma_1 \cup \gamma_2 \cup \gamma_3 \cup \gamma_4$ constisting of to semicircles with center at 0 around the upper half plane and radius $R$ and $\epsilon$ (resp.) as well as the intervals $[-R, -\epsilon]$ and $[\epsilon, R]$.

For the complex logarithm, use the branch $\log z = \log|z| + i\theta, \theta \in [-\pi/2, 3\pi/2)$ so we don't get any problems on the real line (is this choice correct?).

Note that I have one pole in my contour, namely $z = ia$. The Residue theorem yields $$\int_C f(z) dz= 2\pi i \text{ Res}(f, ia) = 2\pi i\lim_{z\to ia}(z-ia) \frac{\log z}{(z-ia)(z+ia)} = 2\pi i\frac{\log(ia)}{2ia} = \pi \frac{\log(a)+ i\pi/2}{a}$$ Proceeding, we choose the following parametrizations:
$$\gamma_1 : [-R,0] \to \mathbb C, \quad t\mapsto -\frac{\epsilon t}{R} + (t-\epsilon) \\ \gamma_2 : [0, R] \to \mathbb C, \quad t\mapsto -\frac{\epsilon t}{R} + (\epsilon+t) \\ \gamma_3: [0, \pi]\to \mathbb C, \quad t\mapsto \epsilon e^{it} \\ \gamma_4:[0,\pi] \to \mathbb C, \quad t \mapsto Re^{it}$$ Now here's what I am unsure about. To show that the big and the small circle vanish as $R\to \infty$ and $\epsilon \to 0$ is not too hard, but how to deal with the other integrals? Can I just say $$\int_{\gamma_1} f(z)dz = \int_0^R \frac{\log(-\frac{\epsilon}{R}t+\epsilon+t)}{(-\frac{\epsilon}{R}t + \epsilon + t)^2 + a^2}(\frac{\epsilon}{R}+1)dt \xrightarrow{\epsilon \to 0} \int_0^R \frac{\log t}{t^2 + a^2}dt$$ or what kind of reasoning should be used to interchange limit and integral?Also, I then finally I get $$\int_0^\infty \frac{\log(x)}{x^2+a^2}dx = \pi \frac{\log a + i\frac{\pi}{2}}{2a}$$ almost what I want, but where does $i\pi /2$ come from?

Thanks in advance!


Solution 1:

For any $a>0$, through the substitution $x=a e^t$ we have

$$ I(a) = \int_{0}^{+\infty}\frac{\log x}{a^2+x^2}\,dx = \frac{1}{2a}\int_{-\infty}^{+\infty}\frac{\log a+ t}{\cosh t}\,dt \tag{1}$$ and $\frac{t}{\cosh t}$ is an odd integrable function over $\mathbb{R}$. It follows that $$ I(a) = \frac{\log a}{2a}\int_{-\infty}^{+\infty}\frac{dt}{\cosh t}=\frac{\log a}{2a}\left[2\arctan\tanh\frac{t}{2}\right]^{+\infty}_{-\infty}=\color{red}{\frac{\pi\log a}{2a}} \tag{2} $$ without even resorting to the residue theorem, but just exploiting symmetry.

Solution 2:

Along the real axis, we have

$$\begin{align} \int_{-R}^R \frac{\log(x)}{x^2+a^2}\,dx&=\int_{-R}^0 \frac{\log(x)}{x^2+a^2}\,dx+\int_0^{R} \frac{\log(x)}{x^2+a^2}\,dx\\\\ &=\int_0^R \frac{\log(-x)+\log(x)}{x^2+a^2}\,dx\\\\ &=2\int_0^R \frac{\log(x)}{x^2+a^2}\,dx+i\pi\int_0^R\frac{1}{x^2+a^2}\,dx\\\\ &=2\int_0^R \frac{\log(x)}{x^2+a^2}\,dx+\frac{i\pi\arctan(R/a)}{a}\tag1 \end{align}$$

As $R\to \infty$, we find that

$$\int_{-\infty}^\infty \frac{\log(x)}{x^2+a^2}\,dx=2\int_0^\infty \frac{\log(x)}{x^2+a^2}\,dx+\frac{i\pi^2}{2a}\tag 2$$

Setting $(2)$ equal to $\frac{\pi \log(a)}{a}+i\frac{\pi^2}{2a} $, we find that

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


I thought it might be instructive to evaluate the integral of interest using real analysis only. To that end, we enforce the substitution $x\to a/x$ to find that

$$\int_0^\infty \frac{\log(x)}{x^2+a^2}\,dx=\frac1a \int_0^\infty \frac{\log(a)-\log(x)}{x^2+1}\,dx \tag2$$

For $a=1$, we see from $(2)$ that $\int_0^\infty \frac{\log(x)}{x^2+1}\,dx =0$. Thus, solving $(2)$ for integral of interest, and using $\int_0^\infty \frac{\log(x)}{x^2+1}\,dx =0$, we find that

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

as expected!