Even and Odd functions
- To: mathgroup at smc.vnet.net
- Subject: [mg119346] Even and Odd functions
- From: yitzhakbg <yitzhakbg at gmail.com>
- Date: Tue, 31 May 2011 07:48:05 -0400 (EDT)
- Reply-to: comp.soft-sys.math.mathematica at googlegroups.com
Applying makeper makes the piecewise functions x and y periodic, yet they don't appear as even and odd functions whereas the Sin and Cos functions do show as odd and even. xx and yy are the functions which fail the even/odd test yet show as even and odd according to the plots. I couldn't determine why. Help appreciated. ClearAll[x, y, xx, yy, makeper] x[t_] := Piecewise[{{-1, -1/2 <= t < 0}, {1, 0 <= t < 1/2}}] y[t_] := Piecewise[{{-t - 1/4, -1/2 <= t < 0}, {t - 1/4, 0 <= t < 1/2}}] makeper[f_, p_, d_][t_] := f[Mod[t, p, d]] (* Plot[x@t,{t,-5,5},PlotRange->{-1,1}] *) xx[t_] := makeper[x, 1, -1/2]@t yy[t_] := makeper[y, 1, -1/2]@t Plot[xx[t], {t, -5, 5}, PlotRange -> {-1, 1}] Plot[yy[t], {t, -5, 5}, PlotRange -> {-1, 1}] OddFunctionQ[f_] := Module[{x}, f[x] + f[-x] === 0] EvenFunctionQ[f_] := Module[{x}, f[x] - f[-x] === 0] fs = {# &, #^3 &, Sin, Cos, xx, yy} OddFunctionQ /@ fs {True, True, True, False, False, False} EvenFunctionQ /@ fs {False, False, False, True, False, False} Best, Yitzhak