Imagine we wanted to calculate the following integral: $$ \int_{-\infty}^{\infty} \frac{e^{i\omega t}}{\omega^2 +1} d\omega $$ We know, by residue theory that: $$ \int_{-\infty}^{\infty} \frac{e^{i\omega t}}{\omega^2 +1} d\omega = 2\pi i\sum_i^n \text{Res} (f, z_i) - \int_{arc} f(\omega) d\omega $$ Then we finally have (for $t > 0$): $$ \int_{-\infty}^{\infty} \frac{e^{i\omega t}}{\omega^2 +1} = \pi e^{-t} $$ But, now, what I don't exactly understand is, why you need to integrate over a contour that encloses $-i$, to find the integral but for $t < 0$. Same goes for $t > 0$, why integrating along a contour that encloses $+i$, gives me a result for $t > 0$. Any hint?
Is there any relation between integrating along a contour that encloses singularities with $\mathrm {Im} (z) > 0$ and with $t > 0$ and vice versa.