Basic problem with differentiation and Maxima syntax
Subject: Basic problem with differentiation and Maxima syntax
From: Jaime Villate
Date: Mon, 26 Jul 2010 17:16:34 +0100
On Mon, 2010-07-26 at 17:56 +0200, Julien Martin wrote:
> "f'"(%theta):=diff(%,%theta,1);
> "f'"(%theta);
> "f'"(0);
>
> Here is what I got:
> *************************
> diff: second argument must be a variable; found 0
> #0: f\'(%theta=0)
> -- an error. To debug this try: debugmode(true);
> *************************
>
> Any idea why this did not work? I just want to know the value of the
> function when %theta=0...
Because := does not compute its arguments; that means that the
derivative will not be calculated when you define "f" but only when you
attempt to calculate "f"(0).
Use "define" which is similar to := but it computes its argument:
define( f(%theta), diff(%,%theta) );
Regards,
Jaime