$\cos x = \frac{e^{i x}+e^{-ix}}{2}$
Thus
$\int_0^{2\pi} \frac{dx}{a-\frac{e^{i x}+e^{-ix}}{2}} = \oint_C \frac{1}{a-\frac{z+z^{-1}}{2}} \frac{dz}{iz} = - i\oint_C \frac{dz}{az-\frac{z^2+1}{2}} = 2i\oint_C \frac{dz}{z^2-2az+1}$
where $C$ describes the unit circle $|z|=1$, centred at the origin, parametrized by $e^{iz}$ where $0\le z\le 2\pi$.
Letting $f(z)=\frac{1}{z^2-2az+1}$, we find that the poles of $f$ are at $z=a\pm\sqrt{a^2-1}$. Noting that $a>1$, the only pole in $C$ is the one with the negative sign. Then
$\operatorname*{Res}_{z = a-\sqrt{a^2-1}}f(z)= \lim_{z\to a-\sqrt{a^2-1}}\frac{z-a+\sqrt{s^2+1}}{z^2-2az+1}= \lim_{z\to a-\sqrt{a^2-1}}\frac{1}{2z-2a}=- \frac{1}{2\sqrt{a^2-1}}$
And thus we wrap up:
$\int_0^{2\pi} \frac{dx}{a-\cos x} = 2i\oint_C \frac{dz}{z^2-2az+1} = 2i\left(-\frac{2\pi i }{2\sqrt{a^2-1}}\right) = \frac{2\pi}{\sqrt{a^2-1}}$
$\blacksquare$