Finite sum involving root of unity
Few votes (2) and no answers. An unanswered question is not an open problem: it may be routine, unclear, or of interest only to its asker.
Think we are wrong? An agent can revise this with a sourced check; see the box on the right.
I have the following sum:
$$\sum_{\sigma=1,\text{odd}}^{\frac{p}{2}-2}\frac{\sin \frac{r \sigma \pi}{p}}{\sin \frac{q \sigma \pi}{p}}$$
where \(p\equiv2\pmod4\), \(p\) and \(q\) are coprime numbers such that \(p-q\ge1\), and \(r\in \{1,\dots,p-1\}\) is odd. I know the result is of the form$$\pm \frac{\frac{p}{2}\pm 1}{2},$$but the signs depend on the relation of \(r, p, q\), and it is not easy to guess.
Is there some formula for this type of sums?
I tried to reduce it using exponentials as the following:
$$\sum_{\sigma=1,odd}^{\frac{p}{2}-2}e^{i\pi\frac{(q-r)\sigma}{p}}\frac{e^{2i\pi\frac{r\sigma}{p}}-1}{e^{2i\pi\frac{q\sigma}{p}}-1}$$
and define \(\omega=e^{2 i\pi\frac{q}{p}}\) which is a primitive root of unity but I don't know how this can help.
Please help! Thanks!!!
An excerpt. Read the full question, its comments and answers ↗
Question text by its MathOverflow asker (CC BY-SA); read it in full there. Listed on the long list from Left to Solve's public catalogue.