38

How would I go about evaluating this integral? $$\int_0^{\infty}\frac{\ln(x^2+1)}{x^2+1}dx.$$ What I've tried so far: I tried a semicircular integral in the positive imaginary part of the complex plane, excluding the negative real axis, but had trouble calculating the residue at $z=i$ (perhaps there is a way of doing this that I don't know of). After that didn't work, I tried a rectangular box integral from $\epsilon$ to $R$, from $R$ to $R+i/2$, from $R+i/2$ to $-S+i/2$, from $-S+i/2$ to $-S+i\epsilon$, from $-S+i\epsilon$ to $-\epsilon+i\epsilon$ and finally a semicircle around the origin, radius $\epsilon$.

Any help would be appreciated.

ABC
  • 6,034
  • Numerically it seems to be $\pi \ln 2$. Now, the contour method is rather usual, you should get $\pi \mathrm{Res}_i(f)$, but you'll have a problem with residue at $i$. – Jean-Claude Arbaut Mar 25 '13 at 12:27
  • @arbautjc Yes, we can find http://math.stackexchange.com/questions/177160/integral-int-infty-infty-frac-lnx21x21dx some methods (but not complex, using contour integration). – Cortizol Mar 25 '13 at 12:53
  • Oh, my. I have found $\int_0^{\pi/2} \log{(1+\tan^2 x)}\mathrm{d}x$, but I just forgot that $1+\tan^2 x = \frac{1}{\cos^2 x}$. Thanks! – Jean-Claude Arbaut Mar 25 '13 at 13:03
  • Note that, you have two branch points. – Mhenni Benghorbal Mar 25 '13 at 14:01
  • But you integrate with a half disc covering the upper half-plane. When it works, anyway. – Jean-Claude Arbaut Mar 25 '13 at 14:11
  • this is relevant http://math.stackexchange.com/questions/189590/can-int-0-pi-2-ln-sinx-dx-be-evaluated-with-complex-integral – S L Mar 25 '13 at 15:26
  • I think the $\infty$ must be +$\infty$ .. – Xiaolang Apr 11 '13 at 14:40
  • 3
    Integrate $f(z) = \frac{\ln(z+i)}{z^{2}+1}$ around a large closed half-circle in the upper half plane. – Random Variable Apr 11 '13 at 15:12
  • See here: http://math.stackexchange.com/questions/340534/integrate-lnx21-x21?lq=1 and here:http://math.stackexchange.com/questions/189590/can-int-0-pi-2-ln-sinx-dx-be-evaluated-with-complex-integral?lq=1 – Cortizol Apr 11 '13 at 18:39

7 Answers7

30

Use $x\to \tan\theta$ and $dx=\sec^2\theta\ d\theta$. The integral becomes $$\int_0^{\pi/2} 2\ln (\sec \theta) d\theta$$

Which is $$-2\int_0^{\pi/2} \ln (\cos\theta) d\theta$$ And can be solved.

Let $$I= \displaystyle \int_0^{\pi/2} \ln \left( \sin \theta \right) \cdot d\theta$$ $$I= \displaystyle \int_0^{\pi/2} \ln \left( \cos \theta \right) \cdot d\theta$$ Adding both. $$2I=\displaystyle \int_0^{\pi/2} \ln \left( \sin \theta \times \cos \theta\right) \cdot d\theta$$ $$2I= \displaystyle \int_0^{\pi/2} \ln \left(2 \sin \theta\times \cos \theta \right) -\ln2 \cdot d\theta$$ $$2I=\int_0^{\pi/2}\ln(\sin{2\theta})-\ln2 \cdot d\theta$$ $$\int_0^{\pi/2}\ln(\sin{2\theta})\cdot d\theta=I$$ So, $$I=-\int_0^{\pi/2}\ln2\cdot d\theta$$ $$I=-\dfrac{\pi\ln2}2$$

And your integral comes out to be

$${\pi \ln2}$$

