106

Compute

$$\int_{0}^{1} \frac{\ln(x+1)}{x^2+1} \mathrm dx$$

Ali Caglayan
  • 5,726
user 1591719
  • 44,216
  • 12
  • 105
  • 255
  • wolfram gives the answer as 0.272198 –  Jun 09 '12 at 07:57
  • Mathematica gives the answer $\frac{\pi}{8} \log 2$. But I do not know how it computed this number... – Siminore Jun 09 '12 at 08:25
  • @Chris: Even, i thought of that only :) –  Jun 09 '12 at 08:26
  • 15
    Why dont you try and solve these Integrals yourself. Browsing through your most recent questions, you have had this type of question almost exclusively. Other users get downvoted for this. I see no reason not to hint the same to you and at least show some effort. -1 – CBenni Mar 20 '13 at 17:01
  • @CBenni: are you sure you saw all my questions? How about this? http://math.stackexchange.com/questions/299801/evaluate-lim-x-to-infty-left1-frac-ln-xfx-right-displaystyle-frac or http://math.stackexchange.com/questions/289172/compute-lim-s-to-0-left-int-01-gamma-xs-space-mathrmdx-right1 – user 1591719 Mar 20 '13 at 17:29
  • This is 2005 Putnam A5.http://www.artofproblemsolving.com/Forum/resources.php?c=2&cid=23&year=2005]AoPS – Ayesha Oct 03 '14 at 21:01
  • 6
    Why don't you try to show some of your work.... –  Jun 12 '15 at 10:29

8 Answers8

132

Put $x = \tan\theta$, then your integral transforms to $$I= \int_{0}^{\pi/4} \log(1+\tan\theta) \ d\theta. \tag{1}$$

Now using the property that $$\int_{0}^{a} f(x) \ dx = \int_{0}^{a} f(a-x) \ dx,$$ we have $$I = \int_{0}^{\pi/4} \log\biggl(1+\tan\Bigl(\frac{\pi}{4}-\theta\Bigr)\biggr) \ d\theta = \int_{0}^{\pi/4} \log\biggl(\frac{2}{1+\tan\theta} \biggr) \ d\theta.\tag{2}$$

Adding $(1)$ and $(2)$ we get $$2I = \int_{0}^{\pi/4} \log(2) \ d\theta\Rightarrow I= \log(2) \cdot \frac{\pi}{8}.$$

amWhy
  • 209,954
68

Consider: $$I(a) = \int_0^1 \frac{\ln (1+ax)}{1+x^2} \, dx$$ than, the derivative $I'$ is equal: $$I'(a) = \int_0^1 \frac{x}{(1+ax)(1+x^2)} \, dx = \frac{2 a \arctan x - 2\ln (1+a x) + \ln (1+x^2)}{2(1+a^2)} \Big|_0^1\\ = \frac{\pi a + 2 \ln 2}{4(1+a^2)} - \frac{\ln (1+a)}{1+a^2}$$ Hence: $$I(1) = \int_0^1 \left( \frac{\pi a + 2 \ln 2}{4(1+a^2)} - \frac{\ln (1+a)}{1+a^2} \right) \, da \\ 2 I(1) = \int_0^1 \frac{\pi a + 2 \ln 2}{4(1+a^2)} \, da = \frac{\pi}{4} \ln 2$$ Divide both sides by $2$ and you're done.

qoqosz
  • 3,508
  • 19
  • 27
56

Good evening, I've got another method by putting $x=(1-t)/(1+t)$, we obtain $$\int_0^1\frac{\ln (x+1)}{x^2+1}dx=\int_1^0\frac{\ln\frac{2}{1+t}}{\left(\frac{1-t}{1+t}\right)^2+1}\cdot\left\{-\frac{2}{(1+t)^2}\right\}dt =\int_0^1\frac{\ln 2-\ln (1+t)}{t^2+1}\ dt.$$ You can finish easily.

mrf
  • 43,639
Boulid
  • 561
  • 8
    That substitution is very powerful, and used it when I met ugly integrals. I didn't use it here (unfortunately). Great solution! (+1) – user 1591719 Jun 04 '13 at 21:09
  • How is the last expression any easier to computre than what we started with ? – CivilSigma Sep 06 '15 at 19:58
  • 2
    @CivilSigma, if you look at the first and last expressions, you see you have an equation of the form $A=B-A$, where $A$ is the integral you're trying to evaluate and $B$ is an integral that's easy to evaluate. – Barry Cipra Sep 13 '15 at 15:10
  • Great solution (+1) but how does one even think of that substitution in such situation? I mean, this is a clearly a "let's try it out and hope it works method". The accepted solution is more straightforward. – Gaurang Tandon Mar 10 '18 at 09:50
41

