2

I tried solving following integral using contour technique. $$\int_{-\infty}^{\infty} \frac{\ln^2x^2}{x^2+1}\,dx$$ $$f(z)=\frac{\ln^2z^2}{z^2+1}$$

I made semicircular contour with a hole at origin .Integral along Both semicircular paths evaluates to 0 leaving Integral along the real axis which is the target Integral. There is only 1 pole int this contour at $z=i$.

Applying Residue theorem I get: \begin{align*} I&=2\pi i\,(z-i)\frac{\ln^2z^2}{z^2+1}\\ &=2\pi i\,\frac{\ln^2(i^2)}{2i}\\ &=\pi \ln^2(-1)\\ &=\pi(i\pi)^2\\ &=-\pi^3 \end{align*}

but Wolfram alpha gives +$\pi^3$ as the answer. Where did i mess?

1 Answers1

8

Welcome to the site.

This is a bit subtle. You always have to be careful when integrating logarithms, square roots and so on; they are not analytic everywhere. You always have to make a cut.

For $z$ in the upper half plane, $z^2$ can attain any value in the whole complex plane. The log cannot be analytic there. So, what's the fix? The boundary of your integration is $[0,\infty)$ and $(-\infty,0]$; these both map to $[0,\infty)$ under the squaring operation. So we should make a branch cut along this line. Specifically, define $\log:\Bbb C\setminus[0,\infty)\to\Bbb C$ via the restriction $0\le\arg z<2\pi$. Then $\log(x)=\ln x$ for $x>0$ a real number. $\log(x^2)=\ln x^2$ holds even for negative $x$... but $z\mapsto\log z^2$ is not a continuous function on $\mathcal{H}^\ast:=\{z\in\Bbb C\,|\,\Im z\ge 0,\,z\neq 0\}$ (which is your domain of integration). Because as $z\to x<0$ from above, $\arg z^2\to 2\pi\neq\arg(x^2):=0$. So we need to make another fix (since the residue theorem requires a continuous function on the boundary, holomorphic on the interior). We need to integrate $f(z)/(1+z^2)$ where $f(z):=\begin{cases}\log z^2&z\notin(-\infty,0)\\2\pi i+\ln z^2&z\in(-\infty,0)\end{cases}$, $f:\mathcal{H}^\ast\to\Bbb C$.

Now $f$ is genuinely continuous on the boundary of your domain of integration and is analytic on the interior. But there's a big problem: $f(x)^2\neq\ln x^2$ for negative $x$. So your calculations reveal: $$\int_{-\infty}^\infty\frac{f(x)^2}{1+x^2}\,dx=-\pi^3$$But: $$\int_{-\infty}^0\frac{f(x)^2}{1+x^2}\,d x=\int_{-\infty}^0\frac{(\ln(x^2)+2\pi i)^2}{1+x^2}\,dx=\int_{-\infty}^0\frac{\ln^2(x^2)-4\pi^2+4\pi i\ln(x)}{1+x^2}\,dx\\=-4\pi^2\cdot\frac{\pi}{2}+0+\int_{-\infty}^0\frac{\ln^2x^2}{1+x^2}\, dx$$Therefore: $$-\pi^3=-2\pi^3+\int_{-\infty}^0\frac{\ln^2x^2}{1+x^2}\, dx+\int_0^\infty\frac{\ln^2x^2}{1+x^2}\,dx=-2\pi^3+\int_{-\infty}^\infty\frac{\ln x^2}{1+x^2}\,dx$$Concluding: $$\pi^3=\int_{-\infty}^\infty\frac{\ln^2x^2}{1+x^2}\,dx$$

So.. the rigorous stuff really does matter. In fact, sometimes you can even exploit these branch-jumping properties of the logarithm to figure out an integral - it's sometimes helpful, rather than an annoying technical detail.

Exercise: use a branch-jumping technique to calculate the same integral after accounting for evenness of the integrand and then substituting $t=x^2$, in: $$\pi^3\overset{?}{=}\int_0^\infty\frac{\ln(t)^2}{(1+t)\sqrt{t}}\,dt$$You'll want $\ln$ and $\sqrt{}$ to both be cut along $[0,\infty)$.

FShrike
  • 46,840
  • 3
  • 35
  • 94
  • 1
    Thanks for the help. I will try this exercise to learn branch jumping technique – baba baba Jul 30 '24 at 15:24
  • @babababa You're welcome. I have shown this technique a few times on this site, here is a list of worked-through examples. Or more broadly here if you want :) – FShrike Jul 30 '24 at 15:36