$$\int_0^{2\pi} \dfrac{\cos mx}{x^2-1} dx$$
I can calculate this as $\int_{-\infty}^{\infty}$ using residue theorem by indenting the real axis at the poles $x=1,-1$ and taking the radius of these semi-circles as $r\to 0$ and that of the bigger semi-circle as $R \to \infty$
I can calculate $\int_0^{2\pi} f(\theta) d\theta $ by taking contour around unit circle and putting $z=\cos\theta+i\sin\theta$
This seems to be a hybrid of these 2 types.
How do I do contour integral on this?