Assigning a variable directly does not modify expressions that used the variable retroactively. >>> from sympy import Symbol >>> x = Symbol('x') >>> y = Symbol('y') >>> f = x + y >>> x = 0 >>> f x + y Continue reading...