I'm doing complex integration and I'm trying to evaluate:
$$\int_C \frac{\cos{z}}{z^2 + 1} dz$$
Where $C$ is the clockwise boundary of a parallelogram with vertices $3i$, $2$, $-3i$, $-2$ (i.e. a diamond centered on $0$). I've found that the poles of the function are at $i$ and $-i$ since $\cos{z}$ is holomorphic everywhere, and so I used partial fractions to split the integrand as follows:
$$\frac{\cos{z}}{z^2 + 1} = \frac{\frac{i}{2} \cos{z}}{z + i} - \frac{\frac{i}{2} \cos{z}}{z - i}$$
And then I integrated each separately, using Cauchy's integral theorem, which I argued is applicable since each integrand is now of the form $f(z) / (z - z_0)$ with $z_0 = \pm i$, with each pole (and the contour) being inside the parallelogram and $f$ holomorphic everywhere. Using the theorem I found that both integrals were equal to $\pi \cosh{1}$. So the two cancel out and I concluded that:
$$\int_{\gamma} \frac{\cos{z}}{z^2 + 1} dz = 0$$
Is this correct? Also, is there some kind of easy way to check if a contour integral result makes sense, perhaps some intuitive interpretation of them, or a systematic way to reduce them to a real-valued integral that could be fed to a computer? I'm having issues saying "ok I got this one" and moving on because I can't check my work at all on my own, so this would really help. Thanks!