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?


Let $\alpha = 2-\sqrt{3}$. For $|z|=1$ we have the following Laurent expansion:
$$ \frac{1}{2-\frac{z+z^{-1}}{2}} =\frac{-2z}{z^2-4z+1} = \frac{\alpha}{\sqrt{3}z(1-\frac{\alpha}{z})} + \frac{1}{\sqrt{3}(1-\alpha z)}=\\ \frac{1}{\sqrt{3}}\left(\dotsc +\frac{\alpha^2}{z^2} +\frac{\alpha}{z}+1 + \alpha z + \alpha^2 z^2 + \dotsc \right) $$
Set $z = e^{ i x}$ to get the required Fourier transform:
$$ \frac{1}{2-\cos(x)} = \frac{1}{\sqrt{3}} + \frac{2}{\sqrt{3}} \sum_{n=1}^\infty (2-\sqrt{3})^n \cos(n x). $$