I am able to solve this problem by Cauchy Residue theorem, but not by contour integration. (i.e Taking integration in semicircle of radius R and x-axis from -R to +R). $$ I = \int_0^{2\pi} \frac{1}{1-2a\cos(t)+a^2}dt\,. $$
$$ Given : a^2 < 1 $$
PS: Not a homework question, but practice question