Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Get the derivative with respect to a function
ResourceFunction["ChainD"][f, g] gives the partial derivative of f with respect to g, where both f and g are functions of the same variable. | |
ResourceFunction["ChainD"][f, {g, n}] gives the nth derivative. | |
ResourceFunction["ChainD"][f, g1,g2,…] gives the partial derivative of f with respect to g1 followed by the partial derivative with respect to g2, etc. |
Derivative of x4 with respect to x2:
In[1]:= | ![]() |
Out[1]= | ![]() |
Derivative of a more complicated function:
In[2]:= | ![]() |
Out[2]= | ![]() |
It is not necessary to be able to symbolically invert g(x):
In[3]:= | ![]() |
Out[3]= | ![]() |
It is not possible to symbolically invert BesselJ[2,x]:
In[4]:= | ![]() |
Out[4]= | ![]() |
Derivative of a multivariate function with respect to functions of each of the variables:
In[5]:= | ![]() |
Out[5]= | ![]() |
When using ChainD with multiple functions, the result in general depends on the order of derivatives:
In[6]:= | ![]() |
Out[6]= | ![]() |
In[7]:= | ![]() |
Out[7]= | ![]() |
Derivatives with respect to heads of functions are not supported:
In[8]:= | ![]() |
Out[8]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License