Consider the integral $$I=\int\limits_{-\infty}^{\infty}dx \frac{e^{-ixt}}{x^2-a^2}=\int\limits_{-\infty}^{\infty}dx \frac{\cos(xt)}{x^2-a^2}$$ for $t<0$ and $a>0$. The integrand has poles at $x=\pm a$ on the real axis. We can use contour integral to evaluate this.
Let us choose a contour that lies entirely in the upper half of the complex plane. Let the contour be so indented that the smaller semicircles $C_1$ and $C_2$, each of radius $\epsilon$, goes over the poles at $x=\pm a$, and the larger semicircle $\Gamma$ also lies in the upper half of the complex plane (so that contribution from it vanishes).
With this choice of contour, I want to show that $I=0$. This is a famous integral that arises in solving the wave equation by the method of Green's function. But my physics textbooks do not work out this integral explicitly, by considering different parts of the contour piece by piece. See page 125, figure 50 here.
For this contour, using residue theorem and Jordan's lemma, gives (schematically),
$$0=\int\limits_{-\infty}^{-a-\varepsilon} +\int\limits_{-a-\varepsilon}^{-a+\varepsilon}+\int\limits_{-a+\varepsilon}^{a-\varepsilon}+\int\limits_{a-\varepsilon}^{a+\varepsilon} +\int\limits_{a+\varepsilon}^{+\infty}.$$
In the limit, $\varepsilon\to 0$, the sum of the 1st, 3rd and fifth integrals reduce to the required integral I. Thus, $$I+\int\limits_{-a-\varepsilon}^{-a+\varepsilon}+\int\limits_{a-\varepsilon}^{a+\varepsilon}=0.$$ Therefore, in the limit $\varepsilon\to 0$, $$I=i\pi{\rm Res}_f(z=+a)+i\pi{\rm Res}_f(z=+a)\\ =i\pi\left(\frac{e^{-iat}}{2a}\right)+i\pi\left(\frac{e^{iat}}{-2a}\right)\\ =\frac{\pi}{a}\sin(at).$$
This video suggests that the required integral is nonzero. But it does not agree with the notes I linked. What is going on?