Inconsistency when using previously defined variables as arguments to functions
Subject: Inconsistency when using previously defined variables as arguments to functions
From: Leo Butler
Date: Sun, 30 Jan 2011 16:46:15 +0000 (GMT)
On Sun, 30 Jan 2011, Ilya Ryabinkin wrote:
< A similar issue would appear if you try to define a differential
< operator that transforms a function into its derivative. I spent a lot
< of time figuring out how it could be done; the only working way I
< found was quite an awkward construction
< D(f):=
< funmake('lambda,
< [['x], diff(f('x),'x)]);
< Again, this happened because you have to perform differentiation with
< respect to a formal argument, not a variable "x".
This solution is not foolproof:
D(lambda([t],x+t));
==> lambda([x], 2)
The foolproof solution would use a gensym, but the answers would not
look so nice.
The problem is that mathematical functions are really 2nd class objects
in Maxima.
Leo
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.