Using residue theorem to calculate $\int_0^\infty \frac{dx}{x^\frac12 (1+x^2)}$ get a different value from the value obtained by classical method

complex-analysiscontour-integrationresidue-calculus

I'm trying to calculate the next integral by using residue theorem:
$$
\int_0^\infty \frac{dx}{x^\frac12 (1+x^2)}.
$$

Let $f(z)=1/(z^\frac12(1+z^2))$ and $\varepsilon,R$ be any real number such that $0 < \varepsilon < 1 < R$. Choose the contour
\begin{align}
C_1&:z(t)=Re^{it}\quad(\theta \le t \le 2\pi-\theta)\\
C_2&:z(t)=t-i\varepsilon\quad(0\le t\le R\cos\theta) \\
C_3&:z(t)=\varepsilon e^{it}\quad(\frac\pi2\le t\le \frac{3\pi}2) \\
C_4&:z(t)=t+i\varepsilon\quad(0\le t\le R\cos\theta)
\end{align}

where $\theta= \arcsin\frac{\varepsilon}{R}$. By residue theorem
$$
\oint_{C_1-C_2-C_3+C_4}f(z)dz = 2\pi i\left( \operatorname{Res}(f,i) + \operatorname{Res}(f,-i)\right).
$$

Here
\begin{align}
\operatorname{Res}(f,i) &= \lim_{z\to i}\frac{z-i}{z^\frac12 (1+z^2)} = \lim_{z\to i}\frac1{z^\frac12(z+i)} = \frac{1}{2i\cdot i^\frac12} = \frac{-1-i}{2\sqrt 2}, \\
\operatorname{Res}(f,-i)&= \lim_{z\to -i}\frac{z+i}{z^\frac12 (1+z^2)} = \lim_{z\to i}\frac1{z^\frac12(z-i)} = \frac1{-2i\cdot(-i)^\frac12} = \frac{-1+i}{2\sqrt2}.
\end{align}

Thus
$$
\oint_{C_1-C_2-C_3+C_4}f(z)dz = -\frac{2\pi i}{\sqrt2}.
$$

It is easy to check $\int_{C_1}f(z)dz,\int_{C_3}f(z)dz\to 0\ (\varepsilon\to0,R\to\infty)$. And since $\exp(-\frac12(\ln|z|+i(\arg z+2\pi))) = -1/\sqrt z$ it obtains
$$
\lim_{\substack{\varepsilon\to0\\R\to\infty}}\int_{C_4}f(z)dz = -\lim_{\substack{\varepsilon\to0\\R\to\infty}}\int_{C_2}f(z)dz = \int_0^\infty \frac{dx}{x^\frac12 (1+x^2)}.
$$

Therefore
$$
\int_0^\infty \frac{dx}{x^\frac12 (1+x^2)} = -\frac{\pi i}{\sqrt2}.
$$

It is very curious that the integration of a real positive-valued function become a imaginary number. In fact, by using classical method, the integration will be $\pi/\sqrt2$, which seems to be the true answer.

Where is the mistake?

Best Answer

The choice of the contour and the analysis are all perfect, but you made a slippery mistake, because with the contour comes the deffinition of the principal argument:

$$0\leq \arg(z)<2\pi$$

And the residue of $-i$ isn't calculated propperly in your work.

Notice that with this deffinition:

$$\arg(-i)=\frac{3 \pi}{2}$$

then: $$\sqrt{-i} = e^{\frac{1}{2} (ln|-i|+i \arg{(-i)})} = e^{i \frac{3\pi}{4}} = \frac{\sqrt{2}}{2} (-1+i)$$

Then, if you do the rest of the calculation,

$$\text{Res}(f,-i) = \frac{1}{2\sqrt{2}}(1-i)$$

Then if you apply the Residue Theorem:

$$2\pi i \left[\text{Res}(f,i)+ \text{Res}(f,-i) \right]=2\pi i \left[-\frac{1}{2\sqrt{2}}(1+i)+\frac{1}{2\sqrt{2}}(1-i)\right] = 2\pi i \left[-\frac{1}{\sqrt{2}}i\right] = \frac{2 \pi}{\sqrt{2}}$$

Therefore, your real-valued integral is real and matches the answer you were given to check.

Related Question