Evaluate the integral along a contour containing 2 interior points by using Cauchy's Integral Formula Evaluate the integral $$\int_{C}\frac{z^2}{z^2+9}dz$$
where C is the circle $|z|=4$

I know that if f is analytic in simply connected domain $D$, $C$ a simple closed positively oriented contour that lies in D and $z_o$ lies interior to $C$, then
$$\int_{C}\frac{f(z)}{z-z_o}dz=2\pi i f(z_o)$$

But for this problem, the circle contains both interior points which is $3i$ and $-3i$. And I found that reducing the fraction into partial fraction seems to be useless in solving the problem. So what is the $f(z)$ here?
Hint:

Note that $z^2+9 = (z+3i)(z-3i)$.  So with partial fraction decomposition, we get:

$$\frac{z^2}{(z^2+9)} = \frac{iz^2}{6(z+3i)} - \frac{iz^2}{6(z-3i)}$$

Therefore:

$$\int_C \frac{z^2}{z^2 + 9} \ dz = \int_C \frac{iz^2}{6(z+3i)} \ dz - \int_C \frac{iz^2}{6(z-3i)} \ dz$$

And you can apply Cauchy's integral formula to each of the two pieces on the right hand side.



Alternative:

You can split the contour into two pieces $C_1$ and $C_2$, where $C_1$ is the upper half of the circle $|z| = 4$ together with the segment $[-2, 2]$, and likewise $C_2$ is the lower half of the circle $|z|=4$ together with the same segment.  If both are oriented counterclockwise, then $C = C_1 + C_2$, and so the integral splits accordingly, and you'll notice that each of $C_1$ and $C_2$ contains only one point where analyticity fails.  I won't write out all the details, but you can refer to my previous post here for more information.
$I=2\pi i (\frac{(3i)^2}{3i+3i}+\frac{(-3i)^2}{-3i-3i})=\frac{-9}{6i}+\frac{9}{6i}=0$