Complex partial fractions

Could anyone help me separate this into partial fractions: $$\frac{\cos(z)}{z^2+1}$$ where $z=x+iy$. I've factored the denominator to get $$\frac{\cos(z)}{(z+i)(z-i)}$$ but I'm not really sure where to go from there. Thanks

You want to do it without the cosine? $$\frac{1}{(z+i)(z-i)} = \frac{A}{z+i}+\frac{B}{z-i}$$ where $A,B$ are complex constants. Solve for $A,B$ as in the real case. (But use complex arithmetic.)
Then you can multiply by $\cos(z)$, it does not vanish at $i$ or at $-i$.
• So the answer is $$\frac{icos(z)}{2(z+i)} - \frac{icos(z)}{2(z-i)}$$? – Arron Apr 4 '15 at 18:14