ABC
  • 6,034
  • 3
    This is tagged as complex analysis, and I believe OP wants to use contour integration. (Nice approach,though, so +1). – Aryabhata Apr 11 '13 at 14:42
  • 10
    It is not a perception. This is based on the tags (which now include contour-integration tag) and the question description. – Aryabhata Apr 11 '13 at 14:56
  • This answer is incorrect. – not all wrong Apr 11 '13 at 16:26
  • The answer has been edited but is still wrong; I'd beware of calling it a "nice approach" since it's apparently very easy to make errors! P: – not all wrong Apr 11 '13 at 17:09
  • 2
    There's a mistake but I think it is a rather minor one and the approach indeed is nice:$$\int\limits_0^{\pi/2}\log\sin 2\theta,d\theta=\frac{1}{2}\int\limits_0^\pi\log\sin u,du=\int\limits_0^{\pi/2}\log\sin u,du\implies$$in the second line from the bottom in the blue zone of the answer it must be $$I=-\int\limits_0^{\pi/2}\log 2,d\theta\ldots$$ – DonAntonio Apr 11 '13 at 18:34
  • @Sharkos: It is a nice (and rather clever) approach. It is easy to make mistakes irrespective of the approach one takes! And as DonAntonio pointed out, they are minor in this case. – Aryabhata Apr 12 '13 at 00:11
  • There was a P: at the end of my message for a reason. It's a fun way to do it, I agree. The more mechanical way I offer is more straightforward to do off the bat, though, and therefore less error-prone. – not all wrong Apr 12 '13 at 00:17
  • 1
    @DonAntonio Thanx for pointing out. – ABC Apr 12 '13 at 02:49
  • My pleasure indeed, and of course +1 (I can't understand how come I didn't upvote this before...) – DonAntonio Apr 12 '13 at 02:57
26

Maybe this is going to seem a lot more involved than it needs to be, but it is likely that complex methods are not the best way to attack an integral like this. Nonetheless, it is possible.

We consider the integral in the complex plane

$$\oint_C dz \frac{\log{(1+z^2)}}{1+z^2}$$

where $C$ is some contour to be determined. Our first instinct is to make $C$ a simple semicircle in the upper half plane. The problem is that the branch point singularity at $z=i$ is extremely problematic, as it coincides with an ostensible pole. Nonetheless, the corresponding integral over the real line is finite (and twice the originally specified integral), so there must be a way to treat this.

The way to go with branch points like this is to avoid them. We thus have to draw $C$ so as to do that, and then use Cauchy's theorem to state that the above complex integral about $C$ is zero. Such a contour $C$ is illustrated below.

imagbranch

The contour integral is then taken along six different segments. I will state without proof that the integral about the two outer arcs vanishes as the radius of those arcs $R \to \infty$. We are then left with four integrals:

$$\int_{-R}^R dx \frac{\log{(1+x^2)}}{1+x^2} + \left [\int_{C_-}+\int_{C_+}+\int_{C_{\epsilon}} \right ] dz \frac{\log{(1+z^2)}}{1+z^2} = 0$$

$C_-$ is the segment to the right of the imaginary axis, down from the arc to the branch point, $C_+$ is the segment to the left of the imaginary axis, up from the branch point to the arc, and $C_{\epsilon}$ is the circle about the branch point of radius $\epsilon$.

It is crucial that we get the arguments of the log correct along each path. I note that the segment $C_-$ is "below" the imaginary axis and I assign the phase of this segment to be $2 \pi$, while I assign the phase of the segment $C_+$ to be $0$.

For the segment $C_-$, set $z=i(1+y e^{i 2 \pi})$:

$$\int_{C_-} dz \frac{\log{(1+z^2)}}{1+z^2} = i\int_R^{\epsilon} dy \frac{\log{[-y (2+y)]}+ i 2 \pi}{-y (2+y)} $$

For the segment $C_+$, set $z=i(1+y)$:

$$\int_{C_-} dz \frac{\log{(1+z^2)}}{1+z^2} = i\int_{\epsilon}^R dy \frac{\log{[-y (2+y)]}}{-y (2+y)} $$

I note that the sum of the integrals along $C_-$ and $C_+$ is

