I need to evaluate this integral: $\int_0^1 \frac{\log(x+1)}{1+x^2} dx$.

I've tried $t=\log(x+1)$, $t=x+1$, but to no avail. I've noticed that:

$\int_0^1 \frac{\log(x+1)}{1+x^2} dx = \int_0^1\log(x+1) \arctan'(x)dx =\left. \log(x+1)\arctan(x) \right|_{x=0}^{x=1} - \int_0^1\frac{\arctan(x)}{x+1}dx$

But can't get further than this.

Any help is appreciated, thank you.


7 Answers 7


Going a little round-about way. Consider, for $ s \geqslant 0$, a parametric modification of the integral at hand: $$ \mathcal{I}(s) = \int_0^1 \frac{\log(1+s x)}{1+x^2} \mathrm{d} x $$ The goal is to determine $\mathcal{I}(1)$. Now: $$ \begin{eqnarray} \mathcal{I}(1) &=& \int_0^1 \mathcal{I}^\prime(s) \mathrm{d} s = \int_0^1 \left( \int_0^1 \frac{x}{1+s x} \frac{\mathrm{d} x}{1+x^2} \right) \mathrm{d} s \\ &=& \int_0^1 \left.\left( - \frac{1}{1+s^2} \log(1+s x) + \frac{s}{1+s^2} \arctan(x) + \frac{1}{2} \frac{\log(1+x^2)}{1+x^2} \right) \right|_{x=0}^{x=1} \mathrm{d} s \\ &=& \int_0^1 \left( \color\green{ -\frac{\log(1+s)}{1+s^2}} + \frac{1}{4} \frac{\pi s+\log(4)}{1+s^2}\right) \mathrm{d} s = - \mathcal{I}(1) + \frac{1}{4} \pi \log(2) \end{eqnarray} $$ Hence $$ \mathcal{I}(1) = \frac{\pi}{8} \log(2) $$

  • 1
    $\begingroup$ This seems like a great solution, but I'll need to take some time to properly "digest" it (I've never seen this technique so far, and I want to make sure I properly understand what happens) $\endgroup$ Jul 18, 2012 at 8:58
  • $\begingroup$ (+1) A classical example of an application of "Feynman's Trick." $\endgroup$
    – Mark Viola
    Jun 26, 2021 at 23:33

Here's a solution that uses simpler tools (or at least tools that I'm more familiar with):

$I =\int_0^1\frac{\log(1+x)}{1+x^2} dx $. We change $x$ into $x=\tan(t)$. Then $t=\arctan{x}$, $dt=\frac{1}{1+x^2}dx$, and the integral becomes:

$I = \int_0^{\frac{\pi}{4}}\log(1+\tan(t))dt$. Now $s = \frac{\pi}{4}-t$, $ds=-dt$, and the integral becomes:

$I = -\int_{\frac{\pi}{4}}^0 \log(1+\tan(\frac{\pi}{4}-s))ds = \int_0^{\frac{\pi}{4}} \log(1+\tan(\frac{\pi}{4}-s))ds$

Using $\tan(a-b) = \frac{\tan a - \tan b}{1 + \tan(a)\tan(b)}$, we have

$I = \int_0^{\frac{\pi}{4}} \log(1+\frac{1 - \tan s}{1 + \tan s}) ds = \int_0^{\frac{\pi}{4}}\log(\frac{2}{1+\tan s}) ds = \int_0^{\frac{\pi}{4}} (\log(2) - \log(1+\tan s)) ds = \int_0^{\frac{\pi}{4}}\log(2)ds - I = \frac{\pi}{4}\log(2) - I$.

So $I = \frac{\pi}{4}\log(2) - I$, hence $I = \frac{\pi}{8}\log(2)$.



$$I(a)=\int_0^1 \frac{\log(1+ax)}{1+x^2}dx$$

Differentiate it, to get

$$I'(a)=\int_0^1 \frac{x}{(1+ax)(1+x^2)}dx$$

Integrate that rational function, then integrate w.r.t. $a$ and find $I(a=1)$.

As Theorem suggested, you can also do the following:

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

$$\int_0^1 \left(\int_0^x \frac{1}{1+y}dy\right)\frac{1}{1+x^2}dx$$

$$\int_0^1 \int_0^x \frac{1}{1+y}dy\frac{1}{1+x^2}dx$$

Now make a change of variables $y=ux$ in the inner integral:

$$\tag 1 \int_0^1 \int_0^1 \frac{x}{1+ux}\frac{1}{1+x^2}dudx$$

Now partial fractions:

