I am trying to compute

$$\int_0^\infty \frac{\ln^2 x}{1+x^2} dx $$

using a complex contour integration of $f(z) = \ln^2 z / (1+z^2)$ around a closed contour with the segments:

$$C_1 : [-R,-\rho]\\C_2: \{z: |z| = \rho, 0 \leq \arg z \leq \pi\}\\ C_3: [\rho , R] \\ C_4: \{z: |z| = R, 0 \leq \arg z \leq \pi\}.$$

This contour encloses one singular point $z = i$ where I found $Res(f,i) = i\pi^2/8.$

My difficulty is in handling the $\int_{C_1}f(z) dz$ integral on the real interval $[-R,-\rho]$ which does not vanish as $R \to \infty$ and $\rho \to 0$.

Thank you.

  • $\begingroup$ Related: math.stackexchange.com/questions/1976510 $\endgroup$ – Watson Jan 27 '17 at 21:14
  • $\begingroup$ I'm interested in this specific contour in particular how to make it work with the integral over the segment on the negative real axis. I know there are other ways to get the value. $\endgroup$ – scobaco Jan 27 '17 at 21:19

By the residue theorem

$$\oint_{C_1 \cup C_2 \cup C_3 \cup C_4}f(z) \, dz = 2\pi i Res(f,i) = 2\pi i (i \pi^2/8) = -\frac{\pi^3}{4}.$$

It is straightforward to show that the integrals over $C_2$ and $C_4$ vanish in the limit as $R \to \infty$ and $\rho \to 0$.


$$\tag{1} -\frac{\pi^3}{4} = \int_0^\infty \frac{\ln^2 x}{1 + x^2} \, dx + \lim_{R \to \infty, \rho \to 0} \int_{C_1} \frac{\ln^2 z}{1 + z^2} \, dz.$$

Now we can focus on the second integral on the RHS -- the source of your difficulty.

Note that

$$\begin{align}\lim_{R \to \infty, \rho \to 0} \int_{C_1} \frac{\ln^2 z}{1 + z^2} \, dz &= \int_{-\infty}^0 \frac{ \ln^2 x}{1 + x^2} \, dx \\ &= \int_{0}^\infty \frac{ \ln^2 (-x)}{1 + x^2} \, dx \\ &= \int_{0}^\infty \frac{ (\ln x + i \pi)^2}{1 + x^2} \, dx \\ &= \int_{0}^\infty \frac{ \ln^2 x }{1 + x^2} \, dx + 2\pi i\int_{0}^\infty \frac{ \ln x }{1 + x^2} \, dx - \pi^2\int_{0}^\infty \frac{ 1 }{1 + x^2} \, dx \\ &= \int_{0}^\infty \frac{ \ln^2 x }{1 + x^2} \, dx + 0 - \pi^2 \frac{\pi}{2} \\ &= \int_{0}^\infty \frac{ \ln^2 x }{1 + x^2} \, dx - \frac{\pi^3}{2}\end{align}.$$

The second of the three integrals on the RHS can be shown to be $0$ by showing that integrals over $[0,1]$ and $[1,\infty)$ must cancel (using a change of variables $u = 1/x)$.

Substituting into (1) we obtain

$$-\frac{\pi^3}{4} = 2\int_0^\infty \frac{\ln^2 x}{1 + x^2} \, dx - \frac{\pi^3}{2}.$$


$$\int_0^\infty \frac{\ln^2 x}{1 + x^2} \, dx = \frac{\pi^3}{8}.$$

  • $\begingroup$ Ah, whoops, I set that up incorrectly. Still learning :-) $\endgroup$ – Simply Beautiful Art Jan 28 '17 at 4:30

One notes that $I_1$ is the original integral from $-R$ to $-\rho$ with an integrand shifted by $\pi i$, or $-1$.

$$\lim_{R\to\infty}\lim_{\rho\to0}I_1=\int_{-\infty}^0\frac{\ln^2(x)}{1+x^2}\ dx$$

with the simple substitution of $x=-u$, we get...

  • $\begingroup$ This is not correct. The value of the integral over $[0,\infty)$ should be $\pi^3/8$. Since $2\pi i Res(f,i) = -\pi^3/4$, if the integral over $C_1$ is equal to that over $C_3$ you will get the wrong answer. Also Wolfram Alpha shows the two intergrals are not equal. SInce $\ln(-x) = \ln|x| + i \pi$, I can't see how they are equal. $\endgroup$ – scobaco Jan 27 '17 at 22:28
  • $\begingroup$ @scobaco Hm, I did $u=-x$, rather than actually evaluating. I'll check this. $\endgroup$ – Simply Beautiful Art Jan 27 '17 at 22:31
  • $\begingroup$ @scobaco You need to check that. WolframAlpha says the two are equal to $\pi^3/8$. wolframalpha.com/input/… $\endgroup$ – Simply Beautiful Art Jan 27 '17 at 22:34
  • $\begingroup$ @scobaco sorry for the previous comment for being somewhat wrong. My thoughts on this are for you to check how $I_2$ plays in, because I think it does and that my answer is perfectly right. $\endgroup$ – Simply Beautiful Art Jan 28 '17 at 3:01
  • $\begingroup$ @SimplyBeautifulArt: I think you set up the integral in WolframAlpha incorrectly. Answer below confirms that the contributions from $C_1$ and $C_3$ are different. But your general suggestion was indeed correct. $\endgroup$ – RRL Jan 28 '17 at 3:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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