On 6/18/10, Leo Butler <l.butler at ed.ac.uk> wrote:
> To make Tr commute with diff try:
>
> matchdeclare(FN,true,VV,mapatom,TR,lambda([t],featurep(t,linear)));
> tellsimpafter('diff(TR(FN),VV),TR(diff(FN,VV)));
>
> Then:
>
> diff(Tr(f(x)),x);
> diff(Tr(x^3+2*x*z),x);
>
> and:
>
> declare(Tr,linear);
> diff(Tr(f(x)),x);
> diff(Tr(x^3+2*x*z),x);
For the record, this works only with recent CVS versions of Maxima.
There was a bug in declare and/or featurep such that
declare(foo, linear); featurep(foo, linear); => false.
Now the declaration works as intended.
There are various ways to rework the solution.
Here's an idea:
declare (commutes_with_diff, feature);
declare (Tr, commutes_with_diff);
and then instead of featurep(t, linear), put featurep(t, commutes_with_diff).
commutes_with_diff should probably be built in, and
should probably be commutes_with(diff) ... just an idea.
best,
Robert Dodier