How does the integral $\int_{D_C} e^{ia z}P(z)/Q(z)\,\mathrm{d}z$ blow up. In my book I have a theorem that goes something like the following

Let $P(x)$ be $Q(x)$ polynomials such that $\deg(Q) \geq \deg(P) + 2$.
  Then \begin{align*}  \int_{-\infty}^{\infty} \frac{P(x)}{Q(x)}
 e^{iax} \,\mathrm{d}x  = 2 \pi i \frac{a}{|a|} \sum_{k=1}^{m} \mathrm{Res}\left[
 \frac{P(x)}{Q(x)} , z_k \right] \end{align*} where $a$ is a real
  constant and $z_1,\,\ldots\,,z_m$ are the singularities to $P(x)/Q(x)$ in
  the upper halfplane if $a>0$ and the lower halfplane if $a<0$.

I am having a bit of problems understanding this. I know the reason why we have to switch contour is that $e^{iz}$ blows up. But I really can not see why or how it blows up. 
Take the canonical example for why this theorem is useful 
$$
  J = \int_{-\infty}^\infty \frac{e^{iz}}{z^2+1}
$$

Now the clue here is to show that the integral along the curve tends to zero, and then use the residue theorem. To show that the integral tends to zero I did this
\begin{align*}
 \left| \int_{C_1} \frac{e^{iz}}{1+z^2} \,\mathrm{d}z\right|
 \leq \int_{C_1} \left| \frac{e^{iz}}{1+z^2} \right| \,\mathrm{d}z 
 \leq \sup_{z = R e^{i \theta}} \left( \frac{1}{\left|1+z^2\right|} \right)
      \int_{C_1} |e^{iz}| \,\mathrm{d}z
\end{align*}
where the $ML$-inequality was used in the last inequality 
On the circle with radius $R$ we have $|e^{iz}|=R$, and we can use
the inequality $|a+b|\leq|a|-|b|$ to simplify further
\begin{align*}
 \left|\int_{D_R} \frac{e^{iz}}{1+z^2}\,\mathrm{d}z \right|
 \leq \sup_{z = R e^{i \theta}} \left( \frac{1}{|z|^2-1}\right)
 \int_{D_R} R \,\mathrm{d}z
 \leq \pi \frac{R}{R^2-1}
\end{align*}
which tends to zero as $R \to \infty$ as wanted.
but if one instead had $e^{-iz}$ then the theorem states that one has to use the lower half plane. But I do not see where my calculations err if one persists in using the contour in the upper half plane? What goes wrong, and why does it go wrong? $|e^{-iz}|$ should still be $R$ on the semi-circle. 
How can one formally show that the integral diverges when picking the contour as a semi circle in the lower half plane?
 A: 
How can one formally show that the integral diverges when picking the contour as a semi circle in the lower half plane?

The integral does - in the given situation - not diverge. If we let
$$I(a) = \int_{-\infty}^\infty \frac{P(x)}{Q(x)}e^{iax}\,dx,$$
which due to the assumption on the degrees exists as a Lebesgue integral as well as as an improper Riemann integral if $Q$ has no zeros on the real line, for large enough $R$, we have
$$-2\pi i \sum_{\operatorname{Im} \zeta < 0} \operatorname{Res} \left(\frac{P(z)}{Q(z)}e^{iaz};\zeta\right) = \int_{-R}^R \frac{P(x)}{Q(x)}e^{iax}\,dx - \int_{C_R} \frac{P(z)}{Q(z)}e^{iaz}\,dz,$$
where $C_R$ is the semicircle with centre $0$ and radius $R$ in the lower half-plane, traversed from $-R$ to $R$ (due to the choice of sign), by the residue theorem. Rearranging, we obtain
$$\lim_{R\to\infty} \int_{C_R} \frac{P(z)}{Q(z)}e^{iaz}\,dz = I(a) + 2\pi i \sum_{\operatorname{Im} \zeta < 0} \operatorname{Res} \left(\frac{P(z)}{Q(z)}e^{iaz};\zeta\right),$$
so it converges to a finite limit also for $a > 0$. However, that limit is in general not $0$:
For the example we find - with $a > 0$ -
$$I(a) = 2\pi i \operatorname{Res}\left(\frac{e^{iaz}}{z^2+1}; i\right) = 2\pi i \frac{e^{-a}}{2i} = \frac{\pi}{e^a}$$
using the semicircle in the upper half-plane, and thus
$$\lim_{R\to\infty} \int_{C_R} \frac{P(z)}{Q(z)}e^{iaz}\,dz = \frac{\pi}{e^a} + 2\pi i \operatorname{Res}\left(\frac{e^{iaz}}{z^2+1}; -i\right) = \frac{\pi}{ e^a} +2\pi i \frac{e^a}{-2i} = -2\pi\sinh a.$$
The point is: Even if the limit happens to be $0$, you cannot use it to determine $I(a)$ unless you can determine the limit in some way.
By choosing the semicircle in the correct half-plane, you get an estimate of the integrand that yields
$$\lim_{R\to\infty} \int_{C_R} \frac{P(z)}{Q(z)}e^{iaz}\,dz = 0$$
since $\lvert e^{iaz}\rvert = e^{-a\operatorname{Im} z}$ is bounded in the half-plane you choose, giving an $O(R^{-2})$ estimate of the integrand, and an $O(R^{-1})$ estimate for the integral by the standard estimate ($ML$-inequality). In the other half-plane, $e^{iaz}$ grows exponentially for $\lvert \operatorname{Im} z\rvert \to +\infty$, and thus you cannot establish the existence or value of the limit by using estimates, since there you have
$$\lim_{R\to\infty} \int_{C_R} \left\lvert \frac{P(z)}{Q(z)}e^{iaz}\right\rvert\,\lvert dz\rvert = +\infty,$$
the rational function being estimated below by $\frac{c}{\lvert z\rvert^2}$, and the exponential factor having modulus $e^{\lvert a\operatorname{Im} z\rvert}$.
A: Write $z=R e^{i \theta}$ for $\theta \in [0,\pi]$.  Then
$$e^{i z} = e^{i R \cos{\theta}} \, e^{-R \sin{\theta}}$$
The magnitude of the integral over the arc is then bounded by
$$\frac{R}{R^2-1} \int_0^{\pi} d\theta \, e^{-R \sin{\theta}} \le \frac{2R}{R^2-1} \int_0^{\pi/2} d\theta \, e^{-2 R \theta/\pi} \le \frac{\pi}{R^2-1}$$
Meanwhile
$$e^{-i z} = e^{-i R \cos{\theta}} \, e^{R \sin{\theta}}$$
so that the corresponding integral blows up as $R \to \infty$.
