Hi Jurgis,
> could smb point me how to access the formula parse tree.
> what I really want, is to make derivative exercise tool.
> which would do the differentiation of (complex) formulas step by step.
The Maxima parser parses ordinary math expressions
into Lisp (prefix) expressions, which are essentially the
same thing as the "abstract syntax tree" in other systems.
E.g. sin(x) + cos(y) => ((MPLUS) ((%SIN) $X) ((%COS) $Y))
See http://maxima.cvs.sourceforge.net/maxima/maxima/src/nparse.lisp
for the parsing code. See
http://maxima.sourceforge.net/wiki/index.php/Maxima%20internals
and
http://maxima.sourceforge.net/wiki/index.php/outline%20of%20Maxima%20internals
for info about the parsed expressions.
Maxima already has code to carry out symbolic differentiation,
which is invoked by diff(<expr>, x); at the input prompt.
It turns out that the harder part is cleaning up the result so
that it conforms to conventional notations, like replacing 1 + 1 by 2.
In Maxima applying identities to transform an expression is
called "simplification". Maxima has a lot of simplifications but
it is more or less impossible to get Maxima to print stuff step by step.
If you want to implement your own step by step differentiation
code, that seems feasible. Your code could take a step,
then you can call the Maxima simplifier, then another step,
then simplify ... etc.
I'll let that be enough for now -- maybe you can say more about
what you're trying to accomplish.
All the best,
Robert Dodier