Simple example of multivariate chain rule:
print(Function('g')(Function('f')(x1,x2)).diff(x1))

Gives the expected:

[image: diff1.PNG]

Derivative(f(x1, x2), x1)*Derivative(g(f(x1, x2)), f(x1, x2))


Adding another function h:

print(Function('g')(Function('f')(x1,x2),Function('h')(x1,x2)).diff(x1))

Gives the expected answer but with extra _xi_1 and _xi_2 symbols: 

[image: diff.PNG] <about:invalid#zClosurez>

Derivative(f(x1, x2), x1)*Subs(Derivative(g(_xi_1, h(x1, x2)), _xi_1), _xi_1, 
f(x1, x2)) + Derivative(h(x1, x2), x1)*Subs(Derivative(g(f(x1, x2), _xi_2), 
_xi_2), _xi_2, h(x1, x2))


This is annoying for subsequent substitutions, for instance to switch from 
the function notation to simple symbols. 
Also, for more complex equations, the numbering of the automatic xi symbols 
is hard to predict. 

Is there a way to change this behavior? i.e. do not get the Subs and _xi_%d 
above

Thanks

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/b8b84555-2132-430c-be51-b0c47d99e3bb%40googlegroups.com.

Reply via email to