On Fri, 19 Jun 2009, Stefan Meyer wrote:
< Hi,
<
< I'm new to Maxima and I wonder if I can write the
< define statement in a shorter way.
<
< This version works:
<
< (%i1) f(x):=x^2;
< (%o1) f(x):=x^2
< (%i3) define(f1(x),diff(f(x),x,1));
< (%o3) f1(x):=2*x
< (%i4) f1(1);
< (%o4) 2
<
< Instead of (%i3) I tried the following which caused
< an error:
<
< (%i10) g(x):=diff(f(x),x,1);
< (%o10) g(x):=diff(f(x),x,1)
< (%i11) g(1);
< diff: second argument must be a variable; found 1
< #0: g(x=1)
< -- an error. To debug this try debugmode(true);
See this thread:
http://www.math.utexas.edu/pipermail/maxima/2009/017562.html
Note that the Maxima email archive is searchable.
Leo
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.