# Help me evaluate $\int_0^1 \frac{\log(x+1)}{1+x^2} dx$

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.

-
–  Mhenni Benghorbal Mar 12 '13 at 3:43

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

-
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) –  Gabi Purcaru Jul 18 '12 at 8:58

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

-
+1 No reason to make it overly complicated ;) –  Pedro Tamaroff Jul 18 '12 at 11:42

Let

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

-
For other examples of the technique, please see this. –  André Nicolas Jul 17 '12 at 20:31
@André Nicolas : Is it also possible to convert it into double integral and solve it ? –  Theorem Jul 17 '12 at 20:38
@Theorem That should also work, and I also reccommend it. It should be an eigth of $\pi \log 2$. –  Pedro Tamaroff Jul 17 '12 at 20:38
@PeterTamaroff : nice . –  Theorem Jul 17 '12 at 20:48

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_0=\frac{\pi}{4}$

$C_1=\frac{1}{2}\log2$

$C_2=1-\frac{\pi}{4}$

$C_3=\frac{1}{2}-\frac{1}{2}\log2$

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

-


-
+1 For using simple methods! –  Integrals Apr 30 at 13:05

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 a- I(a).\end{align*}

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

-
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) –  Cortizol Jun 29 '13 at 20:13