$$-2 \pi \int_{\epsilon}^R \frac{dy}{y (2+y)} = -\pi \left [ \log{R} - \log{(2 + R)} - \log{\epsilon} + \log{(2 + \epsilon)}\right]$$

For the segment $C_{\epsilon}$, set $z=i (1+\epsilon e^{-i \phi})$. The integral along this segment is

$$\begin{align}\int_{C_{\epsilon}} dz \frac{\log{(1+z^2)}}{1+z^2} &= \epsilon \int_{-2 \pi}^0 d\phi e^{-i \phi} \frac{\log{\left [ -2 \epsilon e^{-i \phi} \right]}}{-2 \epsilon e^{-i \phi}}\end{align}$$

Here we use $\log{(-1)}=-i \pi$ and the above integral becomes

$$\begin{align}\int_{C_{\epsilon}} dz \frac{\log{(1+z^2)}}{1+z^2} &= -\frac12 (-i \pi)(2 \pi) - \frac12 \log{2} (2 \pi) - \frac12 \log{\epsilon} (2 \pi) -\frac12 (-i) \frac12 (0-4 \pi^2) \\ &= -\pi \log{2} - \pi \log{\epsilon} \end{align}$$

Adding the above integrals, we have

$$\begin{align}\int_{-R}^R dx \frac{\log{(1+x^2)}}{1+x^2} -\pi \log{R} + \pi \log{(2 + R)} + \pi \log{\epsilon} - \pi \log{(2 + \epsilon)} -\pi \log{2} - \pi \log{\epsilon} &= 0\\ \implies \int_{-R}^R dx \frac{\log{(1+x^2)}}{1+x^2} -\pi \log{R} + \pi \log{(2 + R)} - \pi \log{(2 + \epsilon)} -\pi \log{2} &=0\end{align}$$

Now we take the limit as $R \to \infty$ and $\epsilon \to 0$ and we get

$$\int_{-\infty}^{\infty} dx \frac{\log{(1+x^2)}}{1+x^2} -2 \pi \log{2} = 0$$

Therefore

$$\int_{0}^{\infty} dx \frac{\log{(1+x^2)}}{1+x^2} = \pi \log{2}$$

