Examples

In[16]:=
  Clear[f]
  f[x_]:=x^3-3x^2-7x+5

In[17]:=

  p1=Plot[f[x],{x,-4,4}];

In[18]:=

  evenpart[f_,x_]:=1/2(f[x]+f[-x]);
  oddpart[f_,x_]:=1/2(f[x]-f[-x]);

In[19]:=

  f[x]
  Simplify[evenpart[f,x]]
  Simplify[oddpart[f,x]]

Out[19]=

               2    3
  5 - 7 x - 3 x  + x

Out[20]=

         2
  5 - 3 x

Out[21]=

           2
  x (-7 + x )

In[22]:=

  p2=Plot[evenpart[f,x],{x,-4,4}];

In[23]:=

  p3=Plot[oddpart[f,x],{x,-4,4}];

In[24]:=

  Show[p1,p2,p3];

If your function is already even, the odd part is 0. If the function is already odd, the even part is 0.

In[25]:=

  g[x_]:=Sin[x]

In[26]:=

  evenpart[g,x]
  oddpart[g,x]

Out[26]=

  0

Out[27]=

  Sin[x]

In[28]:=

  h[x_]:=Cos[x]

In[29]:=

  evenpart[h,x]
  oddpart[h,x]

Out[29]=

  Cos[x]

Out[30]=

  0

Up to Even and Odd Parts