maxima - rules and patterns



Many thanks to both Robert Dodier and Richard Fateman for their 
suggestions. I very appreciate the help from maxima discucssion list.

I tried something like freeofx (e) := freeof ('x, e); but this was not 
working for me die to the missing quotation mark at x.


Robert Dodier wrote:
>>  It remains to solve this problem (it is not possible to use parameters or
>> functions in more variables)
> 
> Not sure what you mean here.
> 

Sorry that I was unclear, my english is still poor.
I meant exactly the freeofx property - it was not possible to use more 
variables  or parameters, since for example y was not recognized as 
constant. With this fix it works.

I'll try to follow the hints how to reduce the length of the code, but I 
wish to get info which rule has been applied and how - this is the 
reason for many print commands. But I'll try to improve it.

I have one another (but closely related) question: I wish to define a 
function trylinear(expr) which expands all subexpressions of expr of the 
type derivace(a*x+b) into a*derivace(x)+b and keeps for example 
derivace(x^2) intact. I tried the following code

trylinear(expr):=
(declare(derivace,linear),expr:''expr, remove(derivace,linear),expr)

with several modifications (define instead of :=, '' on various places, 
block and ev command) but I was not able to get expected results. Is 
there any way to define the function trylinear to get required behavior?

Many thanks
Robert Marik