On Tue, 27 Mar 2012 at 11:21PM -0700, Eric Kangas wrote: > I have this long chain of terms with with many constant terms. I would like > to know if there is a way to separate the constant terms from the terms > with the variable I am trying to solve for with the solve function. So I > don't have to wait as long for the solve function to go through each > non-relevant term.
Some kind of .coeffs() call should work: sage: x,y,z = var('x y z') sage: foo = x*2*y + x*y*z + y*z + z + 1 sage: foo.coeffs(x) [[y*z + z + 1, 0], [y*z + 2*y, 1]] If y and z are constants, then the ", 0" element of the list (coefficient of x^0) is the constant coefficient of "foo". Dan -- --- Dan Drake ----- http://mathsci.kaist.ac.kr/~drake -------
signature.asc
Description: Digital signature