Ask Your Question

Revision history [back]

in the symbolic ring you can do:

sage: var('y1, t1');
sage: (y1-t1).mul(2/3, hold=true)
2/3*(-t1 + y1)

i'm afraid there's no easy out-of-the-box way to tune the exact order in which the expressions are displayed. of course, sage provides all functions needed to get the information, such as variables(), coefficients(), and so on.

moreover, it becomes less clear what would such a function do. what if the expression involves more than two terms? lexicographic order is provided in a polynomial ring, an answer which has been given elsewhere by dan_fulea.

hope that helps!