Periodic Functions

Defining Periodic Functions in Mathematica

Period of p on (0,p)

p=2
g[x_]=(x^2)
f[x_]:=g[x-p*Floor[(x/p)]]
Plot[f[x],{x,-5,5},AxesOrigin->{0,0}]

(∫_0^p)f[x]\[DifferentialD]x
(∫_(14234/100)^(14234/100+p))f[x]\[DifferentialD]x

Period of 2p on (-p,p)

p=2
g[x_]=(x^2)
f[x_]:=g[x-2p*Floor[((x+p)/(2p))]]
Plot[f[x],{x,-5,5},AxesOrigin->{0,0}]

(∫_(-p)^p)f[x]\[DifferentialD]x
(∫_(14234/100-p)^(14234/100+p))f[x]\[DifferentialD]x