# Why is $\int_{0}^{\infty} \frac {\ln x}{1+x^2} \mathrm{d}x =0$?

We had our final exam yesterday and one of the questions was to find out the value of:
$$\int_{0}^{\infty} \frac {\ln x}{1+x^2} \mathrm{d}x$$
Interestingly enough, using the substitution $x=\frac{1}{t}$ we get – $$-\int_{0}^{1} \frac {\ln x}{1+x^2} \mathrm{d}x = \int_{1}^{\infty} \frac {\ln x}{1+x^2} \mathrm{d}x$$and therefore $\int_{0}^{\infty} \frac {\ln x}{1+x^2} \mathrm{d}x = 0$

I was curious to know about the theory behind this interesting (surprising even!) example.

Thank you.

#### Solutions Collecting From Web of "Why is $\int_{0}^{\infty} \frac {\ln x}{1+x^2} \mathrm{d}x =0$?"

When I see an $1 + x^2$ in the denominator it’s tempting to let $\theta = \arctan(x)$ and $d\theta = {1 \over 1 + x^2} dx$. When you do that here the integral becomes
$$\int_0^{\pi \over 2} \ln(\tan(\theta))\,d\theta$$
$$= \int_0^{\pi \over 2} \ln(\sin(\theta))\,d\theta – \int_0^{\pi \over 2} \ln(\cos(\theta))\,d\theta$$
The two terms cancel because $\cos(\theta) = \sin({\pi \over 2} – \theta)$.

Also, if you do enough of these, you learn that doing the change of variables from $x$ to ${1 \over x}$ converts a ${dx \over 1 + x^2}$ into $-{dx \over 1 + x^2}$, so it becomes one of the “tricks of the trade” for integrals with $1 + x^2$ in the denominator. An example: show this trick can be used to show that the following integral is independent of $r$:
$$\int_0^{\infty} {dx \over (1 + x^2)(1 + x^r)}$$

I’m not exactly sure what kind of theory behind the integral you’re looking for, but to me the points that pop out are that $dx/x=d(\log x)$ and $1+x^2=(1/x+x)x$ so that we have

$$\frac{\log x}{1+x^2}dx=\frac{u\, du}{e^{-u}+e^u}$$

after the change of variables $u=\log x$. As $x$ ranges over $(0,\infty)$, $u$ ranges over $\Bbb R$, and the integrand in the right-hand side, $u/(e^{-u}+e^u)$, is an antisymmetric aka odd function of $u$. Integrals of odd functions on intervals that are symmetric about the origin are always zero.

In hindsight, one can extract a general principle from this example. Let $f(x)$ be a say continuous function. Suppose also that
$$\frac{1}{x}f\left(\frac{1}{x}\right)=-xf(x)$$
for all relevant $x$. Then for any $b\ne 0$,
$$\int_{1/b}^b f(x)\,dx=0.\tag{1}$$

Under the same conditions, if the improper integral converges, we have
$$\int_0^\infty f(x)\,dx=0.$$

The proof of either result is the same as the proof by anon in the particular case $f(x)=\frac{\log x}{1+x^2}$. For $(1)$, break up the integral into two parts, $1/b$ to $1$ and $1$ to $b$. For the integral between $1/b$ and $1$, make the change of variable $u=1/x$.

Remark: If a trick or idea solves a concrete problem, one can reverse engineer and identify the problems for which essentially the same idea works. In this case, the reverse engineering does not seem to produce something of general interest. Instead, one should just draw the general lesson: Symmetry is your friend. Exploit it. (That rewording of Polya didn’t come out sounding quite right.)

It is sufficient to consider $x={e}^{t}$. Then $dx={e}^{t}\,dt$. we have:

$$\int_{0}^{\infty}\frac{\ln x}{1+x^{2}}dx=\int_{-\infty}^{\infty}\frac{t{e}^{t}}{1+{e}^{2t}}dt=0$$

Recall that the function $\frac{t\mathrm{e}^{t}}{1+e^{2t}}$ is odd.

$\newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle} \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack} \newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,} \newcommand{\dd}{{\rm d}} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,{\rm e}^{#1}\,} \newcommand{\fermi}{\,{\rm f}} \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,} \newcommand{\half}{{1 \over 2}} \newcommand{\ic}{{\rm i}} \newcommand{\iff}{\Longleftrightarrow} \newcommand{\imp}{\Longrightarrow} \newcommand{\pars}[1]{\left(\, #1 \,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\pp}{{\cal P}} \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,} \newcommand{\sech}{\,{\rm sech}} \newcommand{\sgn}{\,{\rm sgn}} \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}} \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}$
$\ds{}$
\begin{align}
I&\equiv\color{#c00000}{\int_{0}^{\infty}{\ln\pars{x} \over 1 + x^{2}}\,\dd x}
=\int_{\infty}^{0}{\ln\pars{1/x} \over 1/x^{2} + 1}\,\pars{-\,{\dd x \over x^{2}}}
=-\color{#c00000}{\int_{0}^{\infty}{\ln\pars{x} \over 1 + x^{2}}\,\dd x}
=-I\ \imp 2I = 0
\color{#66f}{\large\int_{0}^{\infty}{\ln\pars{x} \over 1 + x^{2}}\,\dd x = 0}
\end{align}

At the risk of stating the obvious, I would suggest examining the curve of ${\ln x}\over{(1+x^2)}$:

The geometrical interpretation is that the area below the $x$-axis down to the curve from 0 to 1 is equal to the area above the $x$-axis up to the curve from 1 to infinity.

Note that the function ln(x) is negative on the interval $(0, 1)$, so the whole integrand is negative on the interval $(0,1)$. While $ln(x)$ is positive on the interval $(1, \infty)$, so the whole integrand is positive on the interval $(1,\infty)$. By splitting the integral on the above two intervals and evaluating the two integrals, we find the value of the integral on the interval $(0,1)$ equals -catalan ( $\sim 0.915965594$. ) and value of the integral on the interval $(1,\infty )$ equals catalan. So the value of the whole integral is $0$.

You demonstrated yourself why the result is 0 (by making the change $u = \frac{1}{x}$).

I think you can view this it as the same as this integral: $\displaystyle\int_{-\infty}^{\infty}x dx = \displaystyle\lim_{X\rightarrow +\infty} \int_{-X}^X xdx=0$.

Note that I am not sure that $\int_{-\infty}^{\infty}x dx$ is actually defined, but this also applies to your integral $\displaystyle\int_0^{\infty}\displaystyle\frac{\ln x}{1+x^2}dx$.