Using Cauchy’s Integral Formula to compute an integral How do we compute the integral $\displaystyle \int_{|z|=2}{\frac{\,dz}{z^2+1}}$. My first thought was to factor the denominator. I get $z^2+1=(z+i)(z-i)$. Do we have to apply the Cauchy Integral Formula here? Would that be my next step that I should take?
 A: Use partial fractions here. Doing so, will have our integrand as,
$$\frac{1}{z^2+1}=\frac{i/2}{z+i}-\frac{i/2}{z-i}$$
Now, as you mentioned, we could proceed with this by applying the Cauchy integral formula to $f(z)=1$. Therefore, we have
$$\frac{1}{2\pi i}\oint_{\mid z \mid = 2}\frac{1}{z^2+1}\,dz=\frac{i}{2}\left(\frac{1}{2\pi i}\right)\oint_{\mid z \mid = 2}\frac{1}{z+i}\,dz-\frac{i}{2}\left(\frac{1}{2\pi i}\right)\oint_{ \mid z \mid = 2}\frac{1}{z-1}\,dz=0$$
A: You can avoid using partial fractions this way.
This function that you have has two simple poles at $z=i$ and $z=-i$, both of which are inside the circle $|z| = 2$. Thus the integral is
$$\int_{|z|=2} \frac {1}{z^2+1}dz = 2\pi i \left( \text{Res}_i \frac {1}{z^2+1} +\text{Res}_{-i} \frac {1}{z^2+1}\right).$$
Now,
$$\text{Res}_i \frac {1}{z^2+1}  = \text{Res}_i \frac {\frac{1}{z+i}}{z-i} = \frac{1}{2i}$$and
$$\text{Res}_{-i} \frac {1}{z^2+1}  = \text{Res}_{-i} \frac {\frac{1}{z-i}}{z+i} = \frac{-1}{2i}.$$
What we have used here s the following:
If $g(z)$ has a simple pole at $z_0$, then  
$$\text{Rez}_{z_0} \frac{f(z)}{g(z)} = \frac{f(z_0)}{g'(z_0)}.$$
A: You may want to follow these steps:
(1) Find out all the poles of the integrand.
(2) Check how many of these line inside the curve $|z| = 2$.
(3) Find the residue at every pole identified in step (2).
(4) Use the residue theorem to get your answer.
A: First write
$$
      \oint_{|z|=2}\frac{1}{z^2+1}dz=\oint_{|z-i|=1/2}h(z)\frac{1}{z-i}dz+\oint_{|z+i|=1/2}k(z)\frac{1}{z+i}dz
$$
where $h(z)=\frac{1}{z+i}$ is holomorphic on a neighborhood of $|z-i|\le 1/2$ and $k(z)=\frac{1}{z-i}$ is holomorphic on a neighborhood of $|z+i|\le 1/2$. Using Cauchy's integral formula, the above becomes
$$
              2\pi i h(i) + 2\pi i k(-i)=2\pi i\frac{1}{i+i}+2\pi i\frac{1}{-i-i}=0.
$$
