Confusion in Cauchy Integral Formula I am trying to calculate a simple contour integral in three different ways and am getting three different results.
$$\int_{\vert z \vert = 2} \frac{1}{z^2+1}dz$$
Method $1$:
Write $\frac{1}{z^2 + 1} = \frac{1}{(z+i)(z-i)} = \frac{1/(z+i)}{z-i}$. Since $i \in B_2(0)$, we can apply the Cauchy Integral Formula to get
$$\int_{\vert z \vert = 2} \frac{1}{z^2+1}dz = \int_{\vert z \vert = 2} \frac{1/(z+i)}{(z-i)}dz = 2\pi i f(i)$$
where $f(z) = \frac{1}{z+i}$. Hence, the integral evaluates to $\pi$ since $f(i) = \frac{1}{2i}$.
Method $2$:
This is almost identical to the above. Write $\frac{1}{z^2 + 1} = \frac{1}{(z+i)(z-i)} = \frac{1/(z-i)}{z-(-i)}$. Since $-i \in B_2(0)$, we can apply the Cauchy Integral Formula to get
$$\int_{\vert z \vert = 2} \frac{1}{z^2+1}dz = \int_{\vert z \vert = 2} \frac{1/(z-i)}{(z-(-i))}dz = 2\pi i g(-i)$$
where $g(z) = \frac{1}{z-i}$. Hence, the integral evaluates to $-\pi$ since $g(-i) = -\frac{1}{2i}$.
Method $3$:
Using partial fractions, $\frac{1}{z^2+1} = \frac{1}{(z+i)(z-i)} = -\frac{1}{2i}\left(\frac{1}{z+i} - \frac{1}{z-i}\right)$. So,
$$\int_{\vert z \vert = 2} \frac{1}{z^2+1}dz = -\frac{1}{2i} \left(\int_{\vert z \vert = 2} \frac{1}{z+i}dz - \int_{\vert z \vert = 2}\frac{1}{z-i}dz\right) = 0$$
since both integrals are $2\pi i$.
Which of these three methods is correct and why are the other two wrong? (By symmetry I feel like the third one is correct, though I also think it may be that the first two are correct but somehow represent integrating in opposite directions along the contour.)

There are two poles inside $|z|=2$, so Cauchy's integral formula leads to
$$ \oint_{|z|=2}\frac{dz}{z^2+1}=2\pi i \sum_{a\in\{-i,i\}}\operatorname*{Res}_{z=a}\left(\frac{1}{z^2+1}\right)=0. $$
A simpler way to provide a quick reply is to notice that $\frac{1}{z^2+1}$ is holomorphic in the annulus $2\leq |z|\leq R$ for any $R>2$, so
$$ \oint_{|z|=2}\frac{dz}{z^2+1} = \oint_{|z|=R}\frac{dz}{z^2+1}. $$
On the other hand for any $z$ such that $|z|=R$ we have $|z^2+1|\geq R^2-1$, so
$$\left|\oint_{|z|=R}\frac{dz}{z^2+1}\right| \leq \frac{2\pi R}{R^2-1} $$
where the RHS converges to zero as $R\to +\infty$. In particular the original integral equals zero.
