# How to use Mathematica to simplify this kind of trig sum?

$$S=\sum_{k=0}^{10}\sin\left(\frac{(2+4k)\pi}{23}\right) =\sum_{k=0}^{10}e^\left(i\frac{(2+4k)\pi}{23}\right) =e^{i\frac{2\pi}{23}}\sum_{k=0}^{10}e^{i\frac{4k\pi}{23}} =e^{iu}\sum_{k=0}^{10}\left(e^{2iu}\right)^k$$

For example, I did this by hand, and got an answer as $$\frac{1}{2} \tan\left( \frac{\pi}{23} \right)$$

But how do I use Mathematica to check?

Sum[Sin[Pi/23*(2 + 4*k)], {k, 0, 10}]
Sum[Sin[Pi/23*(2 + 4*k)], {k, 0, 10}] - Tan[Pi/23]/2 // Simplify


I have tried some functions like Simplify,TrigFactor,TrigToExp. But I am not sure how to guide Mathematica to the final answer.

And similarly, how do I simplify

Sum[Sin[(-1)^k*Pi/23*(2 + 4*k)], {k, 0, 10}]


which I got as $$-\frac{1}{2} \tan\left( \frac{2\pi}{23} \right)$$.

• (Sum[Sin[Pi/23*(2 + 4*k)], {k, 0, 10}] - Tan[Pi/23]/2 )// FullSimplify produces 0 in version 12.0. Commented Feb 2, 2020 at 12:30
• @user64494 I think what he want is , how to get $\frac{1}{2} \tan \left(\frac{\pi }{23}\right)$ by mma. (Sum[Sin[Pi/23*(2 + 4*k)], {k, 0, 10}] - Tan[Pi/23]/2 )// FullSimplify is for check the answer. Commented Feb 2, 2020 at 12:36
• I don't understand your first equality as the LHS is real while the rhs is complex. What am I missing? Commented Apr 27 at 1:42

One way is:

Sum[Sin[Pi/23*(2 + 4*k)], {k, 0, n}] /. n -> 10 // Simplify

(* 1/2 Tan[\[Pi]/23] *)

• The second sum confuses Mathematica in its original form and has to be tweaked a little: Sum[(-1)^k*Sin[Pi/23*(2 + 4*k)], {k, 0, n}] /. n -> 10 Commented Feb 2, 2020 at 12:43
• That's just so weird!! Why wouldn't Sum[Sin[Pi/23*(2 + 4*k)], {k, 0, 10}]//Simplify work straight away..... Commented Feb 2, 2020 at 12:46
• @CasperYC. I don't really know, maybe because the algorithm is written in this way,can't find simpler form. Using Maple also can't . Commented Feb 2, 2020 at 12:52
• The reason is probably that simplifying such expressions requires guessing the pattern, finding the formula for x_i and then doing the sum the usual way, guessing the pattern being the hardest part of the problem. This would greatly slow down the Simplify function. Commented Feb 2, 2020 at 12:55
• @MariuszIwaniuk HAHA. That's fine. I gave up Maple ten years ago ... Commented Feb 2, 2020 at 13:10

Sum[Sin[Pi/23*(2 + 4*k)], {k, 0, n}]