Goal: To compute
$$ \int_{|z|=2} {dz \over z^2 + 1} $$
by decomposition of the integrand in partial fractions.
Attempt:
Let $\gamma$ be the circle around the origin of radius $2$. Let us parameterize $\gamma$ as
$$ \gamma(t) = 2e^{t i} \text{ s.t. } 0 \le t \le 2 \pi $$
so that we immediately have
$$ \gamma'(t) = 2i e^{{it}} $$
We have that
$$ z^2 + 1 = (z-i)(z+i) $$
Using this fact, we can decompose ${1 \over z^2 + i}$ as
$$ {1 \over z^2 + 1} = \left({0.5 \over z^2 - iz}\right) + \left({0.5 \over (z^2+iz)}\right) $$
Question: This decomposition looks very ugly, so I'm not sure that this is the best way to go about it. Is there a better way to tackle this problem?
Let's try that decomposition again. In particular, we can find $A,B$ such that $$ \frac{1}{z^2+1} = \frac A{z-i} + \frac B{z+i} \implies\\ 1 = A(z+i) + B(z-i) $$ There are different ways to solve form this point. I like to solve by plugging in the roots of the denominator for $z$. $$ 1 = A(-i + i) + B(-i -i) \implies 1 = -2Bi\\ 1 = A(i + i) + B(i -i) \implies 1 = 2Ai $$ So we have $$ \frac{1}{z^2 + 1} = \frac{1}{2i}\left( \frac{1}{z-i} - \frac{1}{z+i} \right) $$