# 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

```
-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

```
(-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