Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #2824 > unrolled thread

Even and Odd functions

Started byyitzhakbg <yitzhakbg@gmail.com>
First post2011-05-31 11:48 +0000
Last post2011-05-31 11:48 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Even and Odd functions yitzhakbg <yitzhakbg@gmail.com> - 2011-05-31 11:48 +0000

#2824 — Even and Odd functions

Fromyitzhakbg <yitzhakbg@gmail.com>
Date2011-05-31 11:48 +0000
SubjectEven and Odd functions
Message-ID<is2ki5$qqa$1@smc.vnet.net>
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

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web