Let $a$ be given and let $\gamma$ be a simple closed curve oriented counterclockwise. Suppose that $\gamma$ encloses the numbers $z=\pm ai$. Show that
$\int \frac{e^z}{z^2+a^2}dz = \frac{2\pi i\text{sin}a}{a}$.
Usually with these problems I can find a way to rewrite the integrand and apply Cauchy's theorem or the deformation theorem. I'm not sure how to begin here however.
Also:
Let $f$ be analytic "on and inside" a simple closed curve $\gamma$. Suppose that $f=0$ on $\gamma$. Show that $f=0$ inside $\gamma$.
My proof:
Let $z_0$ be inside $\gamma$. Then by CIF we have
$f(z_0) = \int_{\gamma} \frac{f(z)}{z-z_0}dz$. But since $f=0$ on $\gamma$, we have $f(z_0) = \int_{\gamma} \frac{f(z)}{z-z_0}dz = 0$. Since $z_0$ was an arbitrary point inside $\gamma$, $f=0$ inside $\gamma$.
\begin{align} \oint_{\gamma} \frac{e^z}{z^2+a^2}\mathrm dz&=\oint_{\gamma} \frac{e^z}{(z-ia)(z+ia)}\mathrm dz\\ &=\frac {1}{2ia}\oint_{\gamma} \left (\frac{e^z}{z-ia}-\frac{e^z}{z+ia}\right)\mathrm dz\\ &=\frac {1}{2ia}(2\pi i e^{ia}-2\pi i e^{-ia})\\ &=2\pi i\frac {e^{ia}-e^{-ia}}{2i\,a}\\ &= \frac{2\pi i\sin a}{a} \end{align}