Evaluating the integral $ \int_{-\infty}^{\infty} \frac{\cos \left(x-\frac{1}{x} \right)}{1+x^{2}} \ dx$

I'm curious about the proper way to evaluate $$ \int_{-\infty}^{\infty} \frac{\cos \left(x-\frac{1}{x} \right)}{1+x^{2}} \, dx = \text{Re} \int_{-\infty}^{\infty} \frac{e^{i(x- \frac{1}{x})}}{1+x^{2}} \, dx$$ using contour integration.

If I let $f(z) = \frac{e^{i(z- \frac{1}{z})}}{1+z^{2}}$, there is an essential singularity at the origin.

So if I integrate around a closed semicircle in the upper half-plane, the contour goes right through the singularity.

Can you indent a contour around an essential singularity?


Solution 1:

Using the symmetry: $$ \int_{\mathbb{R}} \frac{\cos\left(x-\frac{1}{x}\right)}{1+x^2} \mathrm{d}x = 2 \int_0^\infty \frac{\cos\left(x-\frac{1}{x}\right)}{1+x^2} \mathrm{d}x $$ Now, making the change of variables $u = x-\frac{1}{x}$ there are two solutions: $$ x = x_{\pm}(u) = \frac{u}{2} \pm \sqrt{1 + \frac{u^2}{4}} $$ Changing variables: $$ 2 \int_0^\infty \frac{\cos\left(x-\frac{1}{x}\right)}{1+x^2} \mathrm{d}x = \int_{-\infty}^\infty \frac{2 \cos(u)}{1+x_+(u)^2} \frac{x_+^\prime(u)}{2} \mathrm{d}u + \int_{-\infty}^\infty \frac{2 \cos(u)}{1+x_-(u)^2} \frac{x_-^\prime(u)}{2} \mathrm{d}u $$ Combining these, with some simple algebra: $$\begin{eqnarray} 2 \int_0^\infty \frac{\cos\left(x-\frac{1}{x}\right)}{1+x^2} \mathrm{d}x &=& \int_{-\infty}^\infty \frac{2 \cos(u)}{4+u^2} \mathrm{d}u = \\ &=& \Re \int_{-\infty}^\infty \frac{2 \mathrm{e}^{i u}}{4+u^2} \mathrm{d}u = \Re\left( 2 \pi i \operatorname{Res}_{u=2i} \frac{2 \mathrm{e}^{i u}}{4+u^2}\right) = \frac{\pi}{\mathrm{e}^2} \end{eqnarray} $$ Note, that the above substitution is related to the Cauchy-Schmlolich substitution (see arXiv:1004.2445).


Numerical check:
In[68]:= N[
  NIntegrate[Cos[x - 1/x]/(1 + x^2), {x, -Infinity, Infinity}, 
   WorkingPrecision -> 20]] == Pi/E^2

Out[68]= True

Solution 2:

Let $x-1/x = t$. Now note that $t^2 = x^2 + \dfrac1{x^2} -2 \implies \left(x+\dfrac1x \right)^2 = t^2+4$. We then get that $$\left(1 + \dfrac1{x^2} \right)dx = dt \implies \dfrac{dx}{1+x^2} = \dfrac{x^2}{(1+x^2)^2} dt = \dfrac{dt}{\left(x+1/x \right)^2} = \dfrac{dt}{t^2+4}$$ Hence, the integral becomes $$\int_{-\infty}^{\infty} \dfrac{\cos(x-1/x)}{x^2+1} dx = 2 \int_{0}^{\infty} \dfrac{\cos(x-1/x)}{x^2+1} dx = 2\int_{-\infty}^{\infty} \dfrac{\cos(t)}{t^2+4} dt = \dfrac{\pi}{e^2}$$ where the last integral can be obtained from the post below.

Calculating the integral $\int_{0}^{\infty} \frac{\cos x}{1+x^2}\mathrm{d}x$ without using complex analysis