2
$\begingroup$

I want to use Mathematica to compute the period of the function $F(t)=\cos t - \exp \left( - \sum_{k=1}^{50} \frac{\sin (kt) }{k} \right) -\sum_{k=1}^{50} \frac{\cos (kt)}{k}$, so here's my code

F[t_] := Cos[t] - Exp[-Sum[Sin[k*t]/k, {k, 50}]] - 
  Sum[Cos[k*t]/k, {k, 50}]
FunctionPeriod[f, t]

However mathematica gives 0 as the period of F which would be the case if the function was not periodic, which I know is not the case by looking at the plot of F, so what is wrong here? Why does it give me 0 and how should I compute the Period of F?

$\endgroup$
3
  • 1
    $\begingroup$ F versus f may explain the pb ? $\endgroup$
    – chris
    Jan 13 at 19:57
  • $\begingroup$ The period of your function is trivially 2Pi. $\endgroup$ Jan 13 at 20:09
  • 1
    $\begingroup$ Use FunctionPeriod[ F[t], t ] (* 2 Pi *), as shown in the doc examples. $\endgroup$
    – LouisB
    Jan 13 at 20:50
3
$\begingroup$
Clear["Global`*"]

F[t_] = Cos[t] - Exp[-Sum[Sin[k*t]/k, {k, 50}]] - Sum[Cos[k*t]/k, {k, 50}];

Restrict the domain to Reals

FunctionPeriod[F[t], t, Reals]

(* 2 π *)

sol = NSolveValues[{F[t] == 0, 0 < t < 10}, t]

(* {0.564317, 1.38279, 6.8475, 7.66598} *)

Plot[F[t], {t, 0, 4 Pi},
 PlotPoints -> 200,
 MaxRecursion -> 5,
 Epilog -> {Red, AbsolutePointSize[4], Point[{#, 0} & /@ sol]}]

enter image description here

RootApproximant[(sol[[3]] - sol[[1]])/Pi]*Pi

(* 2 π *)

RootApproximant[(sol[[4]] - sol[[2]])/Pi]*Pi

(* 2 π *)

F[t] - F[t + 2 Pi] // PossibleZeroQ

(* True *)

F[t] - F[t + 2 Pi] // Simplify

(* 0 *)
$\endgroup$

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