Partial fractions for $\frac{1}{(z^2+1)^2}$ I am trying to decompose the following:
$$\frac{1}{(z^2+1)^2}$$
for the calculation of the integral $$\int_{|z|=2} \frac{e^{iz}}{(z^2+1)^2}dz$$
by using Cauchy's formula.
The only thing I am stuck with is the 3rd expression in
$$\frac{1}{(z^2+1)^2}=\frac{1}{4}\left( \frac{1}{(z-i)^2}+\frac{1}{(z+i)^2}-\frac{2}{z^2+1} \right)$$
How do I integrate it?
I mean, I can go on with partial fractions for it too but it becomes too long for my exercise. I guess there is a shorter way.
Or is there something wrong with my decomposition of the integrand?
 A: The shorter way for computing these integrals is to use residue theorem, which in this case you have two poles of order two $i,-i$ in the given domain, try to find the integral by residue theorem...
Observe that if you want to use just Cauchy's integral formula, you have to make denominators linear or powers of linear functions...
In your case we have
$$
\frac{-2}{z^2+1}=\frac{i}{z-i}-\frac{i}{z+i}
$$
Now you can use Cauchy's integral formula...
A: If you expand around the pole at $z = i$ by substituting $z = i + t$ and expanding in powers of $t$, you get:
$$\frac{1}{z^2+1} = \frac{1}{2 i t + t^2} = \frac{1}{2it}\frac{1}{1-\frac{it}{2}} = \frac{1}{2it}\left(1+\frac{it}{2}+\cdots\right)=-\frac{i}{2t} + \frac{1}{4}+\cdots$$
Squaring both sides gives:
$$\frac{1}{\left(z^2+1\right)^2} = -\frac{1}{4t^2}-\frac{i}{4t}+\cdots$$
So, the singular part of the expansion around $z = i$ is:
$$\frac{1}{4(z-i)^2} - \frac{i}{4(z-i)}$$
The singular part of the expansion around $z = -i$ is the complex conjugate of this when you take $z$ to be real, so it's given by:
$$\frac{1}{4(z+i)^2} + \frac{i}{4(z+i)}$$
Which is then also valid if $z$ isn't real. 
Then the sum of these singular parts of the two expansions equals $\frac{1}{\left(z^2+1\right)^2}$ because if you consider the difference between this function and the sum if the two singular parts, the resulting function would only have removable singularities, but being a rational function this means that it is in fact a polynomial, but it tends to zero at infinity, so it is in fact equal to zero everywhere. 
