$$\int\limits_{0}^{2\pi}\frac{a \cos x -1}{(a^2+1-2a \cos x)^{3/2}}dx = 2\int\limits_{0}^{\pi}\frac{a \cos x -1}{(a^2+1-2a\cos x)^{3/2}}dx.$$
If a<1, this integral doesn't converge. How to evaluate it for any other a? I think it can be expressed as elliptic integral $I(a^2)$ or calculated using series, but stuck using both ways.