Integral by Residue Theorem I'm working through a Complex Analysis text and am working through the Residue chapter. I am not sure if I am approaching this question correctly.
$$ \int_\gamma \frac{1}{(z-1)^2(z^2+1)}$$
Such that $\gamma$ is a circle of radius of 2 centered at 0. Traversed counter clockwise.
My approach was as follows:
I know that there are poles at $z=1,i,-i$ where $1$ is of order $2$.
First I found the residues at the poles as follows:
$$\operatorname{Res} _{z=1} :\lim_{z\rightarrow 1} \frac{d}{dz} \frac{(z-1)^2}{(z-1)^2(z^2+1)}$$
$$\lim_{z\rightarrow 1} \frac{d}{dz} \frac{1}{(z^2+1)}$$
$$\lim_{z\rightarrow 1} -\frac{2z}{(z^2+1)^2}$$
$$ = -1/2$$
$$\operatorname{Res} _{z=i} :\lim_{z\rightarrow i} \frac{1}{(z-1)^2}$$
$$ = \frac{1}{(i-1)^2}$$
$$\operatorname{Res} _{z=-i} :\lim_{z\rightarrow -i} \frac{1}{(z-1)^2}$$
$$ = \frac{1}{(-i-1)^2}$$
Therefore the integral is $2\pi i$*sum of the Residues.
$$= 2\pi i(\frac{1}{(i-1)^2} - \frac{1}{2} + \frac{1}{(-i-1)^2})$$
Thank you for any guidance. The repeated root is really where I'm wondering if it makes a difference.
 A: The residue at $1$ is computed correctly. The residues at $\pm i$ are a bit off. E.g.
$$ \operatorname{Res}_i(f) =\lim_{z \to i} (z - i)f(z) = \lim_{z \to i} \frac{z - i}{(z - 1)^2(z^2 + 1)} = \lim_{z \to i}\frac{1}{(z-1)^2(z + i)} $$
This should simplify to $\frac14$. The residue at $-i$ is also $\frac14$ so the sum of residues is
$$ \underbrace{-\frac12}_{z = 0} + \underbrace{\frac14}_{z = i} + \underbrace{\frac14}_{z = -i} = 0. $$
Alternatively, you can look at the question as
$$ \int_\gamma f = -\int_{- \gamma} f $$
where now we are integrating clockwise. Going clockwise around 0 is the same as going counterclockwise around $\infty$. Since all the poles in $\mathbb{C}$ are contained in $\{|z| < 2\}$, on $\{|z| > 2\}$ we only have the pole at infinity. See Residue at infinity (Wikipedia). So
$$ -\int_{- \gamma} f = -2\pi i\operatorname{Res}_{\infty} (f) = 2\pi i\operatorname{Res}_{0} \left( \frac{1}{z^2} f\left( \frac1z \right) \right). $$
and
$$ \operatorname{Res}_{0} \left[ \frac{1}{z^2} \frac{1}{\left( \frac1z - 1 \right)^2\left( \frac1{z^2} + 1 \right)} \right] = \operatorname{Res}_{0} \left[ \frac{z^2}{\left( 1 - z \right)^2\left( 1 + z^2 \right)} \right] = 0. $$
As you can see, using the residue at infinity saves you some computation. It's not going to make every computation easier, but it is still worth being aware of.
