Applying Cauchy Residue Theorem to $\int_{C}\frac{e^{z}}{sin^2{z} - 1}$ For $\int_{C}\frac{e^{z}}{sin^2{z} - 1}$, $C = \{|z|=3 \}$,
this has singularities at $z = \frac{\pi}{2}$ and $z = \frac{3\pi}{2}$. 
So $Res(f,\frac{\pi}{2}) = \frac{e^{z}}{\sin(2z)} = \frac{e^{\frac{\pi}{2}}}{\sin(\pi)}$
But then we are dividing by $0$. What am I doing wrong?
 A: I don't know what your thought process was for the residue calculation. What needs to occur is to compute
$Res(f,\frac{\pi}{2}) = \lim_{z\to \pi/2}(z-\frac{\pi}{2})\frac{e^{z}}{\sin(2z)}.$
Since $e^z$ is well behaved, thew limit of interest is really
$\lim_{z\to \pi/2}\frac{z-\frac{\pi}{2}}{\sin(2z)}=\lim_{z'\to 0}\frac{z'}{\sin(2z' +\pi)}= -\lim_{z'\to 0}\frac{z'}{\sin(2z')}= -\lim_{z'\to 0}\frac{z'}{2z'-\frac{(2z')^3}{3!}+\cdots}=-\frac{1}{2}.$
Thus,
$Res(f,\frac{\pi}{2}) = \lim_{z\to \pi/2}(z-\frac{\pi}{2})\frac{e^{z}}{\sin(2z)} = -\frac{e^{\pi/2}}{2}.$
Does this clarify?
A: Rewrite the integral as
$$-\oint_C dz \frac{e^z}{\cos^2{z}} $$
Note that there are double poles at $z=\pm \pi/2$ within $C$.  ($z=3 \pi/2$ is not within $C$ and therefore does not contribute to the integral.)
The residue at $z=\pi/2$ is therefore given by
$$-\left \{ \frac{d}{dz} \left [\left ( z-\frac{\pi}{2} \right )^2 \frac{e^z}{\cos^2{z}}\right ] \right \}_{z=\pi/2}  = e^{\pi/2}$$
The residue at $z=-\pi/2$ is given by
$$-\left \{ \frac{d}{dz} \left [\left ( z+\frac{\pi}{2} \right )^2 \frac{e^z}{\cos^2{z}}\right ] \right \}_{z=\pi/2}  = e^{-\pi/2}$$
The integral is $i 2 \pi$ times the sum of the residues, or $i 4 \pi \cosh{(\pi/2)} $.
