# Compare Periods over Different Domains

The periodicity properties of a function may differ as it is considered over different domains. The following command compares the period of a function over the integers, reals, and complexes.

 In:= Xdomains = {Integers, Reals, Complexes};
 In:= XcompareDomains[f_, x_] := Table[FunctionPeriod[f, x, dom], {dom, domains}]

Famously, the exponential function has an imaginary period.

 In:= XcompareDomains[Exp[x], x]
 Out= Functions can be periodic over the reals only or integers only as well.

 In:= XcompareDomains[Sqrt[Cot[x]], x]
 Out= In:= XcompareDomains[Mod[n^2 + 2 n + 3, 7], n]
 Out= Out= On the other hand, power functions involving roots of are periodic over all three domains.

 In:= XcompareDomains[I^n, n]
 Out= In:= XTable[I^n, {n, 0, 8}]
 Out= It is easy to compare the domains for many different functions.

 In:= Xfuncs = {Exp[x], Sin[x], Cos[Pi x/2], Tanh[3 x], SquareWave[3 x/2], Mod[x, 5], Mod[2 x, 5], Mod[x^2 + 2 x + 3, 7], JacobiDS[x, m], Sqrt[Cot[x]], Sin[ Pi x]^(1/3)};
 In:= Xperiods = compareDomains[#, x] & /@ funcs
 Out= Nicely format the results.

 Out//TraditionalForm= ## Mathematica

Questions? Comments? Contact a Wolfram expert »