此为 Mathematica 7 文档,内容基于更早版本的 Wolfram 语言
查看最新文档(版本11.1)
Mathematica HowTo
How to | Take a Derivative
Mathematica makes it easy to take even the most complicated derivatives involving any of its huge range of differentiable special functions.
Define a function with one variable, f(x)=x^3-sin(x^2):
In[1]:=
Click for copyable input
Out[1]=
To find f^(')(x), type f'[x] and press Shift+Enter:
In[2]:=
Click for copyable input
Out[2]=
This method works for any order; just add more primes:
In[3]:=
Click for copyable input
Out[3]=
Or use D. Its first argument is the function and its second argument is the variable:
In[4]:=
Click for copyable input
Out[4]=
For higher-order derivatives using D, the second argument is a list, {variable, order}:
In[5]:=
Click for copyable input
Out[5]=
Define a function with two variables, g(x,y)=(x+y)^4:
In[6]:=
Click for copyable input
Out[6]=
Take the first derivative with respect to x and the second with respect to y by combining the two forms (single variable and list):
In[7]:=
Click for copyable input
Out[7]=
    
The Heaviside theta function is treated as if it had an infinite pulse at zero, where it is undefined:
In[8]:=
Click for copyable input
Out[8]=
The HeavisideTheta function has special derivative properties:
In[9]:=
Click for copyable input
Out[9]=
This plots the HeavisideTheta (green) and DiracDelta (red) functions:
In[10]:=
Click for copyable input
Out[10]=