Compute $\int_0^\infty \frac{\log(2+x^2)}{4+x^2}\,\mathrm dx$

analysiscomplex integrationintegrationlogarithmsresidue-calculus

Evaluate the integral
$$\int_0^\infty \frac{\log(2+x^2)}{4+x^2}dx$$

I started by stating that the integral from 0 to infinity should be the same as half the integral from $-\infty$ to $\infty$, that is:

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

and then by stating that this must be equal to

$$\pi i \cdot \sum(\text{residues in upper plane})$$

noting that there is a singularity at $z=2i$ in the upper half plane, and an "issue" (I don't know if it's strictly a singularity) with the log function at $z=\sqrt{2}i$.

The residue at $z=2i$ is easily dealt with, but when I try to deal with the log issue, I can't make any headway. I decided to make my branch cut between $z=\sqrt{2}i$ and $z=-\sqrt{2}i$, and form a contour that goes around this cut and the point, but it doesn't seem to be working out for me.

Suggestions would be appreciated!

Best Answer

Using Feynman's trick works:

For $a\geq0$, let $$G(a)=\int_0^\infty \frac{\ln(2+ ax^2)}{4+x^2}\,\mathrm dx.$$

Then the Leibniz rule implies that for $a>0$, $$G'(a)=\int_0^\infty \frac{x^2}{\left(x^2+4\right) \left(a x^2+2\right)}\,\mathrm dx.$$ The last integrand is a rational function and thus has a closed form anti-derivative that can be computed algortihmically. Namely,

$$G'(a)=\left. \frac{\frac{\sqrt{2} \tan ^{-1}\left(\frac{\sqrt{a} x}{\sqrt{2}}\right)}{\sqrt{a}}+2 \tan ^{-1}\left(\frac{2}{x}\right)}{2-4 a}\right|_{x=0}^{x=\infty}=\dots=\frac{\pi}{2\sqrt2(1+\sqrt2\sqrt a)\sqrt a}.$$

We know that $G(a)=G(0)+\int_0^a G'(b)\,\mathrm db$. Indeed, $$\int_0^a G'(b)\,\mathrm db = \frac{\pi}{2\sqrt2} \int_0^a \frac1{(1+\sqrt{2}\sqrt b)\sqrt b}\,\mathrm db=\frac\pi2\ln(1+\sqrt2\sqrt a).$$

Also, $$G(0)=\ln(2)\int_0^\infty \frac{1}{4+x^2}\,\mathrm dx=\frac{\ln(2)\pi}4.$$

Hence,

$$\bbox[15px,border:1px groove navy]{ \int_0^\infty \frac{\ln(2+ x^2)}{4+x^2}\,\mathrm dx =G(1)=\frac{\pi}2\left(\frac{\ln(2)}2+\ln(1+\sqrt2)\right). }$$