({{, (RefLink[FunctionPeriod, paclet:ref/FunctionPeriod])[f,x] 
gives a period p of the function f over the reals such that f(x+p)==f(x).}, {, (RefLink[FunctionPeriod, paclet:ref/FunctionPeriod])[f,x,dom]
gives a period with x restricted to the domain dom.}, {, (RefLink[FunctionPeriod, paclet:ref/FunctionPeriod])[{(Subscript[f, 1]),(Subscript[f, 2]),…},{(Subscript[x, 1]),(Subscript[x, 2]),…},…]
gives periods {(Subscript[p, 1]),(Subscript[p, 2]),…} for {(Subscript[x, 1]),(Subscript[x, 2]),…} such that f((Subscript[x, 1])+(Subscript[p, 1]),(Subscript[x, 2])+(Subscript[p, 2]),…)==f((Subscript[x, 1]),(Subscript[x, 2]),…).}})

OpenersNotesSection(Spacer1)Details

A period p is taken to be zero if no period can be found.

Possible domains dom are (RefLink[Reals, paclet:ref/Reals]), (RefLink[Integers, paclet:ref/Integers]), and (RefLink[Complexes, paclet:ref/Complexes]).

Periods over the (RefLink[Complexes, paclet:ref/Complexes]) are given in a list and can consist of one or two complex periods.

OpenersPrimaryExamplesSection(Spacer1)Examples  (12)

OpenersExampleSection0(Spacer1)Basic Examples  (3)

Find a period of the sine function:

FunctionPeriod[Sin[x],x]

Plot of two complete periods:

Plot[Sin[x],{x,-2Pi,2Pi},Ticks->{{-2Pi,-Pi,0,Pi,2Pi},{-1,1}}]

Find a period of a sequence:

FunctionPeriod[Mod[n,8],n,Integers]

Plot the sequence:

DiscretePlot[Mod[n,8],{n,0,15}]

Find periods for multidimensional functions:

FunctionPeriod[Cos[x]+Sin[y],{x,y}]

Plot the contours:

ContourPlot[Cos[x]+Sin[y],{x,-2Pi,2Pi},{y,-2Pi,2Pi}]

OpenersExampleSection1(Spacer1)Scope  (9)

OpenersExampleSubsection0(Spacer1)Basic Uses  (4)

Find periods over integers:

FunctionPeriod[(-1)^n,n,Integers]

FunctionPeriod[Sin[n 2π/17+3],n,Integers]

FunctionPeriod[Mod[2n,18],n,Integers]

Table[DiscretePlot[f,{n,35},PlotLabel->f,PlotTheme->"Minimal"],{f,{(-1)^n,Sin[n 2π/17+3],Mod[2n,18]}}]

Find periods over reals:

FunctionPeriod[Sin[x],x,Reals]

FunctionPeriod[Tan[x],x,Reals]

FunctionPeriod[SquareWave[x],x,Reals]

Table[Plot[f,{x,0,4π},PlotLabel->f,PlotTheme->"Minimal",Exclusions->None],{f,{Sin[x],Tan[x],SquareWave[x]}}]

Find periods over complexes:

FunctionPeriod[Exp[z],z,Complexes]

FunctionPeriod[Cosh[z],z,Complexes]

FunctionPeriod[JacobiCD[z/2,2],z,Complexes]

Table[Plot3D[Re[f],{x,-4π,4π},{y,-4π,4π},PlotLabel->Re[f],PlotTheme->"Minimal"],{f,{Exp[x+I y],Cosh[x+I y],JacobiCD[(x+I y)/2,2]}}]

Periods of functions with parameters:

Assuming[a > 0,FunctionPeriod[Sin[a x],x]]

Plot[{Sin[x],Sin[x/2],Sin[x/3]},{x,0,6Pi},PlotLegends-> "Expressions"]

OpenersExampleSubsection1(Spacer1)Periodic Functions over the Integers  (5)

Basic periodic sequences include (RefLink[Mod, paclet:ref/Mod]):

p=FunctionPeriod[Mod[n/2+7,11],n,Integers]

DiscretePlot[Mod[n/2+7,11],{n,3p}]

(RefLink[Mod, paclet:ref/Mod]) of a polynomial:

p=FunctionPeriod[Mod[(n^3)+7(n^2)+3,11],n,Integers]

DiscretePlot[Mod[(n^3)+7(n^2)+3,11],{n,5p}]

The function (((-1))^n):

FunctionPeriod[(((-1))^n),n,Integers]

And in general powers of roots of unity, i.e. roots of the polynomial (x^k)==1:

Solve[(x^7)==1,x]

FunctionPeriod[Power[(((-1))^(2/7)),n],n,Integers]

Table[DiscretePlot[f,{n,20},PlotTheme->"Minimal"],{f,{Re[Power[(((-1))^(2/7)),n]],Im[Power[(((-1))^(2/7)),n]]}}]

A common way to express these are exp(2 π i/k):

FunctionPeriod[Exp[n 2π I/7],n,Integers]

Trigonometric functions with a rational multiple of their real period:

trigs={Sin[n 2π/10],Cos[n 2π/10],Csc[n 2π/10+1],Sec[n 2π/10+1],Tan[n  π/10+1],Cot[n π/10+1]};

FunctionPeriod[#,n]&/@trigs

Table[DiscretePlot[f,{n,30},PlotTheme->"Minimal"],{f,trigs}]

A function f(n r τ+b) where f(x) is periodic over the reals with period τ and r rational:

τ=FunctionPeriod[TriangleWave[x/2],x,Reals]

FunctionPeriod[TriangleWave[n/2 1/5],n,Integers]

DiscretePlot[TriangleWave[n/2 1/5],{n,30}]

It works similarly for a function periodic over the complexes:

τ=FunctionPeriod[Cosh[x],x,Complexes]

FunctionPeriod[Cosh[n 2π I/10],n,Integers]

DiscretePlot[Re[Cosh[n 2π I/10]],{n,30}]

Any finite sum of periodic sequences is periodic:

FunctionPeriod[Mod[n,3]+3 Sin[n 2π/5],n,Integers]

DiscretePlot[Mod[n,3]+3 Sin[n 2π/5],{n,60}]

Any finite product of periodic sequences is periodic:

FunctionPeriod[Mod[n,3]3 ((Sin[n 2π/5])^2),n,Integers]

DiscretePlot[Mod[n,3]3 ((Sin[n 2π/5])^2),{n,60}]

Any function combination F((Subscript[f, 1])(n),…,(Subscript[f, k])(n)) of periodic sequences is periodic:

FunctionPeriod[((Mod[n,3])^2)(Sin[n 2π/5]+Cos[n 2π/3])+Mod[n^2,4],n,Integers]

DiscretePlot[((Mod[n,3])^2)(Sin[n 2π/5]+Cos[n 2π/3])+Mod[n^2,4],{n,300},PlotRange->All]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[FunctionDomain, paclet:ref/FunctionDomain])  ▪  (RefLink[FunctionRange, paclet:ref/FunctionRange])  ▪  (RefLink[DifferenceDelta, paclet:ref/DifferenceDelta])  ▪  (RefLink[Differences, paclet:ref/Differences])  ▪  (RefLink[FourierSeries, paclet:ref/FourierSeries])  ▪  (RefLink[FindRepeat, paclet:ref/FindRepeat])  ▪  (RefLink[FindTransientRepeat, paclet:ref/FindTransientRepeat])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Calculus, paclet:guide/Calculus])}})}})