# Evaluate $\int_0^\infty\frac{\ln x}{1+x^2}dx$

Evaluate $$\int_0^\infty\frac{\ln x}{1+x^2}\ dx$$
I don't know where to start with this so either the full evaluation or any hints or pushes in the right direction would be appreciated. Thanks.

Hint

Write $$\int_0^\infty\frac{\ln x}{(1+x^2)}dx=\int_0^1\frac{\ln x}{(1+x^2)}dx+\int_1^\infty\frac{\ln x}{(1+x^2)}dx$$ For the second integral make a change of variable $x=\frac{1}{y}$ and see the beauty of the result.

I am sure that you can take from here.

• This is true elegance, sir! – orion May 25 '14 at 11:36
• woops!! I almost forgot this method (+1) – Santosh Linkha May 25 '14 at 11:38
• @orion. I really appreciate your comment ! What I learnt is that simple is beautiful and vice-versa. And don't forget how old I am ! Cheers. – Claude Leibovici May 25 '14 at 11:41
• @SantoshLinkha. Nice but don't you think that, by the end, we are doing exactly the same thing ? I should enjoy a discussion with you on this topic. Cheers. – Claude Leibovici May 25 '14 at 11:46
• @ClaudeLeibovici I suddenly feel sportive and decided to add another method. By the way, I saw this problem first on Integration Bee on MIT. – Santosh Linkha May 25 '14 at 11:48

In general $$\mathcal{I}(\alpha)=\int_0^\infty\frac{\ln x}{x^2+\alpha^2}\ dx$$ can be evaluated by using substitution $u=\dfrac{\alpha^2}{x}\;\Rightarrow\;x=\dfrac{\alpha^2}{u}\;\Rightarrow\;dx=-\dfrac{\alpha^2}{u^2}\ du$, then \begin{align} \mathcal{I}(\alpha)&=\int_0^\infty\frac{\ln \left(\dfrac{\alpha^2}{u}\right)}{\left(\dfrac{\alpha^2}{u}\right)^2+\alpha^2}\cdot \dfrac{\alpha^2}{u^2}\ du\\ &=\int_0^\infty\frac{2\ln \alpha-\ln u}{\alpha^2+u^2}\ du\\ &=2\ln \alpha\int_0^\infty\frac{1}{\alpha^2+u^2}\ du-\int_0^\infty\frac{\ln u}{u^2+\alpha^2}\ du\\ &=2\ln \alpha\int_0^\infty\frac{1}{\alpha^2+u^2}\ du-\mathcal{I}(\alpha)\\ \mathcal{I}(\alpha)&=\ln \alpha\int_0^\infty\frac{1}{\alpha^2+u^2}\ du. \end{align} The last integral can easily be evaluated since it is a common integral. Using substitution $u=\tan\theta$, the integral turns out to be \begin{align} \mathcal{I}(\alpha)&=\frac{\ln \alpha}{\alpha}\int_0^{\Large\frac\pi2} \ d\theta\\ &=\large\color{blue}{\frac{\pi\ln \alpha}{2\alpha}}. \end{align} Thus $$\mathcal{I}(1)=\int_0^\infty\frac{\ln x}{x^2+1}\ dx=\large\color{blue}{0}.$$

• +1 for generalizing the result, and for your nice typesetting skills :) – David H May 25 '14 at 13:02
• @DavidH Thanks... :) – Tunk-Fey May 25 '14 at 13:08
• @Tunk-Fey. This is very elegant. Thanks for this nice answer. – Claude Leibovici May 25 '14 at 13:14
• @ClaudeLeibovici Thanks Sir. Yours is also elegant... :) – Tunk-Fey May 25 '14 at 13:19
• An easier substitution would have been $x \mapsto au$, with the same points as above =) – N3buchadnezzar Mar 27 '17 at 14:03

Here is one appraoch!!

changing $x = \tan \theta$ $$\int_{0}^{\pi/2} \frac{\log(\tan\theta)}{\sec^2 \theta} \sec^2 \theta d\theta = \int_0^{\pi/2} \log (\sin \theta) d\theta - \int_{0}^{\pi/2} \log (\cos \theta) d\theta$$

By changing $\theta \to \pi/2 - \theta$ on the latter integrand, we get $$\int_0^{\pi/2} \log (\sin \theta) d\theta - \int_{0}^{\pi/2} \log (\cos (\pi/2-\theta)) d\theta = \int_0^{\pi/2} \log (\sin \theta) d\theta - \int_{0}^{\pi/2} \log (\sin \theta) d\theta = 0$$

I'll evaluate a more general case using contour integration.

Consider $\displaystyle f(z) = \frac{\log z}{a^{2}+z^{2}}$ where the branch cut for $\log z$ is placed along the negative imaginary axis.

Now integrate around a contour that consists of the line segment $[-R,R]$ (with a small half-circle indentation around the branch point at the origin) and the upper half of the circle $|z|=R$.

As $R \to \infty$, the integral vanishes along the upper half of $|z|=R$ since $\displaystyle\lim _{|z| \to \infty} z f(z) = 0$.

And the integral vanishes along the small half-circle around the origin as the radius of the half-circle goes to zero since $\displaystyle \lim_{z \to 0} z f(z) = 0$.

Then going around the contour counterclockwise, \begin{align} \int_{-\infty}^{0} \frac{\log|x| + i \pi}{a^{2}+x^{2}} \ dx + \int_{0}^{\infty} \frac{\log x}{a^{2}+x^{2}} \ dx &= \int_{0}^{\infty} \frac{\log u + i \pi}{a^{2}+u^{2}} \ du + \int_{0}^{\infty} \frac{\log x}{a^{2}+x^{2}} \ dx \\ &= 2 \pi i \ \text{Res} [f(z),ia] \\ &= 2 \pi i \ \lim_{z \to ia} \frac{\log z}{z+ia} \\ &= 2 \pi i \ \frac{\log a + i \frac{\pi}{2}}{2ia} . \end{align}

And equating the real parts on both sides of the equation,

$$\int_{0}^{\infty} \frac{\log x}{a^{2}+x^{2}} \ dx = \frac{\pi \log a}{2a} .$$

Here's another general result, consider for $|a|\le 1$:

\begin{align*} I(a,b) &= \int_{0}^{\infty} \, \frac{x^a}{b^2+x^2}\, dx \\ &= \frac{b^{a-1}}{2} \int_{0}^{\infty} \, \frac{t^{(a-1)/2}}{1+t}\, dt \tag{1}\\ &= \frac{b^{a-1}}{2}\, \mathrm{B}\left(\frac{1+a}{2},\frac{1-a}{2}\right) \tag 2\\ &= \frac{b^{a-1}}{2}\, \frac{\pi}{\displaystyle \cos{\left(\frac{\pi}{2}a\right)}} \tag 3 \end{align*} $(1)$ is by subst. $\displaystyle x=b\sqrt{t}$

$(2)$ is by the definition of Beta function: $\displaystyle \mathrm{B}(a,b)=\int_{0}^{\infty} \, \frac{x^{a-1}}{(1+x)^{a+b}} \, dx$

$(3)$ is by using $\displaystyle \mathrm{B}(a,b)=\frac{\Gamma{(a)}\Gamma{(b)}}{\Gamma{(a+b)}}$ and Euler's reflection formula $\displaystyle \Gamma{(a)}\Gamma{(1-a)}=\frac{\pi}{\sin{\displaystyle \left({\pi}\, a\right)}}$

Hence,

\begin{align*} \int_{0}^{\infty} \, \frac{x^a \left(\log{x}\right)^n}{b^2+x^2}\, dx &= \frac{\partial^{n} }{\partial a^n} \left(\frac{b^{a-1}}{2}\, \frac{\pi}{\cos{\displaystyle \left(\frac{\pi}{2}a\right)}}\right) \end{align*} and when $b=1, n=1, a= 0$, the result is $0$

Update:

An even better result:

\begin{align*} \int_{0}^{\infty} \, \frac{x^a \left(\log{x}\right)^n}{b^c+x^c}\, dx &= \frac{\partial^{n} }{\partial a^n} \left(\frac{b^{a+1-c}}{c}\, \frac{\pi}{\sin{\displaystyle \left(\frac{1+a}{c}\pi\right)}}\right) \end{align*} where $\displaystyle 0<\frac{1+a}{c}<1$

• How did you get the value of the integral after "hence"? Where $\log^n$ was added – ClassicStyle Jul 13 '14 at 4:39
• @TylerHG : By differentiating $I(a,b)$ with respect to $a$ $n$ times. – gar Jul 13 '14 at 6:30

$\newcommand{\+}{^{\dagger}} \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{\down}{\downarrow} \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{\isdiv}{\,\left.\right\vert\,} \newcommand{\ket}[1]{\left\vert #1\right\rangle} \newcommand{\ol}[1]{\overline{#1}} \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{\ul}[1]{\underline{#1}} \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert} \newcommand{\wt}[1]{\widetilde{#1}}$ $$\color{#66f}{\Large I}\equiv\ \overbrace{\int_{0}^{\infty}{\ln\pars{x} \over 1 + x^{2}}\,\dd x} ^{\ds{x \mapsto {1 \over x}}}\ =\ \int_{\infty}^{0}{\ln\pars{1/x} \over 1 + \pars{1/x}^{2}} \,\pars{-\,{\dd x \over x^{2}}} =-\int_{0}^{\infty}{\ln\pars{x} \over 1 + x^{2}}\,\dd x=\color{#66f}{\Large -I}$$

$$\imp\ \color{#66f}{\Large I} + \color{#66f}{\Large I}=0\ \imp\ \color{#66f}{\Large I\equiv\int_{0}^{\infty}{\ln\pars{x} \over 1 + x^{2}}\,\dd x =\color{#c00000}{0}}$$

Another general approach :

Consider $$\int_0^\infty\frac{x^{b-1}}{a^2+x^2}\ dx.\tag1$$ Rewrite $(1)$ as \begin{align} \int_0^\infty\frac{x^{b-1}}{a^2+x^2}\ dx&=\frac1{a^2}\int_0^\infty\frac{x^{b-1}}{1+\left(\frac{x}{a}\right)^2}\ dx.\tag2 \end{align} Putting $x=ay\;\color{blue}{\Rightarrow}\;dx=a\ dy$ yields \begin{align} \int_0^\infty\frac{x^{b-1}}{a^2+x^2}\ dx&=a^{b-2}\int_0^\infty\frac{y^{b-1}}{1+y^2}\ dy, \end{align} where \begin{align} \int_0^\infty\frac{y^{b-1}}{1+y^2}\ dy=\frac{\pi}{2\sin\left(\frac{b\pi}{2}\right)}. \end{align} Hence \begin{align} \int_0^\infty\frac{x^{b-1}}{a^2+x^2}\ dx&=\frac\pi2\cdot\frac{a^{b-2}}{\sin\left(\frac{b\pi}{2}\right)}.\tag3 \end{align} Differentiating $(3)$ with respect to $b$ and setting $b=1$ yields \begin{align} \int_0^\infty\frac{\partial}{\partial b}\left[\frac{x^{b-1}}{a^2+x^2}\right]_{b=1}\ dx&=\frac\pi2\frac{\partial}{\partial b}\left[\frac{a^{b-2}}{\sin\left(\frac{b\pi}{2}\right)}\right]_{b=1}\\ \int_0^\infty\frac{\ln x}{x^2+a^2}\ dx&=\large\color{blue}{\frac{\pi\ln a}{2a}}. \end{align} Thus $$\int_0^\infty\frac{\ln x}{x^2+1}\ dx=\large\color{blue}{0}.$$

• Nice, is there a close form of $I=\int_0^1\dfrac{\ln x}{x^2+1}dx=-\int_1^{+\infty}\dfrac{\ln x}{x^2+1}dx$ ? – user50618 Jul 29 '14 at 12:32
• I have just tried Mathematica and it gave: $\int_0^1 \frac{\ln x}{1+x^2} \, dx=-catalan$, it is a constant defined on wikpedia:en.wikipedia.org/wiki/Catalan's_constant – user50618 Jul 29 '14 at 12:59

Here's another very short solution.

The substitution $$x \to e^t$$ transforms the integral to

$$\int_{-\infty}^{\infty} \frac{t}{e^t+e^{-t}}\,dt$$

which is zero by the anti-symmetry of the integrand.

• I think the only reason this answer has less upvotes is because it was late to the game... this is very slick!!!! – coreyman317 Mar 31 at 20:36
• @ coreyman317 Thanks for your remark. The voting scheme sometimes produces peculiar results, so it should not be takes too seriously. – Dr. Wolfgang Hintze Apr 2 at 9:25