No, I meant it as I said since if your match remains an Add then what you have written will throw away additive constants. And it might be better to write

```
u = match[b] = factor_terms(match[b])
if u.is_Mul:
    u = u.as_independent(f(x))[1]
```

This will guarantee that you can actually remove the f(x)-independent term by division.