If $(1+x)(1+y)=2$, then $$\begin{align} x&=\frac{1-y}{1+y}\\ 1+x^2&=2\frac{1+y^2}{(1+y)^2}\\ \frac{1+x^2}{1+x}&=\frac{1+y^2}{1+y} \end{align}\tag{1} $$ and since $(1+y)\,\mathrm{d}x+(1+x)\,\mathrm{d}y=0$ we get $$ \frac{\mathrm{d}x}{1+x^2}=-\frac{\mathrm{d}y}{1+y^2}\tag{2} $$ Therefore, $$ \begin{align} \int_0^1\frac{\log(1+x)}{1+x^2}\mathrm{d}x &=\int_0^1\frac{\log(2)-\log(1+y)}{1+y^2}\mathrm{d}y\tag{3} \end{align} $$ Adding the left side to both sides and dividing by $2$ yields $$ \begin{align} \int_0^1\frac{\log(1+x)}{1+x^2}\mathrm{d}x &=\frac12\int_0^1\frac{\log(2)}{1+y^2}\mathrm{d}y\\ &=\frac\pi8\log(2)\tag{4} \end{align} $$

robjohn
  • 345,667
  • I excuse Mr robjohn. I did'nt see your answer. – Boulid Jun 04 '13 at 21:09
  • I love your answers! –  Jun 27 '21 at 15:08
  • $(1+x)(1+y)=2$ mysteriously appears in the beginning. Did you do reverse-engineering? – Display Name Sep 06 '21 at 15:12
  • Actually, I have used $(1+x)(1+y)=2$ many times. It means that $\tan^{-1}(x)+\tan^{-1}(y)=\frac\pi4$ and so, is useful to try in situations with $\frac1{1+x^2}$ in the denominator. The arctangent relation leads immediately to $(2)$. – robjohn Sep 06 '21 at 16:36
25

Start with $$\begin{align*} \int_0^{\pi/4} \ln(1+\tan x)dx &= \int_0^{\pi/4} \ln(\sin x+\cos x)dx - \int_0^{\pi/4} \ln(\cos x)dx \\ &= \int_0^{\pi/4} \ln\left(\cos(x-\frac{\pi}4)\right)dx +\int_0^{\pi/4} \ln(\sqrt 2)dx - \int_0^{\pi/4} \ln(\cos x)dx. \end{align*}$$ Now change $\pi/4-x=t$ in the first integral: $$=\int_0^{\pi/4} \ln(\cos t) dt +\int_0^{\pi/4} \ln(\sqrt 2)dx - \int_0^{\pi/4} \ln(\cos x)dx$$ and the result follows. Changing $x=\tan u$ in the first integral yields your integral. As far as I know these are said Bertrand's integrals.

@Chandrasehkar: see here http://ocw.mit.edu/courses/mathematics/18-304-undergraduate-seminar-in-discrete-mathematics-spring-2006/projects/integratnfeynman.pdf

Ben Millwood
  • 14,211
15

Let us consider $$A=\iint_{[0,1]^2}\frac{x}{(1+xy)(1+x^2)}dx dy$$ By Fubini's theorem, we have : $$A=\int_0^1\left[\frac{1}{1+x^2}\int_0^1\frac{x\,dy}{1+xy}\right]dx=\int_0^1\frac{\ln(1+x)}{1+x^2}dx$$ and$$A=\int_0^1\left[\int_0^1\frac{x}{(1+xy)(1+x^2)}dx\right]dy$$But$$\frac{x}{(1+xy)(1+x^2)}=\frac{1}{1+y^2}\left(\frac{-y}{1+xy}+\frac{x+y}{1+x^2}\right)$$and therefore$$A=\int_0^1\frac{1}{1+y^2}\left(-\ln(1+y)+\frac{\ln(2)}{2}+\frac{\pi y}{y}\right)dy=-A+\frac{\pi\ln(2)}{4}$$Finally :$$\boxed{\int_0^1\frac{\ln(1+x)}{1+x^2}dx=\frac{\pi\ln(2)}{8}}$$

Adren
  • 7,515
  • 10
  • 26
  • How did you see this magical decomposition: $\frac{x}{(1+xy)(1+x^2)} = \frac{1}{1+y^2} \left( \frac{-y}{1+xy} + \frac{x+y}{1+x^2} \right)$ ? – Sandeep Silwal Mar 17 '17 at 20:37
  • 1
    @SandeepSilwal : it is merely a partial fraction decomposition in the real domain (where the main variable is considered to be $x$). No magic at all in it ;-) The interesting part is that this transformation leads to an explicit calculation. – Adren Sep 22 '18 at 09:54
3

Note \begin{align} &\int_0^1\frac{\ln (x+1)}{x^2+1}dx =\int_0^1\underset{x\to\frac{1-x}{1+x}}{\frac{\ln \frac{x+1}{\sqrt{x^2+1}}}{x^2+1}}dx + \int_0^1\frac{\ln \sqrt{x^2+1}}{x^2+1}dx\\ &= \int_0^1\frac{\ln \frac{\sqrt2}{\sqrt{x^2+1}}}{x^2+1}dx + \int_0^1\frac{\ln \sqrt{x^2+1}}{x^2+1}dx = \frac{\ln2}2\int_0^1\frac{dx}{x^2+1}=\frac\pi8\ln2 \end{align}

