If I do
import sympy
k, V, Vprime = sympy.symbols('k, V, Vprime')
print sympy.diff(k + V(t), t)I get Derivative(V(t), t) as I expect - the derivative distributes and the constant term has zero derivative.
However, if I construct an equivalent expression via substitution, simplify does not distribute the derivative. How can I get the same result via substitution as when I evaluate the expression directly?
sympy.diff(Vprime(t)).subs({Vprime(t): k + V(t)}).simplify()returns Derivative(k + V(t), t).
(also posted on Stackoverflow)