Here is the generating function I'm studying.


$f=\prod^N\_{j=1}\left(1+e^{i\cdot j\varphi}z\right)$.


$\varphi$ is a phase related to a quantum optics problem.


And I want to know the analytical result of:


$\lim\_{z\to 0}\frac{1}{X!}\frac{d^Xf}{dz^X}$


with $1\le X\le N$.



Analytical result of a combination like generating function
The limit in question equals the coefficient of $z^X$ in $f(\varphi,z)$. For $1\leq X\leq N$, [series multisection](https://en.wikipedia.org/wiki/Series_multisection) allows to express this coefficient in the following closed form:
\begin{split}
& \frac{1}{N}\sum\_{k=0}^{N-1} e^{-X\frac{2\pi ik}{N}} f(\varphi,e^{\frac{2\pi ik}{N}})\\
=& \frac{2^N}{N} e^{i\frac{N(N+1)\varphi}4} \sum\_{k=0}^{N-1} (-1)^k e^{-X\frac{2\pi ik}{N}} \prod\_{j=1}^N \cos\left( \frac{j\varphi}2 + \frac{\pi k}{N}\right).
\end{split}


