Even and Odd Parts of a Function

Every function has an even and odd part, defined as follows.

The even part of f(x), denoted fe, is given by
fe(x)=1/2 [f(x)+f(-x)].

The odd part of f(x), denoted fo, is given by
fo(x)=1/2 [f(x)-f(-x)].

It is trivial, but you should check anyway, that fe is indeed even and fo is indeed odd.

Let's investigate.


  Clear[p1,p2,p3,p4,f]
  f[x_]:=x^2+x^3
  p1=Plot[f[x],{x,-4,4}];


  fe[x_]:=(1/2) (f[x]+f[-x])
  fo[x_]:=(1/2) (f[x]-f[-x])
  fe[x]
  fo[x]

Well, that should come as NO surprise.


  Clear[f,fe,fo]
  f[x_]:=Exp[x]
  Plot[f[x],{x,-4,4}];


  fe[x_]:=(1/2) (f[x]+f[-x])
  fo[x_]:=(1/2) (f[x]-f[-x])
  fe[x]
  fo[x]


  Plot[fe[x],{x,-4,4}];


  Plot[fo[x],{x,-4,4}];


  Plot[fe[x]+fo[x],{x,-4,4}];

When calculating Fourier series, the even part of the function yields the cosine terms and the odd part of the function yields the sine terms.

Up to Even and Odd Functions and More