A Contour Integral I'm interested in computing the integral:

$$ - \frac{1}{2 \pi} \int_{- \infty}^{\infty} dE \; \frac{e^{-iEt}}{E^2 - \omega^2 + i\epsilon}.  $$

I have two small queries:


*

*How does one choose the relevant contour while deciding to the integration. For example, the solution to the problem argues:



If $t > 0$, we can add an integral along an
  arc at infinity in the lower half complex $E$ plane, since $e^{-iEt}$ vanishes on this arc.

I'm not quite sure how has one pinned down the contour and what does it exactly mean to 'add an integral' to the original integral at hand. If someone could argue on how to approach solving the integral by choosing the relevant contonour (why?), that'd be great.


*For one of the poles, the solution states that:



By the
  residue theorem, the value of the integral is $−2πi$ times this residue. 

Where does the minus sign come from? Doesn't the residue theorem state that the value of the integral on a closed contour enclosing a pole is $2πi$ times this residue?
Thanks.
 A: The poles of the integrand are not at $E=\pm (\omega - i\epsilon)$.  Rather, the poles are located at $E=\pm \sqrt{\omega^2 - i\epsilon}$.
Now, the Residue Theorem guarantees that 
$$\oint_C \frac{e^{-iEt}}{E^2-\omega^2+i\epsilon}\,dE=2\pi i \sum_{\text{Residues}}\left(\frac{e^{-iEt}}{E^2-\omega^2+i\epsilon}\right) $$
where $C$ is a Counter Clockwise closed contour encircling zero, one, or two of the poles of the integrand.
Now, if $t<0$, we let $C$ be the contour comprised of (i) the real line segment from $-R$ to $R$ and (ii) the semicircle in the upper-half plane.  This contour is traversed counter clockwise.  Therefore, we have
$$\begin{align}
\oint_C \frac{e^{-iEt}}{E^2-\omega^2+i\epsilon}\,dE&=\int_{-R}^R\frac{e^{-iEt}}{E^2-\omega^2+i\epsilon}\,dE+\int_0^\pi \frac{e^{-iRe^{i\phi}}}{R^2e^{i2\phi}}\,iRe^{i\phi}\,d\phi \tag 1\\\\
&=2\pi i \frac{e^{i\sqrt{\omega^2-i\epsilon}\,t}}{2\sqrt{\omega^2 -i\epsilon}}
\end{align}$$
As $R\to \infty$, the second integral on the right-hand side of $(2)$ vanishes thereby revealing for $t<0$
$$\int_{-\infty}^\infty\frac{e^{-iEt}}{E^2-\omega^2+i\epsilon}\,dE=i \pi \frac{e^{i\sqrt{\omega^2-i\epsilon}\,t}}{\sqrt{\omega^2 -i\epsilon}}$$
where we have tacitly defined the square root on the principal branch (The pole at $E=-\sqrt{\omega^2 - i\epsilon}$ is in the upper-half plane).
Now, for $t>0$, we proceed analogously, but closing the plane in the lower half plane.  Note in this case, the contour is traversed in a clockwise sense and therefore, we must replace $2\pi i $ with $-2\pi i$ in applying the residue theorem.
