<s>[INST] Evaluating $\sum\limits_{i=1}^8 \cos\frac{\pi t_i}{4}$ and $\sum\limits_{i=1}^8 \cos^2\frac{\pi t_i}{4}$ for $t\in\{-7,-5,-3,-1,1,3,5,7\}$ I am dealing with a series$$\sum_{i=1}^8 \cos\frac{\pi t_i}{4}$$
with $t\in\{-7,-5,-3,-1,1,3,5,7\}$. How can I determine a global solution for this summation? Would it be the same logic for$$\sum_{i=1}^8 \cos^2\frac{\pi t_i}{4}?$$Many thanks for your help!
 [/INST] You have a formula for the sum of sines or cosines of arcs in an arithmetic progression:
$$ \cos a + \cos(a + \theta )+\cos(a + 2 \theta )+ \dots + \cos(a + n \theta ) = \frac{\sin \frac{(n +1) \theta }{2}}{\sin \frac{ \theta }{2}}\,\cos\Bigl (a + \frac{n \theta }{2}\Bigr)$$
$$\sin a+ \sin(a + \theta )+ \sin(a + 2 \theta )+ \dots + \sin(a + n \theta ) = \frac{\sin \frac{(n + 1)\theta }{2}}{\sin \frac{\theta }{2}}\,\sin\Bigl (a + \frac{n \theta }{2}\Bigr),$$
that you can prove calculating the sum of the geometric progression
$$\sum_{k=0}^n\mathrm e^{i(a+k\theta)}=\mathrm e^{ia}\sum_{k=0}^n\mathrm e^{ik\theta}$$
and identifying the real and imaginary parts.
</s>