6
FunctionPeriod[Sin[16 Pi x/5 - Pi/8], x, Integers]
80

then I ListPlot the function:

ListPlot[Transpose[{Range[0, 90], Sin[16/5 π Range[0, 90] - π/8]}], Filling -> Axis]

then I test the number:

Union[Simplify[Sin[16/5 π Range[0, 90] - π/8]]]
{-Cos[π/40], Cos[(7 π)/40],Cos[(9 π)/40], -Sin[(3 π)/40], -Sin[π/8]}

so I wonder why Mathematica gives 80 instead of 5?

RunnyKine
  • 33,088
  • 3
  • 109
  • 176
partida
  • 6,816
  • 22
  • 48

1 Answers1

7

FunctionPeriod is certainly imperfect. There is already discussion of this in this question, though that predates FunctionPeriod and uses lower level tools buried in the Periodic context. Nonetheless, the same comments apply:

FunctionPeriod[Sin[3 t] Sin[5 t], t]
(* Incorrect result: 2Pi *)

FunctionPeriod[TrigFactor[Sin[3 t] Sin[5 t]], t]
(* Correct result: Pi *)

Similarly,

FunctionPeriod[Sin[16 Pi x/5 - Pi/8], x, Integers]
(* Incorrect result: 80 *)

FunctionPeriod[TrigFactor[Sin[16 Pi x/5 - Pi/8]], x, Integers]
(* Correct result: 5 *)

I don't know of any cases where FunctionPeriod returns a result that is too small so you might generally try applying several of the Trig* commands and grab the absolute value of the minimum.

Mark McClure
  • 32,469
  • 3
  • 103
  • 161
  • It's good to have this information in an answer rather than the comment section like the duplicate to which you refer. Is this issue best considered a bug or functionality-in-progress? – bobthechemist Sep 24 '14 at 13:57
  • I don't think this is a duplicate, as the other question predates FunctionPeriod. Also, while FunctionPeriod builds on the Periodic context, there are differences. I guess I'd say it's a bug but I doubt that it's a very high priority bug. – Mark McClure Sep 24 '14 at 14:03
  • Thanks for TrigFactor and Trig* - an excellent answer – eldo Sep 24 '14 at 14:08
  • @MarkMcClure fair enough. – bobthechemist Sep 24 '14 at 16:28