TITLE: Sum related to discrete Fourier Transform
QUESTION [5 upvotes]: I am interested in calculation of the following sum:
\begin{equation}
\sum_{n=0}^{N-1}\frac 1 {1-a\cos(2\pi n/N)}
\end{equation}
where $0<a<1$. 
I Tried to pass to the exponential notation for the cosine in order to get a geomtric sum, but I could not get to any useful result. Is it possible to solve it analytically? If so, how?

REPLY [7 votes]: Denote the sum by $S_N(a)$, and let $\omega=\exp(2\pi i/N)$. Then, if $|z|\neq 1$,
\begin{align}
S_N\left(\frac{2z}{1+z^2}\right)
&=\sum_{n=0}^{N-1}\frac{1+z^2}{1-2z\cos(2\pi n/N)+z^2}\\
&=(1+z^2)\sum_{n=0}^{N-1}\frac{1}{1-z\omega^n}\frac{1}{1-z\omega^{-n}}\\
&=(1+z^2)\sum_{n=0}^{N-1}\frac{\sum_{u=0}^{N-1}(z\omega^n)^u}{1-(z\omega^n)^N}\frac{\sum_{v=0}^{N-1}(z\omega^{-n})^v}{1-(z\omega^{-n})^N}\\
&=\frac{1+z^2}{(1-z^N)^2}\sum_{u,v=0}^{N-1}z^{u+v}\sum_{n=0}^{N-1}\omega^{n(u-v)}\tag{*}\\
&=N\frac{1+z^2}{(1-z^N)^2}\sum_{u=0}^{N-1}z^{2u}=\color{blue}{N\frac{1+z^2}{1-z^2}\frac{1+z^N}{1-z^N}}
\end{align}
(the sum over $n$ in $(\text{*})$ is $0$ if $u\neq v$; otherwise, it is $N$).
To get $S_N(a)$ back, put $$z=\frac{1-\sqrt{1-a^2}}{a}.$$