In physics, we do contour integrals in a not so rigorous way most of the times. Now, I want to use a trick to compute $$\int_{-\infty}^{\infty}\frac{\sin(x)}{x}dx$$ using residue theory. I find:
$$\int_{-\infty}^{\infty}\frac{\sin(x)}{x}dx=2\pi$$which is clearly wrong since the correct value is $\pi$.
I don't know what I am doing wrong here but I think it might have to do with using the residue theorem in a clumsy way. Any help in finding the mistake will be much appreciated.
My solutions is the following(sorry if my notation(arguments) is too awkward(or not rigorous enough)):
$$\int_{-\infty}^{\infty}\frac{\sin(x)}{x}dx=Im\left[\int_{-\infty}^{\infty}\frac{e^{ix}}{x}dx\right]=Im\left[\lim_{ε\to0}\int_{-\infty}^{\infty}\frac{e^{ix}}{x-iε}dx\right]$$ which has a residue just above $x=0$ on the complex plane.
Now, consider the following integration paths:
So, I can write the above integral as:
$$Im\left[\lim_{ε\to0}\int_{-\infty}^{\infty}\frac{e^{ix}}{x-iε}dx\right]=Im\left[\lim_{ε\to0}\int_{C2}\frac{e^{ix}}{x-iε}dx\right]$$(of course $R\to \infty$)
Now, if we integrated the same integrand but the path was $C1$, it would give zero since the integrand tends to zero for large $Im[x]$ on the upper plane(this argument was used by a professor of our for a scattering problem in quantum mechanics).
So, we can now write:
$$Im\left[\lim_{ε\to0}\int_{C2}\frac{e^{ix}}{x-iε}dx\right]=Im\left[\lim_{ε\to0}\int_{C1+C2}\frac{e^{ix}}{x-iε}dx\right]$$which is an integral along a closed path that encloses the pole(residue) at $x=iε$. So, I can use the residue theorem to find that the integral is equal to: $$Im[\lim_{ε\to0}2\pi i Res(e^{i(iε)})]=2\pi $$ which is clearly off by a factor of 2.
So, which of the above arguments is wrong?