Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: Assuming odd/even functions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg98670] Re: [mg98634] Assuming odd/even functions
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Thu, 16 Apr 2009 04:12:06 -0400 (EDT)
  • Reply-to: hanlonr at cox.net

Use UpValues

Clear[f];

f /: f[a_] + f[-a_] = 0 ;

f[x] + f[-x]

0

f[-x] + f[x]

0

This isn't robust

f[x^2 - 3 x + 2] + f[-x^2 + 3 x - 2]

f[-x^2 + 3*x - 2] + f[x^2 - 3*x + 2]

However, you can help it along

Simplify[
 f[x^2 - 3 x + 2] + f[-x^2 + 3 x - 2],
 x^2 - 3 x + 2 == t]

0

f /: Integrate[f[x_], {x_, -a_, a_}] = 0;

Integrate[f[y], {y, -z, z}]

0

However,

Integrate[f[y], {y, z, -z}]

Integrate[f[y], {y, z, -z}]

Add another UpValue

f /: Integrate[f[x_], {x_, a_, -a_}] = 0;

Integrate[f[y], {y, z, -z}]

0

Again, not robust

Integrate[f[y], {y, x^2 - 3, -x^2 + 3}]

Integrate[f[y], {y, x^2 - 3,
     3 - x^2}]

But as before

Simplify[
 Integrate[f[y], {y, x^2 - 3, -x^2 + 3}],
 x^2 - 3 == t]

0


Bob Hanlon

---- "Martin Sch=C3=B6necker" <ms_usenet at gmx.de> wrote:

=============
How can we give Mathematica the information of a function being odd or even=
, and have it applied automatically or in a Simplify[]?

Such that, if e.g. f[y] is odd, the sum f(a)+f(-a) yields zero, the
integral Integrate[f[y], {y, -a, a}] vanishes?

--Martin



  • Prev by Date: Re: Plotting a x,y,z function
  • Next by Date: Re: How to find current ViewAngle, ViewPoint during Rotating graphics?
  • Previous by thread: Re: Assuming odd/even functions
  • Next by thread: problem with replace all and functions