On Thursday, September 3, 2015 at 9:18:35 AM UTC+2, Kalevi Suominen wrote:
>
>
>
> On Thursday, September 3, 2015 at 8:54:54 AM UTC+3, Carl Sandrock wrote:
>>
>> 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).
>>
>>
>> Perhaps you could use ``doit()``` instead of ``simplify()``. 
>
>>  
>>
>>
That worked perfectly, thank you very much! 

-- 
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 [email protected].
To post to this group, send email to [email protected].
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/277b4b41-0a68-41a2-8c39-74c95461d99e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to