This ```return x not in coeff.free_symbol``` creates problem when coeff is Integer.
This works fine
```
if x in coeff.free_symbols:
    return False
return True
```