Simple expression for this sum?

Is there any simple expression for the sum: $$S = \sum_{n = 0}^{N-1} \frac{1}{a + e^{2 \pi i n / N}}$$ where $N$ is a positive integer and $a$ is some real number. It feels to me like there should be, but I am unable to find it. Similarly, any formula for $$P = \prod_{n=0}^{N-1} \left( a + e^{2 \pi i n / N} \right)$$ would be useful since $S = \frac{d}{da} \log P$.

Yes. The roots of $x^N - 1$ are the $N$-th roots of unity, so $$x^N-1 = \prod_{n=0}^{N-1} (x - e^{2 \pi i n / N}).$$ To get the plus sign, replace $x$ with $-x$: $$(-x)^N -1 = \prod_{n=0}^{N-1} (-x - e^{2 \pi i n / N}) = (-1)^n\prod_{n=0}^{N-1} (x + e^{2 \pi i n / N}) .$$ This means $P = a^n -1$ if $n$ is even, or $a^n +1$ if $n$ is odd.