Let \(t\in\mathbb R\) be a real number, which is not a multiple of $2\pi$, where $\pi$ is the Pi constant. Then the following sum of cosines can be calculated using the formula:
$$\sum_{k=1}^n\cos(kt)=\frac{t\sin\left(n+\frac 12\right)}{2\sin\left(\frac t2\right)}-\frac 12.$$
Proofs: 1