$${x \over {1 + xu}}{1 \over {1 + {x^2}}} = {1 \over {1 + {u^2}}}{x \over {1 + {x^2}}} + {u \over {1 + {u^2}}}{1 \over {1 + {x^2}}} - {u \over {1 + {u^2}}}{1 \over {1 + xu}}$$

Now, integrating the first two terms, which account to the same$^1$, gives that you integral is

$$\mathcal I=\frac \pi 4\log 2-\int_0^1\int_0^1 \frac u {1+u^2}\frac{1}{1+xu}dxdu$$

Now, the latter integral is just our original integral, due to symmetry, as you see in $(1)$

This means that $$\mathcal I =\frac \pi 8 \log 2$$

as desired. $1$: symmetry, once again.

See here for a similar integral and its solution with double integrals.

Some insight about the two methods considered:

Note that as Sasha is showing

$$I(1)=\int_0^1 I'(a)da=\int_0^1 \int_0^1\frac{x}{(1+ax)(1+x^2)}dxda$$ which is exaclty what we got in the second option

$$I=\int_0^1\int_0^1 \frac{1 }{1+mx}\frac{x}{1+x^2}dxdm$$

This means any way you find to solve any of the two will indeed solve the other.

  • $\begingroup$ For other examples of the technique, please see this. $\endgroup$ Jul 17, 2012 at 20:31
  • $\begingroup$ @André Nicolas : Is it also possible to convert it into double integral and solve it ? $\endgroup$
    – Theorem
    Jul 17, 2012 at 20:38
  • $\begingroup$ @Theorem That should also work, and I also reccommend it. It should be an eigth of $\pi \log 2$. $\endgroup$
    – Pedro
    Jul 17, 2012 at 20:38
  • $\begingroup$ @PeterTamaroff : nice . $\endgroup$
    – Theorem
    Jul 17, 2012 at 20:48
  • $\begingroup$ This is indeed no different from Sasha's. $\endgroup$
    – Mark Viola
    Jun 26, 2021 at 23:32

