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!
 A: 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.
A: I believe you need $$S_1=\sum_{r=-4}^3\cos\dfrac{(2r+1)\pi}8\text{ ans }S_2=\sum_{r=-4}^3\cos^2\dfrac{(2r+1)\pi}8$$
Clearly, $\cos8t=-1$ for $t=\dfrac{(2n+1)\pi}8$ where $-8\le2n+1\le8\iff-4\le n\le3$
Using this,
$$\cos8t=2^7\cos^8x-8\cdot2^5\cos^6x+\cdots+1$$
So, the roots of $$128c^8-256c^6+\cdots+2=0$$ are $\cos\dfrac{(2r+1)\pi}8,-8\le2r+1\le8$
By Vieta's formula,
$$S_1=\dfrac0{128}$$ and $$S_2=S_1^2-2\left(-\frac{256}{128}\right)=?$$
