# Force a sum to be simplified

I want to force this sum to be simplified to 1

Sum[Cos[(Pi*l*(2*m + 1))/(n + 1)], {l, 0, n}]


Only DiscretePlot3D gives the correct result showing all point to 1

• For what values of $n$ and $m$? – MarcoB Feb 16 at 23:50
• @MarcoB for any integer number of n and m – Nitra Feb 17 at 10:43

Wrapping the first argument of Sum with TrigToExp gives the desired result:

FullSimplify[Sum[TrigToExp[Cos[Pi*l*(2*m + 1)/(n + 1)]], {l, 0, n}], m ∈ Integers]


1

• Great answer. Thank you @kgir – Nitra Feb 17 at 15:23
• @Nitra, you are most welcome. – kglr Feb 17 at 16:22

Another way:

If I use:

Exp[I x] // Re // ComplexExpand

(*Cos[x]*)


then:

func = Sum[Exp[I*(Pi*l*(2*m + 1))/(n + 1)], {l, 0, n}] // Re // ComplexExpand;
FullSimplify[func, Assumptions -> {n ∈ Integers, m ∈ Integers}]

(* 1 *)

• Great answer. Thank you very much. – Nitra Feb 17 at 14:59

The following code might do what you want:

s0 = Sum[Cos[(Pi*l*(2*m + 1))/(n + 1)], {l, 0, n}] // Simplify;
s1 = s0 /. {Cos[X_] - Cos[Y_] -> 2 Sin[(X + Y)/2] Sin[(Y - X)/2]};
s2 = s1 /. {Sin[x_] :> Sin[Factor@x],
Csc[x_] :> -Sin[(m + 1/2) Pi]/Sin[(m Pi - x)]};
s3 = Simplify[s2, m \[Element] Integers]


which evaluates to 1. The step to s1 was easy, but I had to do lots of experimentation to find the steps to s2 and s3. In particular the rule Csc[x_] :> -Sin[(m + 1/2) Pi]/Sin[(m Pi - x)] assumes that m is an integer but I could not get Mathematica to do it automatically. There may be better ways to simplify the sum s0 but perhaps others can produce them.

• Good work. Thank you. – Nitra Feb 17 at 10:47