I have $\int_{C}\frac{e^z}{z^2 + a^2}$ where $a>0$ and $C$ is a positively oriented simple closed contour containing the circle $|z|=1$.
I start with $$\frac{1}{z^2 + a^2} = \frac{1}{(z+ia)(z-ia)} = \frac{A}{z+ia} + \frac{B}{z-ia}$$ Then,$$1 = z(A + B) + ia(-A + B)$$ Shouldn't we then have $$A+B =0, \; -A+B = 1$$? This turns out to be incorrect and I want to know why.
No, you get:
$A+B = 0$ and $ia(-A+B) = 1$. (You can't just drop the $ia$ factor.)