How to compute this integral without using residues? 
How to compute
$$\int_C \frac{e^{iz}}{(z^2 + i)^2} dz, $$
where $C = \{|z| = 3\}$.

I tried a lot of ways through partial fractions but it didn't seem to work
any suggestions will be appreciated
 A: As mentioned a few times, apply the residue theorem.  This means finding the poles of the integrand, which are at
$$z^2+i=0 \implies z = \pm e^{i 3 \pi/4}$$
These are double roots, so the residues at these poles may be found by the following expressions:
$$r_+ = \operatorname*{Res}_{z=e^{i 3 \pi/4}} \frac{e^{i z}}{(z^2+i)^2} = \left [\frac{d}{dz} \frac{e^{i z}}{(z+e^{i 3 \pi/4})^2} \right ]_{z=e^{i 3 \pi/4}}$$
$$r_- = \operatorname*{Res}_{z=-e^{i 3 \pi/4}} \frac{e^{i z}}{(z^2+i)^2} = \left [\frac{d}{dz} \frac{e^{i z}}{(z-e^{i 3 \pi/4})^2} \right ]_{z=-e^{i 3 \pi/4}}$$
The integral is then $i 2 \pi (r_++r_-)$.
A: Here you want to apply the Residue Theorem.
$(1)$\ $\int_{|z|=3}\frac{e^{iz}}{(z^2+i)^2}=2\pi i(\sum res_{z=z_k}f(z))$.
$(2)$ The residues of $f$ that you need to compute are at the singular points of $f$, which by inspection are the second roots of -i. You can easily verify that the second roots of -i are: $e^{\frac{3\pi i}{4}}$,$e^{\frac{7\pi i}{4}}$.
$(3)$ Let $z_0=e^{\frac{3\pi i}{4}},z_1=e^{\frac{7\pi i}{4}}$.
$(3)$ Now compute the residues in the following manner, $res_{z=z_k}f(z)=(\frac{e^{iz}}{(z^2+i)^2}\frac{d}{dz})|_{z=z_k}$, for $k=0,1$.
$(4)$ Finish by using $(1)$
