"Thomas D. Dean" <tomdean at speakeasy.org> writes:
> I spent a lot of time on "Prove every function with domain R can be
> written as the sum of an even function and an odd function." Can not
> nail down the case where f is neither even or odd.
I think the trick goes as follows. Suppose that f: R ? R. Then define
o(x) = (f(x) - f(-x))/2
Note that o(-x) = (f(-x) - f(x))/2 = -(f(x) - f(-x))/2 = -o(x) so o(x)
is odd. Now define
e(x) = (f(x) + f(-x))/2
which is clearly even. Summing them, you get
o(x) + e(x) = f(x)
as required: we've expressed f as a sum of an even and an odd function.
The following makes Maxima understand it:
/* Define o and e */
(%i1) o(x) := (f(x) - f(-x))/2$
(%i2) e(x) := (f(x) + f(-x))/2$
/* Check they sum to f */
(%i3) o(x) + e(x);
f(x) + f(- x) f(x) - f(- x)
(%o3) ------------- + -------------
2 2
(%i4) expand(%);
(%o4) f(x)
/* o is odd? */
(%i5) o(x) - (-o(-x));
f(x) - f(- x) f(- x) - f(x)
(%o5) ------------- + -------------
2 2
(%i6) expand(%);
(%o6) 0
/* e is odd? */
(%i7) e(x) - (e(-x));
(%o7) 0
If f was odd already, then f(x) = -f(-x), so e(x) is identically
zero. Similarly, if f was even already then f(x)=f(-x), so o(x) is
identically zero. Note that we've just proven that any function that is
both even and odd is identically zero (in a very roundabout fashion!)
Maxima can see that too:
(%i11) declare (f, evenfun);
(%o11) done
(%i12) e(x);
(%o12) f(x)
(%i13) o(x);
(%o13) 0
(%i14) remove (f, evenfun);
(%o14) done
(%i15) declare (f, oddfun);
(%o15) done
(%i16) o(x);
(%o16) f(x)
(%i17) e(x);
(%o17) 0
But the identically zero bit fails:
(%i18) declare (f, evenfun);
declare: inconsistent declaration declare(f,evenfun)
-- an error. To debug this try: debugmode(true);
Oops!
Hope this is of some use,
Rupert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 315 bytes
Desc: not available
URL: <http://www.math.utexas.edu/pipermail/maxima/attachments/20130325/1b11ff65/attachment.pgp>