Ron Gordon
  • 138,521
  • @EricNaslund: many thanks. – Ron Gordon Apr 24 '13 at 14:42
  • 2
    (+1) Finally solution with contuor integration, like OP wanted (I suppose). – Cortizol Apr 27 '13 at 08:26
  • @Ron You directed me to your post, so I hope you're willing to answer some of my questions. I don't think the branch of $\log(1+z^{2})$ you used coincides with that cut. I'm pretty sure that cut is the result of using the principal branch of $\log(1+z^{2})$. And when I parametrized the contour around the branch point at $z=i$, I assumed I could replace $(i+\epsilon e^{it})^{2}$ with $-1 + 2i\epsilon e^{it}$ since we're only interested in small values of $\epsilon$. You seem to have done something similar but without stating what you did. Could you elaborate? – Random Variable Aug 27 '13 at 15:05
  • The branch of the log doesn't coincide with what cut? And I did exactly what you said, see the integral about $C_{\epsilon}$. It is certainly there - we are just making sure we are picking up the contribution from the branch point. – Ron Gordon Aug 27 '13 at 15:13
  • I assume we want the branch cuts on the imaginary axis from $i$ to $i \infty$ and from $-i$ to $-i \infty$. Along those cuts $1+z^{2}$ is negative and real. So those cuts come about by choosing the principal branch of $\log(1+z^{2})$. So the argument of $\ln(1+z^{2})$ just to the right of the cut on $[i, i \infty)$ is $\pi$, while just to the left of the cut the argument is $- \pi$. – Random Variable Aug 27 '13 at 15:27
  • That is correct, but it makes no difference. In general, once you get comfortable with this, you know to replace the log with a jump of $i 2 \pi$. – Ron Gordon Aug 27 '13 at 15:29
  • I know. But it could matter in other situations using other functions. And finally how can we be certain that we will still pick up the contribution from the branch point after making that simplification? – Random Variable Aug 27 '13 at 15:40
  • I agree that I should have gotten the phase right, and really, great catch. It matters when we are dealing with higher powers of log. For integrals linear in log, only the phase difference matters, so the mistake escaped my scrutiny. – Ron Gordon Aug 27 '13 at 15:43
  • @RonGordon How does the integral over the two outer arcs vanish? I don't think this is very straightforward. – Incognito Mar 28 '14 at 18:09
  • @user108149: depends on what you mean by straightforward. I think it is; just sub $z=R e^{i \theta}$ and note that the integral over each arc is bounded by $$\frac{\pi}{2} \frac{\log{R}}{R}$$ which certainly goes to zero. See for yourself. – Ron Gordon Mar 28 '14 at 18:25
  • @RonGordon How is it bounded by that term? If anything, I'd say that it's bounded by $\frac{\log(R^2+1)}{R^2-1}$, and I'm not really sure how to deal with that logarithm. – Incognito Mar 28 '14 at 18:28
  • I learned more about complex analysis from Ron Gordon than from my C.A. book – Emir Šemšić Nov 30 '15 at 21:28
  • This might be a silly question, but how do you know that the principal branch cut is $(i,i\infty)\cup (-i,-i\infty)$? Or did you pick it out of convenience? Could we instead, choose a branch cut on $(-i,i)$? – Dylan Dec 18 '17 at 12:03
  • @RonGordon Can you explain how you arrived at the substitutions? For example, why do we substitute $z=i(1+\epsilon e^{-i\phi})$ for the circular arc? – Frank W Oct 07 '18 at 15:10
  • @FrankW.: the substitutions are parametrizations of the contour pieces. The one you pointed out is how we parametrize a circular arc of radius $\epsilon$ centered on the point $z=i$. – Ron Gordon Oct 07 '18 at 15:18
  • @RonGordon Do you have any books or sources that go over all the different "types" of poles in complex analysis? I remember seeing something about a pole at infinity and was really confused by that. I'm sure you get this question a lot so sorry if somebody has already asked this. – Frank W Oct 08 '18 at 15:03
  • There is a book called "The Cauchy Method of Residues." It is expensive but it is pretty good at treating different types of singularities in the complex plane. – Ron Gordon Oct 08 '18 at 15:43
23

One way to solve this problem is to use parametric integrals. Let $$ I(\alpha)=\int_{0}^{\infty}\frac{\ln(\alpha x^2+1)}{x^2+1}dx. $$ Then \begin{eqnarray*} I'(\alpha)&=&\int_{0}^{\infty}\frac{x^2}{(\alpha x^2+1)(x^2+1)}dx\\ &=&\int_{0}^{\infty}\left(-\frac{1}{\alpha-1}\frac{1}{\alpha x^2+1}+\frac{1}{\alpha-1}\frac{1}{x^2+1}\right)dx\\ &=&-\frac{1}{\alpha-1}\frac{1}{\sqrt{\alpha}}\frac{\pi}{2}+\frac{1}{\alpha-1}\frac{\pi}{2}\\ &=&\frac{\pi}{2}\frac{\sqrt{\alpha}-1}{\sqrt{\alpha}(\alpha-1)}\\ &=&\frac{\pi}{2}\left(\frac{1}{\sqrt{\alpha}}-\frac{1}{\sqrt{\alpha}+1}\right). \end{eqnarray*} Thus $$ I(\alpha)=\pi\ln(\sqrt{\alpha}+1)+C. $$ But $I(0)=0$ implies $C=0$. So $I(1)=\pi\ln 2$.