Quanto
  • 97,352
  • This is the same method posted by both @boulid and Robert Johnson more than 7 years before your post herein. – Mark Viola May 20 '21 at 20:21
-1

You can use the residue theory to calculate
$$J=\int_{-\infty}^\infty \frac{\ln|1+x|}{(1+x^2)} \, dx $$
by putting $$f(z)=\frac{\ln(1+z)}{(1+z^2)}$$ and we obtain $$J = 2\pi i\frac{\ln(1+i)}{(i+i)}=\pi\ln\left(\sqrt2e^{\frac14\pi i}\right)=\pi\left(\frac12\ln2+\frac14\pi i\right)=\frac{\pi}{2}\ln 2+\frac{\pi^2i}4$$

$$J=\int_{-\infty}^{-1}\frac{\ln(1+x)}{1+x^2} \, dx +\int_{-1}^0 \frac{\ln(1+x)}{1+x^2} \, dx +\int_0^1\frac{\ln(1+x)}{1+x^2} \, dx +\int_1^\infty \frac{\ln(1+x)}{1+x^2} \, dx$$

Then by putting $(t-1)e^{\pi i}=1+x$ in the first integral we obtain: $$\int_{-\infty}^{-1}\frac{\ln(1+x)}{1+x^2}dx=\int_1^{\infty}\frac{\pi i+\ln(t-1)}{t^2+1}dt=\frac{\pi^2i}4+\int_1^{\infty}\frac{\ln(t-1)}{t^2+1}dt$$

Then by putting $t=-x$ in the second integral we obtain: $$\int_0^1\frac{\ln(1-x^2)}{1+x^2}dx+\int_1^{\infty}\frac{\ln(x^2-1)}{1+x^2}dx=\frac{\pi}2\ln2$$

then by putting $t=1/x$ in the second integral we obtain: $$\int_0^1\frac{\ln(1-x^2)}{1+x^2}dx-\int_0^1\frac{\ln x}{1+x^2}dx=\frac{\pi}4\ln2$$

and we put $x=(1-t)/(1+t)$ in the first integral we obtain after calculus : $$\int_0^1 \frac{\ln \, (1+x)}{1+x^2}= \frac{\pi}{8} \ln 2$$

user5713492
  • 15,938
Michel
  • 31
  • 12
    It's almost impossible to read this. You should find and read an introduction to MathJax, like this. – Henrik supports the community Jul 09 '16 at 17:39
  • In posting an Answer to a (by now four year old) Question having already an Accepted Answer, it is helpful to your Readers to highlight what new information you provide. – hardmath Jul 09 '16 at 19:48
  • why it's impossible ? – Michel Jul 30 '16 at 09:15
  • @Michel I mean, compared to the accepted answer, which one is much easier to read? Also, you spelled "residue" wrong. – Frank W May 20 '18 at 04:18
  • @mjw I was curious about how this was working as well :) – user5713492 Mar 12 '20 at 23:13
  • @user5713492, Thanks for taking on editing/LaTeXing/MathJaxing this! Now we'll have to look at it and see if it's got everything ... – mjw Mar 13 '20 at 02:00
  • This is an interesting approach, but there is a branch point at $z=-1$, so we need to handle that as well by defining the branch cut and integrating along a small semicircle around this point. – mjw Mar 13 '20 at 02:27
  • @mjw Yeah, I was careful about that branch point and my little semicircle ran above it. That's why the phase of the logarithm was $e^{\pi i/4}$ at $x=i$ and $e^{\pi i}$ on the real axis for $x<-1$. AFAIK the residue theorem is incompatible with absolute value. The integral over the semicircle of radius $r$ can be bounded in magnitude by $-\pi r\ln r/(1-r^2)$ so it vanishes in the limit as $r\rightarrow\infty$. The details after $x=(1-t)/(1+t)$ are perhaps a bit unexpected in that the residue that was carefully computed at the very beginning was completely canceled out and then some! – user5713492 Mar 13 '20 at 08:51
  • Looks nice, but I think there are some questions: How does $\int_{-1}^0 \frac{\ln |1+x|}{1+x^2} , dx$ become $\int_{-1}^0 \frac{\ln (1+x)}{1+x^2} , dx$ and then $\int_{0}^1 \frac{\ln (1-x^2)}{1+x^2} , dx$ ? – mjw Mar 13 '20 at 13:50
  • 1
    @mjw For $-1< x<0$, $0<(1+x)<1$ so the absolute value bars do nothing. Then he has $$\begin{align}\int_{-1}^0\frac{\ln(1+x)}{1+x^2}dx+\int_0^1\frac{\ln(1+x)}{1+x^2}dx&=\int_0^1\frac{\ln(1-t)}{1+t^2}dt+\int_0^1\frac{\ln(1+t)}{1+t^2}dt\ &=\int_0^1\frac{\ln(1-x^2)}{1+x^2}\end{align}$$ Where he let $x=-t$ in the first integral and $x=t$ in the second. – user5713492 Mar 13 '20 at 15:20
  • Yes and yes! Thank you! – mjw Mar 13 '20 at 15:29