Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Is there a command or a way in SageMath to collect more than one common variable in an equation? without specifying those common variable or write them manually

Is there a command or a way in SageMath to collect more than one common variable in an equation without specifying those common variable or write them manually, for example I want the following equation -36betatexp(-4betat) +14exp(-4betat)-12betatexp(-6betat) -18exp(-6betat)+5
to be written like this
(-36betat+14)exp(-4betat) +(-12betat-18)exp(-6betat)+5 I do not to specify the common variables since the code I am running is iteration so I do not know the values what will be

Is there a command or a way in SageMath to collect more than one common variable in an equation? without specifying those common variable or write them manually

Is there a command or a way in SageMath to collect more than one common variable in an equation without specifying those common variable or write them manually, for example I want the following equation -36betatexp(-4betat) +14exp(-4betat)-12betatexp(-6betat) -18exp(-6betat)+5
equation

-36*beta*t*exp(-4*beta*t) +14*exp(-4*beta*t)-12*beta*t*exp(-6*beta*t) -18*exp(-6*beta*t)+5

to be written like this

(-36betat+14)exp(-4betat) +(-12betat-18)exp(-6betat)+5
(-36*beta*t+14)*exp(-4*beta*t) +(-12*beta*t-18)*exp(-6*beta*t)+5

I do not to specify the common variables since the code I am running is iteration so I do not know the values what will be