I am familiar with Lagrange's trigonometric identities which are $$\begin{align} \sum_{n=1}^N \sin (n\theta) & = \frac{1}{2}\cot\frac{\theta}{2}-\frac{\cos((N+\frac{1}{2})\theta)}{2\sin(\frac{1}{2}\theta)}\\ \sum_{n=1}^N \cos (n\theta) & = -\frac{1}{2}+\frac{\sin((N+\frac{1}{2})\theta)}{2\sin(\frac{1}{2}\theta)} \end{align} $$
and I what to find out what happens to this sum when I plug in a, let's say, $kx-\omega t$ inside the cosine function:
$$\sum_{n=1}^{N} \cos(kx-\omega t +n\theta)=?$$
is it simply $\dfrac{\sin \left(\phi \left(N+\frac{1}{2}\right)+kx-\omega t\right)}{2 \left(\sin \left(kx-\omega t+\frac{\phi }{2}\right)\right)}-\dfrac{1}{2}$?