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
 
  
  
 