On 2/25/08, Robert Marik <marik at mendelu.cz> wrote:
> defrule(diffsum,derivative(a+b),derivative(a)+derivative(b));
To make this work as intended, it might be something like
the following (this might work to some extent).
matchdeclare (xx, lambda ([e], e # 0));
matchdeclare (yy, lambda ([e], e = 0));
matchdeclare (zz, all);
defrule (r1, mydiff (xx + yy, zz), mydiff_sum (xx, zz));
which probably seems a little mysterious, as it exploits the
idosyncrasies of Maxima's pattern-matching code ...
mydiff_sum is something like this (again, dunno if this works).
mydiff_sum (expr, x) := (buildq ([x], lambda ([e], mydiff (e, x))),
map (%%, expr));
If you post the rules you want to implement, in some non-Maxima
notation, I can help you translate them (or I'll try, anyway)
into Maxima rules.
best
Robert Dodier