MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

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


  • Prev by Date: Re: Can't make function periodic for t<0
  • Next by Date: Re: Can Mathematica construct a set of equations?
  • Previous by thread: FixedPoint[Cos, 1.0]
  • Next by thread: Re: Strange result with FindShortestPath and Tuple