This brings up a question I have had for some time.
What are the differences (if any) among the following
g(x):= ''(diff(f(x),x));
g(u):= subst(x=u, diff(f(x),x));
g(u):= ev(diff(f(x),x), u = x);
TIA,
-sen
On Fri, 20 Jul 2007, Andrej Vodopivec wrote:
> You should change the definition of g(x) to g(x):=''(diff(f(x), x))
> (parenthesis are important).
>
> Andrej
>
> On 7/20/07, Moby <maxima at mobsternet.com> wrote:
>> After much googling and ogling various web sites, I believe I have
>> stumbled on a bug in Maxima having to do with evaluating functions that
>> are derivatives of other functions for given values of the independent
>> variable.
>>
>> Consider:
>>
>> (%i1) f(x):=sin(x);
>> (%o1) f(x):=sin(x)
>> (%i2) f(%pi);
>> (%o2) 0
>> (%i3) f(4*%pi);
>> (%o3) 0
>> (%i4) g(x):='' diff(f(x),x);
>> (%o4) g(x):=diff(f(x),x)
>> (%i5) g(x);
>> (%o5) cos(x)
>> (%i6) g(%pi);
>> (%o6) 0
>> (%i7) g(4*%pi);
>> Non-variable 2nd argument to diff:
>> 4*%pi
>> #0: g(x=4*%pi)
>> -- an error. To debug this try debugmode(true);
>>
>> I am not sure why g(%pi) evaluates fine, but g(4*%pi) does not. I know
>> my syntax for specifying 4 pi is correct, since the same works for
>> evaluating f(x) at 4 pi.
>>
>> Any help in determining why this does not work, and how to get it work,
>> would be much appreciated.
>>
>> --Moby
>> _______________________________________________
>> Maxima mailing list
>> Maxima at math.utexas.edu
>> http://www.math.utexas.edu/mailman/listinfo/maxima
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
--
---------------------------------------------------------------------------
| Sheldon E. Newhouse | e-mail: sen1 at math.msu.edu |
| Mathematics Department | |
| Michigan State University | telephone: 517-355-9684 |
| E. Lansing, MI 48824-1027 USA | FAX: 517-432-1562 |
---------------------------------------------------------------------------