I'm trying to compute the Fourier series of $f(x)=\frac{1}{2-\cos(x)}$ on the interval $[0, 2\pi]$. It is an even function, so I need to determine the $a_n$ coefficients. They are given by the following integral:
$a_n=\frac{1}{\pi}\int_{0}^{2\pi}\frac{\cos(nx/2)}{2-\cos(x)}dx.$
However, for some reason I can't compute this integral and am thinking I might be doing something wrong. Can anyone help?