$\int_{0}^{\infty} \frac{\log z}{z^2 + a^2} dz $
How to calculate the residue at $\ z = ai$ ? Is Res = $\frac{\log(ai)}{2ai}$
Also, when I do contour integral, I used two semi circles, how do you decide to use one or two semicircles?
Thanks
$\int_{0}^{\infty} \frac{\log z}{z^2 + a^2} dz $
How to calculate the residue at $\ z = ai$ ? Is Res = $\frac{\log(ai)}{2ai}$
Also, when I do contour integral, I used two semi circles, how do you decide to use one or two semicircles?
Thanks
On
We assume that $a\in \mathbb{R}$. Then, without loss of generality we take $a>0$.
We present two methodologies, which use distinct closed contours.
METHODOLOGY $1$: Integration around a semicircle in the upper-half plane
First, we analyze the integral
$$\begin{align} \oint_{C_1}\frac{\log(z)}{z^2+a^2}\,dz&=\int_0^R\frac{\log(-x)}{x^2+a^2}\,dx+\int_0^R \frac{\log(-x)}{x^2+a^2}\,dx+\int_0^\pi \frac{\log(Re^{i\phi})}{(Re^{i\phi})^2+a^2}\,iRe^{i\phi}\,d\phi\tag1\\\\ &=2\pi i \text{Res}\left(\frac{\log(z)}{z^2+a^2},z=ia\right)\tag2 \end{align}$$
for $R>a$.
We choose to cut the plane from $z=0$ to $z=-\infty$ with $\pi<\arg(z)\le \pi$. Then, we have
$$\int_0^R\frac{\log(-x)}{x^2+a^2}\,dx=\int_0^R\frac{\log(x)}{x^2+a^2}\,dx+i\pi\int_0^R \frac{1}{x^2+a^2}\,dx\tag3$$
and
$$\begin{align} \text{Res}\left(\frac{\log(z)}{z^2+a^2},z=ia\right)&=\frac{\log(ia)}{i2a}\\\\ &=\frac{\pi}{4}-i\frac{\log(a)}{2a} \end{align}\tag 4$$
As $R\to \infty$, the third integral on the right-hand side of $(1)$ approaches $0$. Thus, using $(3)-(4)$ into $(1)-(2)$ and letting $R\to \infty$ reveals
$$2\int_0^\infty \frac{\log(x)}{x^2+a^2}\,dx+i\frac{\pi^2}2 =\frac{\pi \log(a)}{a}+i\frac{\pi^2}2\tag 5$$
Solving $(5)$ for the integral of interest yields
$$\bbox[5px,border:2px solid #C0A000]{\int_0^\infty \frac{\log(x)}{x^2+a^2}\,dx=\frac{\pi \log(a)}{2a}}$$
METHODOLOGY $2$: Integration around the classical keyhole contour
Second, we cut the plane along the positive real axis and analyze the integral
$$\begin{align} \oint_{C_2}\frac{\log^2(z)}{z^2+a^2}\,dz&=\int_0^R\frac{\log^2(x)}{x^2+a^2}\,dx+\int_R^0 \frac{(\log(x)+i2\pi)^2}{x^2+a^2}\,dx+\int_0^{2\pi} \frac{\log(Re^{i\phi})}{(Re^{i\phi})^2+a^2}\,iRe^{i\phi}\,d\phi\tag6\\\\ &=2\pi i \text{Res}\left(\frac{\log^2(z)}{z^2+a^2},z=\pm ia\right)\tag7 \end{align}$$
for $R>a$.
Then, we have
$$\int_R^0 \frac{(\log(x)+i2\pi)^2}{x^2+a^2}\,dx=\int_R^0\frac{\log^2(x)}{x^2+a^2}\,dx+i4\pi\int_R^0 \frac{\log(x)}{x^2+a^2}\,dx-4\pi^2 \int_R^0 \frac{1}{x^2+a^2}\,dx\tag8$$
and
$$\begin{align} \text{Res}\left(\frac{\log^2(z)}{z^2+a^2},z=\pm ia\right)&=\frac{\log^2(e^{i\pi/2}a)}{i2a}+\frac{\log^2(e^{i3\pi/2}a)}{-i2a}\\\\ &=\frac{\log^2(a)+i\pi \log(a)-\pi^2/4}{i2a}-\frac{\log^2(a)+i3\pi \log(a)-9\pi^2/4}{i2a}\\\\ &=-\frac{\log(a)}{a}-i\frac{\pi^2}{a}\tag 9 \end{align}$$
As $R\to \infty$, the third integral on the right-hand side of $(6)$ approaches $0$. Thus, using $(8)-(9)$ into $(6)-(7)$ and letting $R\to \infty$ reveals
$$\bbox[5px,border:2px solid #C0A000]{\int_0^\infty \frac{\log(x)}{x^2+a^2}\,dx=\frac{\pi \log(a)}{2a}}$$
as expected!
Residue at $ai$ is $a_{-1}=\lim_{z\to i a} \, \dfrac{(z-i a) \log (z)}{a^2+z^2}=\lim_{z\to i a} \, \dfrac{ i\log (z)}{i z-a}=-\dfrac{i \log (i a)}{2 a}=\dfrac{\log (i a)}{2 i a}$