2
$\begingroup$

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

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

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

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

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 *)
$\endgroup$
  • $\begingroup$ Great answer. Thank you very much. $\endgroup$ – Nitra Feb 17 at 14:59
2
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ Good work. Thank you. $\endgroup$ – Nitra Feb 17 at 10:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.