evaluations of derivative functions



On Wed, 2007-03-21 at 06:28 -0500, Barton Willis wrote:
> >To: maxima at math.utexas.edu
> >From: sen1 at math.msu.edu
> >Sent by: maxima-bounces at math.utexas.edu
> >Date: 03/21/2007 05:48AM
> >Subject: evaluations of derivative functions
> >
> 
> >... Is there a better way to do this?
> 
> Yes, there is a better way. When you define your function f, you need
> to tell Maxima to evaluate the function body. To do this, use two
> single quotes:
> 
> (%i1) f(x):= x^2$
> (%i2) g(x):= ''(diff(f(x),x))$
> (%i3) g(2);
> (%o3) 4
> 
> Notice: You need ''(diff(f(x),x)) *not* ''diff(f(x),x).

A third way, which I like the most, is:

(%i1) f(x):= x^2$
(%i2) define(g(x), diff(f(x),x));
(%o2) g(x) := 2 x
(%i3) g(2);
(%o3) 4

When using functions to define other functions, one might always want to
use "define" instead of ":=".
Regards,
Jaime Villate