$\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}}$ \begin{align} \color{#00f}{\large\int_{0}^{1}{\ln\pars{1 + x} \over 1 + x^{2}}\,\dd x}& =\int_{0}^{\pi/4}\ln\pars{1 + \tan\pars{\theta}}\,\dd\theta \\[3mm]&=\half\bracks{% \int_{0}^{\pi/4}\ln\pars{1 + \tan\pars{\theta}}\,\dd\theta + \int_{0}^{\pi/4}\ln\pars{1 + \tan\pars{{\pi \over 4} - \theta}}\,\dd\theta} \\[3mm]&=\half\bracks{% \int_{0}^{\pi/4}\ln\pars{1 + \tan\pars{\theta}}\,\dd\theta + \int_{0}^{\pi/4}\ln\pars{% 1 + {1 - \tan\pars{\theta} \over 1 + \tan\pars{\theta}}}\,\dd\theta} \\[3mm]&=\half\bracks{% \int_{0}^{\pi/4}\ln\pars{1 + \tan\pars{\theta}}\,\dd\theta + \int_{0}^{\pi/4}\ln\pars{2\over 1 + \tan\pars{\theta}}\,\dd\theta} \\[3mm]&=\half\int_{0}^{\pi/4}\ln\pars{2}\,\dd\theta =\color{#00f}{\large{1 \over 8}\,\pi\ln\pars{2}} \end{align}

  • $\begingroup$ @JeffFaraci Thanks a lot. $\endgroup$ Jul 1, 2017 at 21:45
  • 2
    $\begingroup$ (+1) Very concise and clear! $\endgroup$
    – Mark Viola
    Jun 26, 2021 at 23:23

I solved this integral a couple of years ago and I had this solution typed out in $\LaTeX$ already. The solution is not conventional, so I think it's worth sharing!

First, substitute the series $$\log(1+x)=\sum_{n=1}^\infty \frac{(-1)^{n-1}x^n}{n}.$$

This series is uniformly convergent on $[0,1]$, so we can interchange the sum and the integral. We get

$$I=\sum_{n=1}^\infty \frac{(-1)^{n-1}}{n} \int_0^1 \frac{x^n}{1+x^2}\: \mbox{d}x. = \sum_{n=1}^\infty \frac{(-1)^{n-1}}{n}C_n$$

where $$C_n=\int_0^1 \frac{x^n}{1+x^2} \mbox{d}x.$$

Now since $$x^{n-2}-\frac{x^{n-2}}{1+x^2}=\frac{x^n}{1+x^2},$$

we have, integrating this equation on $[0,1]$, $$\frac{1}{n-1}-C_{n-2}=C_n.$$ Hence we have a recurrence relation for the $C_n$'s. Let's see what this gives. We have $$C_0=\int_0^1 \frac{ \mbox{d}x}{1+x^2} = \arctan(1) = \frac{\pi}{4},$$ and

$$C_1=\int_0^1 \frac{x\ \mbox{d}x}{1+x^2} = \frac{1}{2}\log2.$$

Now using the recurrence we find





$C_4 = -1+\frac{1}{3} +\frac{\pi}{4}$

$C_5=-\frac{1}{2}+\frac {1}{4} +\frac{1}{2}\log 2$

$C_6=1-\frac{1}{3}+\frac{1}{5} - \frac{\pi}{4}$


Now if we define

$$A_n = \sum_{k=1}^n\frac{(-1)^{k-1}}{2k},$$ $$B_n = \sum_{k=1}^n\frac{(-1)^{k-1}}{2k-1},$$ it is easy to see by induction that $$C_{2n} = (-1)^n\left(\frac{\pi}{4}-B_n\right)$$ and

$$C_{2n-1} = (-1)^{n-1}\left(\frac{\log 2}{2} -A_{n-1}\right).$$

Notice that $A_n \rightarrow \frac{1}{2}\log2$ as $n\rightarrow \infty$ [recall the series expansion of $\log(1+x)$], and that $B_n \rightarrow \frac{\pi}{4}$ as $n\to \infty$ [recall the series expansion of $\arctan x$, which you can get by integrating $(1+x^2)^{-1}$].

Let us examine the partial sums

$$I_{2N}=\sum_{n=1}^{2N} \frac{(-1)^{n-1}}{n}C_n.$$

We can split this into the odd-labeled terms and the even-labeled terms, as

$$I_{2N}= \sum_{n=1}^{N} \frac{C_{2n-1}}{2n-1} - \sum_{n=1}^{N} \frac{C_{2n}}{2n}.$$

Now we can substitute the values of $C_{2n}$ and $C_{2n-1}$ obtained before. First, let us look at the sum of the even-labeled terms. We have

$$\sum_{n=1}^{N} \frac{C_{2n}}{2n} =\sum_{n=1}^{N} \frac{ (-1)^{n}}{2n}\left(\frac{\pi}{4}-B_n\right)=-\frac{\pi}{4}A_N +\sum_{n=1}^N\frac{(-1)^{n-1}}{2n}B_n $$

Now let us recall Cauchy's partial summation formula. For sequences $\{a_n\}, \{b_n\}$, we denote $\{\Delta a_n\}$ the sequence of forward differences $\Delta a_n = a_{n+1}-a_n$. Then we have

$$\sum_{n=1}^N b_n \Delta a_{n-1} = b_Na_N - b_1a_0 -\sum_{n=1}^{N-1} \Delta b_n a_n.$$

Remark that $\Delta A_{n-1} = \frac{(-1)^{n-1}}{2n}$. Also, $A_0=0$. Hence,

$$-\frac{\pi}{4}A_N +\sum_{n=1}^N\Delta A_{n-1}B_n = -\frac{\pi}{4}A_N +B_NA_N -\sum_{n=1}^{N-1}\Delta B_n A_n.$$

(Call this sum (1)).

Now we go back to the sum of the odd-labeled terms. We have, in a similar fashion,

$$\sum_{n=1}^{N} \frac{C_{2n-1}}{2n-1} = \sum_{n=1}^{N} \frac{(-1)^{n-1}}{2n-1}\left(\frac{\log 2}{2} - A_{n-1}\right) = \frac{\log 2}{2} B_N - \sum_{n=1}^N \Delta B_{n-1}A_{n-1}$$ $$= \frac{\log 2}{2} B_N - \sum_{n=0}^{N-1} \Delta B_{n}A_{n}.$$ (Call this sum (2)).

Now, subtracting (1) from (2), we get

$$I_{2N} = \frac{\log 2}{2}B_N + \frac{\pi}{4}A_N - B_NA_N +\Delta B_0 A_0$$ $$= \frac{\log 2}{2}B_N + \frac{\pi}{4}A_N - B_NA_N$$

Now as $N\to \infty$, since $A_N \to \frac{1}{2}\log 2$ and $B_N \to \frac{\pi}{4}$, we have

$$I = \int_0^1\frac{\log(1+x)}{1+x^2}\: \mbox{d}x = \lim_{N\to \infty} I_{2N} = \frac{\pi \log 2}{8}.$$


$\displaystyle A=\int_0^1\dfrac{\Big(\log(1+x)\Big)^2}{1+x^2}dx$

Perform the change of variable $y=\dfrac{1-x}{1+x}$

$\displaystyle A=\int_0^1\dfrac{\left(\log\left(\dfrac{2}{1+x}\right)\right)^2}{1+x^2}dx=\int_0^1\dfrac{\Big(\log 2-\log(1+x)\Big)^2}{1+x^2}dx$

$\displaystyle A=\int_0^1\dfrac{\Big(\log 2\Big)^2}{1+x^2}dx-2\int_0^1\dfrac{\log 2\log(1+x)}{1+x^2}dx+A$


$\displaystyle \int_0^1\dfrac{2\log 2\log(1+x)}{1+x^2}dx=\int_0^1\dfrac{\Big(\log 2\Big)^2}{1+x^2}dx$


$\displaystyle \int_0^1\dfrac{\log(1+x)}{1+x^2}dx=\int_0^1\dfrac{\log 2}{2(1+x^2)}dx=\dfrac{\log 2}{2}\Big[\arctan x\Big]_0^1=\dfrac{\pi\log 2}{8}$

  • $\begingroup$ (+1) Nice. How did you come up with this? $\endgroup$
    – joriki
    Jun 14, 2016 at 0:05
  • $\begingroup$ It's a stuff you're regularly rediscovering when playing with such integrals. At the moment, i'm trying to give an evaluation (in terms of usual constants and special valules of well-known functions) of the integral named A above. $\endgroup$
    – FDP
    Jun 14, 2016 at 6:20
  • 1
    $\begingroup$ Actually, one can simplify the computation. Perform directly the change of variable $y=\dfrac{1-x}{1+x}$ in the requested integral. $\endgroup$
    – FDP
    Jun 14, 2016 at 17:12
  • $\begingroup$ The simplified computation above is a worthy answer on its own. I found it the simplest among the methods on this page. $\endgroup$ Dec 28, 2018 at 9:47
  • $\begingroup$ (+1) This was nicely done! $\endgroup$
    – Mark Viola
    Jun 26, 2021 at 23:31

For these integrals are very useful substitutions homograph type.

To note $\displaystyle I(a) = \int^{a}_{0}\frac{\ln(x+a)}{x^{2}+a^2}dx.$

Using the substitution $x=\dfrac{-at+a^2}{t+a} = u(t)$ with $u'(t)=-\dfrac{2a^2}{(t+a)^2} $ we find $$\begin{align*}I(a) &= \int^{0}_{a}\frac{\ln\left(\frac{-at+a^2}{t+a}+a\right)}{\left(\frac{-at+a^2}{t+a}\right)^2+a^2}\left(- \frac{2a^2}{(t+a)^2}\right)dt=\\ &= \int^{a}_{0}\frac{\ln 2a^2 - \ln(t+a)}{t^2+a^2}dt = \\ &=\int^{a}_{0}\frac{\ln 2a^2}{t^2+a^2}dt -\int^{a}_{0}\frac{\ln(t+a)}{t^2+a^2}dt=\\ & =\frac{\ln2a^{2}}{a} \arctan 1- I(a).\end{align*}$$

And finally $$I(a) = \dfrac{\pi}{8}\cdot\frac{\ln2a^{2}}{a}.$$ For $ a= 1$ we obtain $I(1) = \dfrac{\pi}{8}\ln2.$

See also: http://www.recreatiimatematice.ro/arhiva/articole/RM12011DICU.pdf

  • $\begingroup$ I edited your answer. If you are interesting in $TeX$ code you can see it clicking on edit button. For some basic information about writing math at this site see e.g. here, here, here and here. And nice answer! (+1) $\endgroup$
    – Cortizol
    Jun 29, 2013 at 20:13
  • $\begingroup$ medicu - Small error in your final answer for $I(a)$. It should be $I(a) = \frac{\pi \ln (2a^2)}{8 a}$. $\endgroup$
    – omegadot
    Feb 23, 2016 at 1:46
  • $\begingroup$ Thank you very much! I corrected. $\endgroup$
    – medicu
    Feb 25, 2016 at 11:30
  • $\begingroup$ Why not enforce an initial substitution $x\mapsto ax$ and then make the mobius transformation $x\mapsto \frac{1-x}{1+x}$? This seems more natural to me. $\endgroup$
    – Mark Viola
    Jun 26, 2021 at 23:29

You must log in to answer this question.

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