Once , I do a problem $ \sum_{n=1}^{14} \cos\left ( \frac{n^{2}\pi }{14} \right )$ when angle modular by $28$ we've got
$2\left ( \cos\left (\frac{\pi }{14} \right ) - \cos\left (\frac{2\pi }{14} \right ) + \cos\left (\frac{3\pi }{14} \right ) + \cos\left (\frac{4\pi }{14} \right ) - \cos\left (\frac{5\pi }{14} \right ) - \cos\left (\frac{6\pi }{14} \right ) \right ) + 1$
and then using identity $\cos\left ( a \right ) - \cos\left ( b \right )$ and $\cos\left ( a \right ) + \cos\left ( b \right )$
leads to $2\sqrt{2} \left (\cos\left ( \frac{\pi }{28} \right ) -\cos\left ( \frac{3\pi }{28} \right )+\sin\left ( \frac{5\pi }{28} \right )\right ) + 1$
the final answer is $\sqrt{7}$ but I don't know how to compute $\left ( \cos\left ( \frac{\pi }{28} \right ) - \cos\left ( \frac{3\pi }{28} \right )+\sin\left ( \frac{5\pi }{28} \right )\right )$ by hands.
I appreciate for your helps.
Your sum can be written in terms of complex exponentials as
$$ 1+\exp(\pi i/14) + \exp(3 \pi i/14) + \exp(4 \pi i/14) + \exp(8 \pi i/14) + \exp(9 \pi i/14) + \exp(12 \pi i/14) + \exp(16 \pi i/14) + \exp(19 \pi i/14) + \exp(20 \pi i/14) + \exp(24 \pi i/14) + \exp(25 \pi i/14) + \exp(27 \pi i/14) $$ If $w = e^{i\pi/14}$, this is $$Q(w) = {w}^{27}+{w}^{25}+{w}^{24}+{w}^{20}+{w}^{19}+{w}^{16}+{w}^{12}+{w}^{9} +{w}^{8}+{w}^{4}+{w}^{3}+w+1 $$ The claim is that $Q(w)^2 - 7 = 0$ which must mean that $Q(w)^2-7$ is divisible by the minimal polynomial of $w$. Since $w$ is a primitive $28$'th root of $1$, that minimal polynomial is the $28$'th cyclotomic polynomial $C_{28}(w)$, namely ${w}^{12}-{w}^{10}+{w}^{8}-{w}^{6}+{w}^{4}-{w}^{2}+1$. And indeed it turns out that $(Q(w)^2-7)/C_{28}(w)$ is a polynomial in $w$ of degree $42$ (but I'd hate to have to verify that by hand).