You should be careful defining a symbol. If anything, you should probably use a Dummy. But I don't think you need to do a substitution in most cases. You'll need to if you do an `integrate`, you'll need to substitute a dummy, but you should be able to differentiate w.r.t. `f(x)`.