ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 09 Oct 2011 16:50:44 +0200collect multiple variables and simplify their coefficientshttps://ask.sagemath.org/question/8369/collect-multiple-variables-and-simplify-their-coefficients/Hi there!
In Mathematica you can do the following: Collect[expr, {var1, var2, var3}, Simplify]
This transforms
expr = var1*expr11 + var2*expr22 + var1*var2*expr12 + ...
to
var1*Simplify[expr11] + var2*Simplify[expr22] + var1*var2*Simplify[expr12] + ...
I was wondering if there is an easy way to do this in Sage.
So my questions are:
1) How can you collect multiple variables?
2) How can you manipulate their coefficients? (each coefficient is independent)
3*) How can you print the result in a pretty way? (e.g. collecting the expression by coefficients and printing each term in a new line)
Thanks for your help!
nablaoperatorSun, 09 Oct 2011 16:50:44 +0200https://ask.sagemath.org/question/8369/