# [Maxima] Commutation with derivatives

Gianluca Malato gianluca.malato at gmail.com
Fri Jun 18 14:27:29 CDT 2010

```I've found a way to make it work.

matchdeclare(foo,true,vv,atom);
tellsimpafter('diff(Tr(foo),vv),Tr(diff(foo,vv)));
declare(Tr,linear)

diff(Tr(x*y),x) ==> Tr(y)

Thanks very much for help.

2010/6/18 Leo Butler <l.butler at ed.ac.uk>

>
>
> On Fri, 18 Jun 2010, Gianluca Malato wrote:
>
> < Hi all! I need to define a function named Tr(x) which is linear and I
> want it
> < to commute with derivative. For example, if I write diff(Tr(f(x)),x) I
> want
> < maxima to perform Tr(diff(f(x),x)). This must be done without using an
> < explicit defintion of the Tr function, but leaving it symbolic. I tried
> to
> < give the command assume(Tr,linear), but it doesn't work fine.
> <
> < Anyone knows how to solve this problem?
>
> 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);
>
> should return (un)simplified expressions.
>
> Leo
>
> --
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.
>
>

--
Gianluca Malato
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.math.utexas.edu/pipermail/maxima/attachments/20100618/4a5df2ae/attachment.html>
```