Here follows a transcript of a Maple 6 session on a PC:
> D[1](f); D[2](f); D[1](f) D[2](f) > D[1](exp@f); (exp@f) D[1](f) > D[2](exp@f); Error, (in D/exp) invalid arguments
My question is: what is wrong with the last statement?
It’s a bug, and still present in Maple 8. A work-around is
> g:= (s,t) -> exp(f(s,t)); D[2](g);
D[n]
refers to nth argument, not nth derivative e.g.:
> D[1](exp); exp > D[1](x->x^2); x -> 2 x > D[2]](exp); Error, (in D/exp) invalid arguments > D[2](x->x^2); Error, (in D/procedure) index out of range: function takes only 1 arguments > D[1]((x,y)->x^2+y^2); (x, y) -> 2 x > D[2]((x,y)->x^2+y^2); (x, y) -> 2 y > > D[1](D[1](exp)); exp > D[1](D[2]((x,y)->x^2*y^2)); (x, y) -> 4 x y
It looks to me like a bug arising from
> D[2](f@g); (D[2](f)@g)*D[2](g)
Surely, by definition, it should deliver the result (D[1](f)@g)*D[2](g)
when f is a function
of one variable (as with exp in your case).
In addition, I see that the same error arises when the variables are explicitly shown in
> D[2]((x,y)->(exp@f)(x,y));