Evaluate ∫$\frac{\cos2x}{(1−2a\cos x+a^2)}\,\mathrm dx$ from $0$ to $2π$
I need to evaluate the following using contour integral given that |a|<1
I wrote $\cos2x$ as $\frac{1}{2}\bigl(\frac{z^4+1}{z^2}\bigr)$ , And changed $\mathrm dx$ into $\mathrm dz/iz$, by using $z^2=e^{2ix}$.
And later got stuck factorizing the integral,
Could anyone help me out with this