doit() was the answer thanks! (Doesn't crash for me v1.4)
Le samedi 24 août 2019 20:20:13 UTC-4, Oscar a écrit :
>
> I would say that you should use doit but I just tried that and it crashed:
>
> In [*9*]: e=Function('g')(Function('f')(x1,x2),Function('h'
> )(x1,x2)).diff(x1)
I would say that you should use doit but I just tried that and it crashed:
In [*9*]: e=Function('g')(Function('f')(x1,x2),Function('h'
)(x1,x2)).diff(x1)
In [*10*]: e
Out[*10*]:
⎛ ∂ ⎞│⎛ ∂ ⎞│ ⎛
∂ ⎞│
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: