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.

  • $\begingroup$ Check this. $\endgroup$ Aug 26, 2014 at 19:20
  • $\begingroup$ @ Tunk-Fey A question formulated like this lacks context and it shows no own effort. According to the rules of this forum it should have been closed instead of being edited by the moderation. $\endgroup$ May 12, 2020 at 11:28
  • $\begingroup$ Oh, this was a question in my Calculus exam... It brought back good/bad memories :D $\endgroup$
    – MR_BD
    Oct 25, 2023 at 21:12

7 Answers 7



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.

  • 14
    $\begingroup$ This is true elegance, sir! $\endgroup$
    – orion
    May 25, 2014 at 11:36
  • 3
    $\begingroup$ woops!! I almost forgot this method (+1) $\endgroup$
    – S L
    May 25, 2014 at 11:38
  • 3
    $\begingroup$ @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. $\endgroup$ May 25, 2014 at 11:41
  • $\begingroup$ @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. $\endgroup$ May 25, 2014 at 11:46
  • $\begingroup$ @ClaudeLeibovici I suddenly feel sportive and decided to add another method. By the way, I saw this problem first on Integration Bee on MIT. $\endgroup$
    – S L
    May 25, 2014 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}. $$

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

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.

  • 5
    $\begingroup$ I think the only reason this answer has less upvotes is because it was late to the game... this is very slick!!!! $\endgroup$ Mar 31, 2019 at 20:36
  • 3
    $\begingroup$ @ coreyman317 Thanks for your remark. The voting scheme sometimes produces peculiar results, so it should not be takes too seriously. $\endgroup$ Apr 2, 2019 at 9:25
  • $\begingroup$ such a nice solution(+1) $\endgroup$
    – p_square
    Jul 19, 2021 at 4:30

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$$


$\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}} $$


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)}}$


\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$


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$

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

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}. $$

  • $\begingroup$ 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$ ? $\endgroup$
    – user50618
    Jul 29, 2014 at 12:32
  • 1
    $\begingroup$ 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 $\endgroup$
    – user50618
    Jul 29, 2014 at 12:59
  • $\begingroup$ Try to combine answers? $\endgroup$ Aug 7, 2021 at 23:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .