This question already has an answer here:

I am having trouble in evaluating $\int_{0}^\infty \left(\frac{log(x^2+1)}{x^2+1}\right)dx$
I proceeded by taking $\int_{C}\left(\frac{log(z+i)}{z^2+1}\right)dz$
I don't know how to draw contour here and my attempt lies in that.I could show that $\lim_{R\to\infty}\int_{C_R}\left(\frac{log(z+i)}{z^2+1}\right)dz=0$,but I couldn't show that $\lim_{r\to 0}\int_{\tau_R}\left(\frac{log(z+i)}{z^2+1}\right)dz=0$.Please help me through this problem.
I'll appreciate any help towards this.
PS:$C=[R,r]\cup \{-\tau_{r}\} \cup [r,R] \cup C_{R}$,[considering counterclockwise sense ]the branch cut that I used was $[-\pi/2,3\pi/2]$


marked as duplicate by PhoemueX, Tom-Tom, N. F. Taussig, user91500, Najib Idrissi Sep 22 '15 at 9:36

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 7
    $\begingroup$ Having supervised a number of students doing this integral over the years, I've come to the conclusion that complex analysis is very likely the worst way of doing it (interpret the mindset of writers of exercises how you will). This question has plenty of approaches, including a complex analysis one. $\endgroup$ – Chappers Sep 21 '15 at 23:07
  • $\begingroup$ @Chappers,thank you very much! But will you please give me some information regarding how should one chose a branch cut? $\endgroup$ – Suraj_Singh Sep 21 '15 at 23:22
  • $\begingroup$ First you need to choose a branch of the logarithm. The one such that $\log{i}=i\pi/2$ should do. Take a branch cut that does not cross the real axis, so one downwards along the imaginary axis from $-i$ will do. $\endgroup$ – Chappers Sep 21 '15 at 23:42
  • 1
    $\begingroup$ As an aside, letting $x=\tan t$ and $t=\dfrac\pi2-u$ along with $\sin2a=2\sin a\cos a$ pretty much settles the question. $\endgroup$ – Lucian Sep 22 '15 at 5:12
  • 1
    $\begingroup$ @kilimanjaro: Yes, I know, I understood that. But, just in case someone stumbling upon this page might be interested to know if there aren't any easier ways to evaluate it, I left that approach as a comment. $\endgroup$ – Lucian Sep 22 '15 at 6:27

Let's work with what you've got. $\log{(z+i)}$ has a singularity at $z=-i$, and we can see that this is a branch point since the function looks like $\log{\varepsilon}$ there. The initial chunk of the contour we have passes along the real axis, so it is sensible to choose a branch cut for $\log{(z+i)}$ which does not intersect this. We may as well choose the part of the imaginary axis below $-i$: $\{ iy: y \leqslant -1 \}$, but any unbounded simple curve not crossing the real axis will do.

Now, there is the question of specifying the branch, which is equivalent to choosing the value of $\log{i}$: the value of $\log{(z+i)}$ at $z=0$. Since $e^{i\pi(2n+1/2)} = i $, this could be any of the values $\left(2n+\frac{1}{2}\right)\pi i$. Choose a specific $n$ and stick with it.

Okay, we've sorted our function. Now let's sort out a contour. It should be clear that whatever the branch, $$ \frac{\log{(z+i)}}{z^2+1} = o(\lvert z\rvert^{-3/2}), $$ say, as $\lvert z \rvert \to \infty$, for any sequence of $z$ not going near the branch cut (probably don't need this restriction, but never mind). Therefore, we can sensibly close the contour in the upper half-plane, by considering $\gamma=\gamma_1+\gamma_2$, where $\gamma_1=[-R,R]$, and $\gamma_2=\{ Re^{it}: 0<t<\pi \}$, a semicircle in the upper half-plane centred at $0$.

Right, everything's set; now the residue theorem, $$ \int_{\gamma} \frac{\log{(z+i)}}{z^2+1} \, dz = 2\pi i \sum_{a \text{ inside }\gamma} \operatorname{Res}_{z=a}\frac{\log{(z+i)}}{z^2+1} $$ As far as the left-hand side goes, $\int_{\gamma}=\int_{\gamma_1}+\int_{\gamma_2}$. We have $\int_{\gamma_1} \to I$, where $$ I = \int_{-\infty}^{\infty} \frac{\log{(x+i)}}{x^2+1} \, dx, $$ where $x$ is used because the integral variable is real. We'll sort that out at the end. $\int_{\gamma_2} \to 0$ as $R \to \infty$ since the integrand is bounded above by a multiple of $R^{-3/2}$, and the length of the contour by $\pi R$, so the integral tends to zero by the fundamental supremum bound.

For the right-hand side, there is only one singularity inside $\gamma$: a pole at $z=i$. This has residue $$ \lim_{z \to i} (z-i) \frac{\log{(z+i)}}{(z+i)(z-i)} = \frac{\log{2i}}{2i}, $$ and hence we have $$ \int_{-\infty}^{\infty} \frac{\log{(x+i)}}{x^2+1} \, dx = \pi\log{2i} $$ Okay, now we need to relate this to the actual integral we are dealing with. On the left, $$ \log{(x+i)} = \log{\sqrt{(x+i)(x-i)}} + i\theta = \frac{1}{2}\log{(1+x^2)} +i\theta, $$ where $\theta$ is the angle of $x+i$ to the positive real axis ($\arctan{x}$?), plus $2n\pi i$ so as to be on the correct branch of the logarithm. Thus $$ \frac{1}{2}\int_{-\infty}^{\infty} \frac{\ln{(1+x^2)}+i\theta}{x^2+1} \, dx = \pi\log{2i} = \pi\ln{2}+\pi[(2n+1/2)\pi] i, $$ where I write $\ln$ (under protest) to mean the logarithm that is real-valued on the positive real axis, as in $\log{z} = \ln{\lvert z \rvert}+i\theta$.

Equating real parts gives the result you want, $$ \frac{1}{2}\int_{-\infty}^{\infty} \frac{\ln{(1+x^2)}+i\theta}{x^2+1} \, dx =\pi\ln{2}. $$

What about the imaginary parts? Well, $\theta = (2n+1/2)\pi + f(x)$, where $f$ is odd (think about how the angle works), so the integral of $f$ divided by the even $1+x^2$ is zero. For the rest, we find $$ (2n+1/2)\pi \int_{-\infty}^{\infty} \frac{dx}{1+x^2} = (2n+1/2)\pi \times \pi \\ \int_{-\infty}^{\infty} \frac{dx}{1+x^2} = \pi, $$ which

  1. We knew already, and
  2. Shows that it didn't matter what branch/value of $n$ we chose.

Not the answer you're looking for? Browse other questions tagged or ask your own question.