This question was previously asked here in the Mathematics StackExchange but using a slightly different notation. But I did not find the answer I was looking for or rather got two very different answers.
Consider the following integral $$I=\int\limits_{-\infty}^{\infty}d\omega \frac{e^{-i\omega t}}{\omega^2-c^2k^2}$$ which has poles at $\omega=\pm ck$. When poles exists on the real line, we can either indent the contour to bypass the poles (or equivalently, use an appropriate $i\varepsilon$-prescription).
Let us choose a contour that lies entirely in the upper half of the complex $\omega$ plane. Let the contour consists of two small C1 and C2, each of radius $\varepsilon$, that goes over the poles at $\omega=\pm ck$, and the larger semicircle $C$ also lies in the upper half of the complex plane. Please see the diagram of Tong's Lecture notes on Electromagnetism on page 125, figure 50.
With this choice of contour, I Tong shows that $I=0$ for $t<0$.
But when I am trying to calculate it, for different parts of the contour, piece by piece, I get a nonzero result. Let me discuss how. Using Cauchy's residue theorem and Jordan's lemma, gives (schematically),
$$0=\int\limits_{-\infty}^{-ck-\varepsilon} +\int\limits_{-ck-\varepsilon}^{-ck+\varepsilon}+\int\limits_{-ck+\varepsilon}^{ck-\varepsilon}+\int\limits_{ck-\varepsilon}^{ck+\varepsilon} +\int\limits_{ck+\varepsilon}^{+\infty}.$$
In the limit, $\varepsilon\to 0$, the sum of the 1st, 3rd and 5th integrals reduce to the required integral $I$. Thus, $$I+\int\limits_{-ck-\varepsilon}^{-ck+\varepsilon}+\int\limits_{ck-\varepsilon}^{ck+\varepsilon}=0.$$ Therefore, in the limit $\varepsilon\to 0$, $$I=i\pi{\rm Res}(z=+ck)+i\pi{\rm Res}(z=+ck)\\ =i\pi\left(\frac{e^{-ickt}}{2ck}\right)+i\pi\left(\frac{e^{ickt}}{-2ck}\right)\\ =\frac{\pi}{ck}\sin(ckt)\neq 0$$
Therefore, this does not agree with Tong's notes I linked. What is wrong with my calculation? Tong's result is correct but I am unable to reproduce it in my way. Please note that I am not directly using the $i\epsilon$-presciption of shifting poles but using the prescription of indenting contours.