Maximum Likelihood estimate

I've been having problem with toy contour integration because most of the time I wasn't able to prove the integral around the arc length, sometimes the integral along the arc length of a semicircle is equal to 0.

I'm integrating $\displaystyle \int_{-\infty}^{\infty}\frac{cosx}{x^2+a^2}dx$. I follow what I've learned, so I integrate this over semicircle C with radius R. I found the poles, and use the residue theorem to obtain the integral. But I don't know how to show that the integral along this semicircle is 0 as R approaches infinity. There are two ways that I've seen my professor to do this is to use the inequality $\displaystyle \mid \int_{\gamma}f(z)dz \mid \leq sup \mid f(z) \mid length(\gamma)$. Sometimes, he uses the maximum likelihood estimate which I really have no idea about. Can someone help me on this? Are these two techniques always applicable and interchangable in this case and in some other similar integrals over some arc length. I really appreciate any help.