This thread now contains some examples of how different computer
algebra systems handle the chain rule. The following might help in
sage <-> maxima communication:

By default, maxima leaves an expression: "diff(  f(g(a,b,c),u,v), a)"
untouched. But maxima can in fact represent the result from applying
the chain rule to this expression using its "at" function:

 at( diff (f (x1,x2,x3),x1), [x1=g(a,b,c),x2=u,x3=v])*diff(g
(a,b,c),a);

Using this trick, it should be pretty straightforward to encode sage's
"D" notation into something that is at least valid maxima syntax. The
only problem is guessing how many formal parameters are needed, but by
the time a "D[i](f)" is encountered as an operator, its "operands"
list should be known. Alternatively, many symbolic variables declare
how many variables they expect.

Parsing it back might be a little more elaborate, but if all else
fails, we can do that via generic subexpression substitution.

Given that we'll have to have a routine that parses "D[i]"
differential expressions into "diff and at" expressions to communicate
with maxima, we could use that same routine to produce a latex
representation as well. Maxima's 2d prettyprinter tries it, with mixed
results. The main difficulty for printing would be to come up with
reasonable names for the intermediate variables (note that the
x1,x2,x3 above had to be invented).

This would give a route that is slightly different from the route
proposed in the patch 6756. It would only affect the printing of
differential expressions and not add an alternative internal
representation of derivatives.

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to