I was given the following problem and told to evaluate where C is the circle $|z|=2$ :
$$ \int_{|z|=2} \frac{1}{z^2-1} dz$$
I've tried solving using Cauchy's Integral Formula and I got the answers $$ \int_{|z-1|=1} \frac{1}{z^2-1} dz = \pi i$$ and $$\int_{|z+1|=1} \frac{1}{z^2-1} dz = - \pi i$$ Any insight onto whether I’m doing this correctly would be helpful here is a picture of my work
For this question, we can directly apply partial fraction decomposition, then we evaluate our integral using Cauchy integral formula.
$$ \begin{align} \int_{|z|=2} \frac{1}{z^2 - 1} dz & = \int_{|z|=2} \frac{1}{(z - 1)(z+1)} dz\\ & = \int_{|z|=2} \Big( \frac{1}{2} \frac{1}{z-1} - \frac{1}{2} \frac{1}{z+1} \Big) dz\\ & = \frac{1}{2} \int_{|z|=2} \Big( \frac{1}{z-1} - \frac{1}{z+1} \Big) dz\\ \end{align} $$ Since, the points are interior to the contour $C$, ie. $1\in(-2,2)$ and $-1\in(-2,2)$, we can evaluate the integral directly: $$ \begin{align} \int_{|z|=2} \frac{1}{z^2 - 1} dz & = \frac{1}{2}\Big( 2 \pi i -2\pi i \Big) \\ & = 0\\ \end{align} $$
Alternatively, you can apply the residue theorem as well. At (simple) poles $z=1$ and $z=-1$, we have the residues of $1/2$ and $-1/2$ respectively. Hence, $$ \begin{align} \int_{|z|=2} \frac{1}{z^2 - 1} dz & = 2 \pi i \sum_{k=1}^K \text{Res}_{z=z_k} f(z) \\ & = 2 \pi i \Big(\frac{1}{2}-\frac{1}{2}\Big) \\ & = 0 \\ \end{align} $$
(*Comments: Your steps are already off upon evaluating your integral. You do not need to change your contour.)
Hope it helps.