maxima - rules and patterns



Robert Dodier wrote:
> On Mon, Mar 3, 2008 at 8:36 AM, Stavros Macrakis <macrakis at alum.mit.edu> wrote:
> 
>>  I must be missing something here.  Why is derivace sometimes linear
>>  and sometimes not?
> 
> Well, I think the goal is to reimplement the rules for derivatives,
> but under control of the user, so that only one rule is applied
> at a time.
> 
> A rule for linearity could also be constructed via defrule,
> in which case the declare(..., linear) and remove(..., linear)
> stuff isn't needed.
> 

defrule is in fact better, since this covers cases like 
derivace(x^2*a^2) which are not covered by declare(..., linear)

I use the following code for constant multiple rule:


freeofx (e) := freeof ('x, e);
notfreeofx (e) := not freeof ('x, e);
freeofx_not1 (e) := e # 1 and freeofx (e);
matchdeclare(a,notfreeofx,k,freeofx_not1);
defrule(c2, derivace(k*a), k*derivace(a));


The site with these calculations is (English is not yet available and I 
continue to improve the code) on 
http://user.mendelu.cz/marik/maw/index.php?lang=en&form=derivace

I hope, this will be useful for students.
Thank you again for all hints I got from this maillist.

Robert Marik


> Robert
>