On Thu, 18 Jun 2009, Holger Schulz wrote:
< I want to make the derivate of a function a function itself. Naively i
< tried
<
< f(x):=-2*x^3+3*x^2+12*x-13;
<
< and
<
< f1(x):=diff(f(x),x);
<
< which did not work:
<
< (%i16) f1(1);
< diff: second argument must be a variable; found 1
< #0: f1(x=1)
< -- an error. To debug this try debugmode(true);
(%i20) f(x):=x^4$
(%i21) diff(f(x),x);
(%o21) 4*x^3
(%i22) fp(t):=subst(x=t,''%);
(%o22) fp(t):=subst(x = t,4*x^3)
(%i23) fp(t);
(%o23) 4*t^3
Leo
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.