D
Usage
Notes
Further Examples
Here is the derivative of with respect to x. This can be entered as D[Sin[x], x].
In[1]:=
|
Out[1]=
|
Here is the familiar Chain Rule of first-year calculus.
In[2]:=
|
Out[2]=
|
This gives the fourth derivative of .
In[3]:=
|
Out[3]=
|
Here is the partial derivative .
In[4]:=
|
Out[4]=
|
Normally, if you differentiate a function with respect to x, say, Mathematica will treat all other parameters as constants.
In[5]:=
|
Out[5]=
|
By specifying that t depends upon x, you can get the desired result for such expressions.
In[6]:=
|
Out[6]=
|
Here are some advanced examples.
In[7]:=
|
Out[7]=
|
In[8]:=
|
Out[8]=
|
Sometimes the derivative is kept unevaluated until an argument is substituted for which an evaluation can be given.
In[9]:=
|
Out[9]=
|
In[10]:=
|
Out[10]=
|
In[11]:=
|
Out[11]=
|
In[12]:=
|
Out[12]=
|
Mathematica can also work with vector derivatives. This gives the gradient, which is the first vector derivative of a scalar function. This can be entered as D[f[x, y], {{x, y}, 1}].
In[13]:=
|
Out[13]=
|
In[14]:=
|
Out[14]=
|
This gives the Hessian, which is the second vector derivative of a scalar function.
In[15]:=
|
Out[15]//MatrixForm=
|
In[16]:=
|
Out[16]//MatrixForm=
|
This gives the Jacobian, which is the first vector derivative of a vector function. This can be entered as D[{f[x, y], g[x, y]}, {{x, y}, 1}].
In[17]:=
|
Out[17]//MatrixForm=
|
In[18]:=
|
Out[18]//MatrixForm=
|
This gives the third vector derivative of a scalar function.
In[19]:=
|
Out[19]//MatrixForm=
|
In[20]:=
|
Out[20]//MatrixForm=
|
This demonstrates a two dimensional version of the chain rule.
In[21]:=
|
Out[21]=
|
In[22]:=
|
|