I have a question regarding a integral I just can't find the right solution to. It's this beauty:
$$\int_\gamma \frac{\cos(\pi z)}{z^2+1} dz$$ where $\gamma = 3 \cdot e^{it}$.
I used the Cauchy Integral Formula (see here) with $n=0$, $a=1$ and $f(z) = \frac{\cos(\pi z)}{z+1}$ and it got me a result of $-\pi i$. However, this integral should be zero according to my professor. Any help is appreciated!
It is not clear to me as to how you applied CIF for you function $f$. To apply CIF you need an analytic function.
Poles are at $\pm i$ and the residues are $\cos (\pi i)=\frac {e^{-1}+e^{1}}{2 i}$ and $\cos (-\pi i)=\frac {e^{-1}+e^{1}}{ -2i }$. So the integral is $0$ by Residue Theorem.