Cauchy’s theorem and mathematica disagree? Integral involving branch points.

complex integrationcomplex-analysisintegrationmathematica

Consider the following integral:

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

where $\epsilon$ is an infinitesimal positive number. In the complex $x$-plane, the integrand has two poles and two branch points. The poles are at $x=\pm i$ and the branch points are at $x=\pm 1 – i\epsilon$. You can see that for $\epsilon>0$ the branch points are shifted away from the contour. The square-root function is taken to be the standard principal square-root function: the branch cut for $\sqrt{x}$ runs along $(-\infty,0]$, and $$\sqrt{e^{i\left(\frac{\pi}{2}\pm\delta \right)}}=\pm i$$

This integral may be illustrated as follows:

enter image description here

The green line represents the branch cut, across which the phase of the integrand is discontinuous. Because the integration contour (red line) does not pass through it, we should be able to solve this integral by closing the contour in the upper-half plane, picking up only the reside at $x=i$.

$$\begin{align}
\int_{-\infty}^{\infty} \frac{dx}{\sqrt{x^2-2i\epsilon x -1}(x^2+1)}&=2\pi i \,\textrm{Res}\left(I(x);x=i\right)\\
&=2\pi i\frac{1}{i\sqrt{2} (2i)}\\
&=-\frac{i\pi}{\sqrt{2}}\\
&\approx -i\,2.22144
\end{align}$$

However when I integrate via Mathematica, I get a totally different answer.

NIntegrate[1./(Sqrt[x^2 - 2.*I*0.0001*x - 1]*(x^2 + 1)), {x, -\[Infinity],\[Infinity]}, MaxRecursion -> 20, Method -> "LocalAdaptive"]

> 1.24641 - 8.75132*10^-7 I

So the answer Mathematica gives is approximately $1.246$, which completely doesn't agree with the answer previously derived via the residue theorem. What's going on here? Which answer is wrong? Or are both answers wrong?

Best Answer

I solved my issue. The contour integration answer is correct. The implementation of the integral in Mathematica is incorrect. I wasn't sure if the error lied in my contour integration, so that's why I posted it here on MSE. Therefore this post isn't quite suitable for this sub, but I'll give the resolution here anyways.

Mathematica implements the branch cut for $\sqrt{w}$ along $-\infty < w \leq 0$. If we simply use $w=x^2-1$, then in the $x$-plane the branch cuts are given by two right-angle cuts:

enter image description here

Therefore Mathematica was integrating in the $x$-plane with the branch cuts given in the right-hand picture. Clearly the contour was running straight through a branch cut!

To correctly implement the desired branch cut structure into Mathematica, we may simply give each monomial term in the square-root.

$$\int_{-\infty}^{\infty}dx\,\frac{1}{\sqrt{x-(1-i\epsilon)}\sqrt{x-(-1-i\epsilon)}(x^2+1)}$$

With this, Mathematica gets the desired answer:

Related Question