The usual way to define diff by rules is to look at main operation and
key off that.
e.g.
if constant then 0
if var of integration then 1
if other var then 0
if main op is + then sum diff operating on pieces
if main op is * then do product rule
if main op is sin then ..
if main op is exp then ..
etc
You can do this directly in a bare lisp in very little
space.
http://www.cs.berkeley.edu/~fateman/papers/deriv.pdf
Frank Thieme wrote:
> ok, my question was a part of a homework. And I'm still fighting with
> maxima.
>
> Question is to reimplement differentiation via rules. The simple part
> was to make a function which does n*x^m -> n*m*x^(m-1)
> Now we should do this to polynoms. I defined a rule:
>
> defrule(ablrule0, abl(p,x),
> sum(part(map(lambda([p],abl(p,x)),makelist(part(p,i),i,1,length(p))),j),j,1,length(p)));
>
> The sum() part works really good, but I can't bring maxima to apply this
> rule. How can I do this?
>
> abl(x^5+2*x,x) should become a abl(x^5,x)+abl(2*x,x) because of that
> rule.
>
> Any hints?
>
> Bye...Frank
>
> _______________________________________________
> Maxima mailing list
> Maxima@www.math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima