# Complex integration Question - Contour Method [duplicate]

$$\int_{-\infty}^\infty \frac{\ln(x^2+1)}{1+x^2} dx$$

Attempt

Considering $$\oint \frac{\ln(z^2+1)}{(z+i)(z-i)} dz$$

So first I find the branch points of the function.

This function has a simple pole at $z=i$ and an essential singularity at $z=-i$.

Using this contour:

By residue theorem,

$$\int_\gamma + \int_AB + \int_BC = 2\pi i \times \text{Residue}$$

$$\text{Residue} = \frac{\ln(2i)}{2i} = \frac{\pi}{4} - \frac{i}{2}\ln(2)$$

Taking the semi-circle to infinity, $\int_\gamma \rightarrow 0$ by Jordan's Lemma.

$$\int_{-\infty}^0 \frac{\ln(-|x| + i)}{1+x^2} dx + \int_0^{\infty} \frac{\ln(x+i)}{1+x^2} dx = 2\pi i \left[ \frac{\pi}{4} - \frac{i}{2}\ln(2) \right]$$

$$\int_{-\infty}^0 \frac{\ln (i - |x|) + i\pi}{1+x^2} dx + \int_0^{\infty} \frac{\ln(x+i)}{1+x^2} dx = 2\pi i \left[ \frac{\pi}{4} - \frac{i}{2}\ln(2) \right]$$

$$\int_{\infty}^0 \frac{\ln (i - x) + i\pi}{1+x^2} dx + \int_0^{\infty} \frac{\ln(x+i)}{1+x^2} dx = 2\pi i \left[ \frac{\pi}{4} - \frac{i}{2}\ln(2) \right]$$

I have a hunch that the first integral must become $+\int_0^{\infty}$ for it to combine with the second integral to give $\int_0^\infty \frac{\ln(1+x^2)}{1+x^2}\,dx$ then we take the real part on the right. But I can't seem to show this..

## marked as duplicate by Jack D'Aurizio, mrf, Davide Giraudo, user61527, Rick DeckerJun 10 '14 at 23:49

• Your function has an essential singularity at $i$ and $-i$. – user98602 Jun 10 '14 at 20:01
• Please learn to type \ln. This not only prevents italicization of $\ln$, but also automatically provides proper spacing in expressions like $a\log b$. (I edited the question accordingly.) ${}\qquad{}$ – Michael Hardy Jun 10 '14 at 20:14
• Thanks for the link provided, but I don't really understand the final solution presented (the one using contour integration). Is there a problem with the contour I have chosen? Why can't it simply be a semi-circle? $\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)}$, why is there an additional factor of $2\pi i$? How did the user get this result: $-2 \pi \int_{\epsilon}^R \frac{dy}{y (2+y)} = -\pi \left [ \log{R} - \log{(2 + R)} - \log{\epsilon} + \log{(2 + \epsilon)}\right]$? – user44840 Jun 10 '14 at 21:50
$$\begin{eqnarray*}I=\int_{-\infty}^{+\infty}\frac{\log(1+x^2)}{1+x^2}\,dx &=& 2\int_{0}^{+\infty}\frac{\log(\cosh u)}{\cosh u}du=2\int_{1}^{+\infty}\frac{\log y}{y\sqrt{y^2-1}}dx\\&=&-2\int_{0}^{1}\frac{\log z}{\sqrt{1-z^2}}dz = -2\int_{0}^{\pi/2}\log\sin\theta\,d\theta\end{eqnarray*}$$ is a well-known integral, also treated here: Evaluating $\int_0^{\infty}\frac{\ln(x^2+1)}{x^2+1}dx$.
• That is interesting, but I'm supposed to use contour integral methods. I feel like I'm really close to the answer. If i simply "cheat" by saying the first integral (real part) is equal to the second, I get the answer of $2\pi ln 2$. So now I think the most crucial thing is how to show the first integral (real part) is equal to the second. – user44840 Jun 10 '14 at 21:32