# $\int_0^\infty \frac{\log(1+x^2)}{x^2} dx$ using contour integration

I am trying to evaluate

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

by using contour integration. It is possible to compute this integral using real techniques; integration by parts yields the result:

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

I have been attempting to use the integrand $f(z)= \frac{\log(1+z^2)}{z^2}$ (with any suitable branch cut in the lower half plane), and have been trying to integrate around an indented semi-circle in the upper half plane, but I feel this is perhaps the wrong approach. Firstly, when summing the integrals along the real axis, the imaginary part seems to not converge. Furthermore, the indentation integral seems difficult to evaluate. Any help would be appreciated.

• Almost sure it is a duplicate. Jan 8, 2015 at 14:42
• I spent a good half hour searching, with no success. I'm happy to see an original though, if you can find a link. Jan 8, 2015 at 14:53
• $$\frac{1}{2}\int^\infty_{-\infty}\frac{\ln(1+x^2)}{x^2}dx=\pi i\operatorname*{Res}_{z=0}\frac{\ln(1-iz)}{z^2}=\pi$$ Jan 8, 2015 at 14:54
• What contour are you using? I understand how to expand $\log(1+z^2)$, but not how to proceed. Jan 8, 2015 at 15:09
• I am just using the classic semicircular contour. $\frac{\ln(1-iz)}{z^2}$ is meromorphic in the upper-half plane. Jan 8, 2015 at 15:13

See this answer for a way to deal with such logs using contour integration. Note that, about each branch point, we replace the offending log with a factor of $-i 2 \pi$ to account for the phase jump introduced by traversing around the branch point in a clockwise direction.

In this case, you can use a semicircular contour of radius $R$ in the upper half plane, with a detour downward from the semicircle at $\theta=\pi/2$ that avoids the branch point at $z=i$, as pictured below:

Thus, in the limit as $R \to \infty$, the contour integral is equal to

$$\int_{-\infty}^{\infty} dx \frac{\log{(1+x^2)}}{x^2} - i 2 \pi \int_{e^{i \pi/2}}^{\infty e^{i \pi/2}} \frac{dy}{y^2}$$

By Cauchy's Theorem, the contour integral is zero because there are no poles inside this contour. Thus, we have

$$\int_{-\infty}^{\infty} dx \frac{\log{(1+x^2)}}{x^2} = \frac{i 2 \pi}{i} = 2 \pi$$

• Thank you Ron, very insightful answer! Jan 8, 2015 at 15:29

Notice that by integrating by parts we have: $$I = \int_{0}^{+\infty}\frac{\log(1+x^2)}{x^2}\,dx = -\left.\frac{1}{x}\log(1+x^2)\right|_{0}^{+\infty}+\int_{0}^{+\infty}\frac{2\,dx}{1+x^2}=\color{red}{\int_{-\infty}^{+\infty}\frac{dz}{1+z^2}}$$ and the last integral is very easy to evaluate with complex or real-analytic techniques.

• Yeah I'm aware of this method. Is there a method which doesn't rely on integration by parts first? I found the integral in a complex analysis book, and the phrasing of the question makes it seem like there should be a purely complex method. Jan 8, 2015 at 14:55
• @CunningTF: M.N.C.E. just gave you one in the comments. However, I think that integration by parts make things a lot easier, anyway. Jan 8, 2015 at 15:06


which shows two branch cuts. Namely: \begin{align} \begin{array}{rclrcll} \pars{z - 1}^{-3/2} & = &\verts{z - 1}^{-3/2} \exp\pars{-\,{3 \over 2}\,\,{\rm Arg}\pars{z - 1}\ic}\,, & z & \not= & 1 \,, & \phantom{-}0 < \,{\rm Arg}\pars{z - 1} < 2\pi \\[5mm] \ln\pars{z}&=&\ln\pars{\verts{z}} + \ic\,{\rm Arg}\pars{z}\,,& z &\not = & 0\,, & -\pi < \,{\rm Arg}\pars{z} < \pi \end{array} \end{align} Obviously, the integral along $\ds{\gamma}$ vanishes out because there are not any poles inside the contour. For simplicity, we omit the contribution of the arcs $\ds{C_{R}}$, of radius $\ds{R}$, and the 'small' semicircles, of radius $\ds{\epsilon}$, around $\ds{z=0}$ and $\ds{z=1}$: They don't yield any contribution in the limits $\ds{R\ \to\ \infty\,,\ \epsilon\ \to\ 0^{+}}$. Then, \begin{align} 0&=\oint_{\gamma}\pars{z - 1}^{-3/2}\,\,\ln\pars{z}\,\dd z =\overbrace{\int_{1}^{\infty}\pars{x - 1}^{-3/2}\ln\pars{x}\,\dd x} ^{\ds{\mbox{along}\ \dsc{C_{++}}}} \\[5mm]&+\overbrace{% \int_{-\infty}^{0}\pars{1 - x}^{-3/2}\expo{-3\pi\ic/2} \bracks{\ln\pars{x} + \ic\pi}\,\dd x} ^{\ds{\mbox{along}\ \dsc{C_{-+}}}}\ +\ \overbrace{% \int^{-\infty}_{0}\pars{1 - x}^{-3/2}\expo{-3\pi\ic/2} \bracks{\ln\pars{x} - \ic\pi}\,\dd x} ^{\ds{\mbox{along}\ \dsc{C_{--}}}} \\[5mm]&+\overbrace{\int^{1}_{\infty}\pars{x - 1}^{-3/2} \expo{-3\pi\ic}\ln\pars{x}\,\dd x} ^{\ds{\mbox{along}\ \dsc{C_{+-}}}}\ =\ 2\int_{1}^{\infty}\pars{x - 1}^{-3/2}\ln\pars{x}\,\dd x \\[5mm]&\phantom{=}+2\pi\ic\expo{-3\pi\ic/2}\int_{-\infty}^{0} \pars{1 - x}^{-3/2}\,\dd x =2\int_{1}^{\infty}\pars{x - 1}^{-3/2}\ \ln\pars{x}\,\dd x -\left.{4\pi \over \root{1 - x}}\,\right\vert_{\, x\ \to\ -\infty}^{\, x\ =\ 0} \\[5mm]&=2\int_{1}^{\infty}\pars{x - 1}^{-3/2}\ \ln\pars{x}\,\dd x - 4\pi \quad\imp\quad \boxed{\ds{\quad\int_{1}^{\infty}\pars{x - 1}^{-3/2}\ \ln\pars{x}\,\dd x =2\pi\quad}} \end{align}

Replacing this result in expression $\pars{1}$, we'll find:

\begin{align}&\color{#66f}{\large% \int_{0}^{\infty}{\ln\pars{1 + x^{2}} \over x^{2}}\,\dd x} =\color{#66f}{\Large\pi} \end{align}

• Another really good answer. Thank you. Jan 9, 2015 at 11:31
• @CunningTF I'm glad you found it useful. Thanks. Jan 9, 2015 at 21:22