maxima - rules and patterns



Dear users of maxima

I solve the following problem: I wish to write tools which enable to
differentiate expresions in simple single steps, something like
www.calc101.com

My problems are:

First problem:
--------------
write a function diffsin(expr) which scans the epxression expr for
strings derivative(sin(....)) and has the following output

diffsin(2*sin(x)+derivative(sin(x)) + derivative(sin(x^2)))
=
2*sin(x)+cos(x)+cos(x^2)*derivative(x^2)

and similar functions for the other basic elementary functions and for
product, quotient and addition

for example I wish to define function diffproduct with the following output
diffproduct(1+x^7*sin(x)+derivative(x^2*cos(x)))
=1+x^7*sin(x)+derivative(x^2)*cos(x)+x^2*derivative(cos(x))

I know that the quotient is treated as product in maxima, but I hope
to solve this problem somehow (with simp:false?)

User will choose one step in diferentiation and Maxima will do the
computations. Something similar to
http://user.mendelu.cz/marik/maw/index.php?lang=en&form=integral
(not yet translated into english, sorry)

Second problem:
---------------

given the expression, find the rule which has to be used as the first,
second, ..... and apply them to get a result similar to
http://calc101.com/webMathematica/derivatives.jsp



I looked into the maxima manual and I have seen that there are
powerfull tools for this in maxima, but I am confused, which of the
function should I use. I started my attemtps with

defrule(diffsum,derivative(a+b),derivative(a)+derivative(b));

but

diffsum(x+sin(x))

returns false :(

Can you give me a few pointers and tips to the following?

1. which commnds to use to solve my problems, defrule, defmatch, 
tellsimp, let?
2. which literature and which examples to study?
3. is there allready a similar package somewhere on the Internet?
4. what is wrong in my example?


Thank you very much

Robert Marik