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 
<http://stackoverflow.com/questions/32087945/distribute-derivative-of-sum-with-constant-term-after-substitution>
) 

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/5af9f0fb-6d04-46fc-9f05-b4d9c6fee3d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to