xpaul
  • 44,000
  • I'd appreciate if you could address the following doubts. Thanks. (1) How do you relate your $,I(\alpha),$ with the original integral? That has logarithm in the numerator, yours doesn't ; (2) you're apparently differentiating under the integral sign, but if so how do get what you write in $,I'(\alpha),$? – DonAntonio Apr 12 '13 at 03:01
  • There should be a log applied to the numerator, then it works fine. – not all wrong Apr 12 '13 at 09:38
  • It looks like a neat approach, but something is wrong. Want to fix it? – Nathaniel Bubis Apr 12 '13 at 10:33
  • @nbubis, tell me which place is wrong so that I can fix. – xpaul Apr 12 '13 at 12:56
  • @DonAntonio, for this type of integrals which the numerators have $\ln(x+1),\ln(x^2+1)$ or $e^{x}$, the general idea is to change the numerators as $\ln(\alpha x+1),\ln(\alpha x^2+1)$ or $e^{\alpha x}$ and then to differentiate and integrate. Then the key is that if $\alpha=0$, the integrals become 0. – xpaul Apr 12 '13 at 13:02
  • Indeed there is something strange. For $\alpha = 0$, it's true that $I(0)$ is well defined, but $I'(0)$ is not. The formula you obtained by derivation was used to express $I(\alpha)$ and you used this formula (which doesn't necessarily holds for $\alpha = 0$) to make $\alpha = 0$ and determine $C$. – Integral Apr 06 '16 at 02:49
  • @Integral, why is $I'(0)$ not well defined? – xpaul Apr 06 '16 at 13:56
  • $I'(\alpha) = \frac{\pi}{2}\frac{\sqrt{\alpha}-1}{\sqrt{\alpha}(\alpha -1)}$ by your own calculations. Now just make $\alpha = 0$ and see what happens. – Integral Apr 06 '16 at 14:08
  • @Integral, I see. Thank for pointing this. We can use the limit to overcome this. – xpaul Apr 06 '16 at 15:48
  • 1
    It's a bit easier if we use $\log(\alpha +x^2)$ instead of $\log(1+\alpha x^2)$. See THIS ANSWER. ;-)) – Mark Viola Aug 23 '16 at 23:47
16

Hints As RandomVariable suggested, use $\log(x^2+1)=\log(x+i)+\log(x-i)$, choosing the branches of the logarithm carefully. It's generally best to isolate unpleasant singular things.

Then write $$\int_0^\infty=\frac{1}{2}\int_{-\infty}^{\infty}$$ and make use of the above splitting to integrate the two parts on different contours, each time avoiding enclosing the singularity of the logarithm. The part on the semicircle vanishes.


Answer The UHP pole gives $\log(i+i)/2i\times2\pi i$. The LHP pole gives $\log(-i-i)/(-2i)\times-2\pi i$. Summing and halving gives the answer $$\frac{\pi}{2}\left(\log(2i)+\log(-2i)\right)$$ so all that remains is choosing the right logarithm. This is easy enough, actually, and the answer is what you expect: $$\pi\ln 2$$

not all wrong
  • 16,178
  • 2
  • 35
  • 57
  • No, I'm sorry, but you're still wrong! It is $\pi \ln 2$ just like I said, and just like I verified by checking it in Mathematica. – not all wrong Apr 11 '13 at 17:07
  • Mathematica gives: Integrate[Log[x^2 + 1]/(1 + x^2), {x, 0, Infinity}] = [Pi] Log[2] – not all wrong Apr 11 '13 at 17:10
  • -2 Integrate[Log[Cos[t]], {t, 0, Pi/2}] = [Pi] Log[2] also holds. – not all wrong Apr 11 '13 at 17:11
  • If I may ask, what attracted the downvote, whoever did so? If this answer is wrong somehow I and the OP would probably like to know! If you just prefer the other answer, upvote that, don't downvote me... – not all wrong Apr 16 '13 at 16:37
  • BTW I did not give you the downvote. – Ron Gordon Apr 24 '13 at 12:58
  • @RonGordon (a) To capture the LHP pole, you encircle it with a contour in a positive orientation, and hence you accumulate $\frac{1}{2}\times\boxed{-}2\pi i$ times this contribution. (b) Each $\log$ should be of variables whose arguments range in $(-\pi,\pi)$ on the real line. This is because the imaginary parts of the $\log$ must cancel from $x=+\infty$ down to $x=-\infty$. – not all wrong Apr 24 '13 at 13:54
  • (a) I do not understand - why $-i 2 \pi$ if the contour is of a positive orientation? (b) The imaginary parts of the log must cancel... - I do not have any idea of what this means. (I am not trying to make trouble - it's just that I had already tried this way without success before I used the contour in my answer below.) – Ron Gordon Apr 24 '13 at 14:00
  • (a) Apologies, meant "negative". This is a standard fact. Try computing $\oint_C \mathrm dz/z$ directly for $C$ clockwise and anticlockwise. (b) You need $\log(x+i) + \log(x-i) = \log(1+x^2)$ to hold. Evaluate at zero. With your choice of the logarithm's branch, you find $\log(i) + \log(-i) = i\pi/2+3i\pi/2 = 2i\pi \neq 0 = \log(1+0^2)$, so you chose a discontinuous logarithm. [You also missed out an $i$ in your expression for the imaginary part of the logarithm.] – not all wrong Apr 24 '13 at 14:19
  • OK, I am with you. Sorry for grilling you. – Ron Gordon Apr 24 '13 at 14:26
11

We can also use contour integration to show that

$$I(a,b,\theta) = \int_{-\infty}^{\infty} \frac{\log \left(a^{2}+2ax \cos \theta + x^{2}\right)}{x^{2}+b^{2}} \, dx = \frac{\pi}{b} \, \log \left(a^{2}+2ab \sin \theta +b^{2} \right), $$ where $a, b >0$ and $0 < \theta < \pi$.

Your integral is $\frac{1}{2} \, I\left(1,1,\frac{\pi}{2} \right)$.


Consider the complex function $$f(z) = \frac{\log \left(z+ae^{i \theta}\right)}{z^{2}+b^{2}},$$

which has a branch point in the lower half-plane at $z=-ae^{i \theta}$.

If we use the principal branch of the logarithm, then $f(z)$ is meromorphic in the upper half-plane.

So by integrating around a closed semicircular contour in the upper half-plane (and using the fact that $ \lim_{|z| \to \infty} z f(z) =0$ ), we get

$$ \int_{-\infty}^{\infty} \frac{\log \left(x+ae^{i \theta} \right)}{x^{2}+b^{2}} \, dx = 2 \pi i \ \text{Res}[f(z),ib] = \frac{\pi}{b} \, \log \left( ib +ae^{i \theta} \right).$$

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

$$ \int_{-\infty}^{\infty} \frac{\log(a^{2}+2ax \cos \theta +x^2)}{x^{2}+b^{2}} \, dx = \frac{\pi}{b} \, \log \left(a^{2}+2ab \sin \theta +b^{2} \right).$$

2

Here is a way by using contour integration and easy to understand:

Convention:

The branch of the logarithm is principal branch cut.

The argument is using under principal value.

$$\int_{0}^{\infty} \frac{\log(1+x^2)}{1+x^2}~dx = \\ \int_{0}^{\infty} \frac{\log(x^2+1)}{1+x^2}~dx = \\ \int_{0}^{\infty} \frac{\log((x+i)(x-i))}{1+x^2}~dx = \\\int_{0}^{\infty} \frac{\log(|x+i|) + Arg(x+i) + log(|x-i|)+ Arg(x-i) }{1+x^2}~dx = \\ \int_{0}^{\infty} \frac{\log(|x+i|) + log(|x-i|)+ Arg(2x) }{1+x^2}~dx = \\$$$$\int_{0}^{\infty} \frac{\log(|x+i|) + log(|x-i|)}{1+x^2}~dx \tag{1} $$

Doing contour integration with respect to function: $f(x) = log(x+i)/(x^2+1)$

Define contour:

$\Gamma_1:= x \text{ from } 0 \text{ to } \infty$

$\Gamma_2:= x \text{ from } \infty \text{ to } -\infty \text{ along the upper semicircle}$

$\Gamma_3:= x \text{ from } -\infty \text{ to } 0$

Easy to see: $\int_{\Gamma_2} |f(x)| \leq 2 \pi \max_{\Gamma_2} {\frac{|\log(x+i)|}{|1+x^2|}} \leq \frac{log(\sqrt{x^2+1})}{x^2+1}+\frac{\pi^2}{x^2+1} = 0$

So $\int_{\Gamma_2} f(x) = 0$

The residue for $f(x)$ at $x = i$ is $\frac{\log(2)+ \frac{\pi}{2}}{2i}$

By residue theorem: $\int_{\Gamma_1} f(x) + \int_{\Gamma_3} f(x) = 2\pi Res(f,i) = \pi \log(2) + \frac{\pi^2 i}{2} $

$$\int_0^\infty \frac{log(x+i)}{(x^2+1)} + \int_{-\infty}^0 \frac{log(x+i)}{(x^2+1)} = \pi \log(2) + \frac{\pi^2 i}{2} \implies\\\int_0^\infty \frac{log|x+i|}{(x^2+1)} + \int_{-\infty}^0 \frac{log(|x+i|)+ \pi i}{(x^2+1)} = \pi \log(2) + \frac{\pi^2 i}{2} \implies\\\int_0^\infty \frac{log|x+i|}{(x^2+1)} + \int_{-\infty}^0 \frac{log(|x+i|)}{(x^2+1)}+ \int_{-\infty}^0 \frac{ \pi i}{(x^2+1)} = \pi \log(2) + \frac{\pi^2 i}{2} \\$$

Recall: $\int \frac{1}{x^2+1} = arctan(x)+c$

$$ \implies \int_0^\infty \frac{log|x+i|}{(x^2+1)} + \int_{0}^{\infty} \frac{log(|x-i|)}{(x^2+1)}+ \frac{i\pi^2}{2} = \pi \log(2) + \frac{i\pi^2}{2}\\\\\implies \int_0^\infty \frac{log|x+i| + log|x-i|}{(x^2+1)} = \pi \log(2) $$

Substitute into $(1)$,$\int_{0}^{\infty} \frac{\log(|x+i|) + log(|x-i|)}{1+x^2}~dx = \pi \log(2)$

Zau
  • 3,909
  • 12
  • 29
0

$\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,} \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack} \newcommand{\dd}{\mathrm{d}} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,} \newcommand{\ic}{\mathrm{i}} \newcommand{\mc}[1]{\mathcal{#1}} \newcommand{\mrm}[1]{\mathrm{#1}} \newcommand{\pars}[1]{\left(\,{#1}\,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,} \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}} \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$ \begin{align} &\bbox[5px,#ffd]{\int_{0}^{\infty}{\ln\pars{x^{2} + 1} \over x^{2} + 1}\,\dd x} = {1 \over 2}\int_{-\infty}^{\infty}{\ln\pars{x^{2} + 1} \over x^{2} + 1} \,\dd x \\[5mm] = &\ \Re\int_{-\infty}^{\infty}{\ln\pars{1 + \ic x} \over x^{2} + 1}\,\dd x \\[5mm] \stackrel{{\Large 1\ +\ \ic x\ =\ s} \atop {\Large x\ =\ \ic\pars{1 - s}}}{=}\,\,\,& \Re\int_{1 - \infty\ic}^{1 + \infty\ic}{\ln\pars{s} \over -\pars{1 - s}^{2} + 1}\,\pars{-\ic}\dd s \\[5mm] & =\, -\,\Im\int_{1 - \infty\ic}^{1 + \infty\ic}{\ln\pars{s} \over s\pars{s - 2}}\,\dd s \\[5mm] = &\ -\,\Im\bracks{\color{red}{-}2\pi\ic\,{\ln\pars{2} \over 2}} \label{1}\tag{1} \\[5mm]= &\ \bbx{\pi\ln\pars{2}} \approx 2.1776 \\ & \end{align} In (\ref{1}), I "closed" the integration path with a infinite radius semicircle on the "right" ( note the $\ds{\color{red}{-}\mbox{sign}}$ because the contour integration is clockwise ). The magnitude of the contribution along the arc $\ds{< \pi\root{\ln^{2}\pars{R} + \pi^{2}}/R}$ as $\ds{R \to \infty}$ where $\ds{R}$ is the semicircle radius. $\ds{\ln}$ is the logarithm principal branch.

Felix Marin
  • 89,464