此为 Mathematica 7 文档,内容基于更早版本的 Wolfram 语言
查看最新文档(版本11.1)
Mathematica HowTo
How to | Do an Integral
Mathematica contains a very powerful system of integration. It can do almost any integral that can be done in terms of standard mathematical functions.
To compute the indefinite integral intsin(x)dx, use Integrate. The first argument is the function and the second argument is the variable:
In[1]:=
Click for copyable input
Out[1]=
For the definite integral , the second argument is a list of the form {variable, lower limit, upper limit}:
In[2]:=
Click for copyable input
Out[2]=
To do the multiple integral , use a mix of a variable and a range:
In[3]:=
Click for copyable input
Out[3]=
Alternatively, you can use Integrate twice:
In[4]:=
Click for copyable input
Out[4]=
    
Calculating the area of a circle is a classic calculus problem. An intuitive way to approach this is the integral , which involves substitution:
In[5]:=
Click for copyable input
Out[5]=
Integrate gives exact answers to many improper integrals, for example :
In[6]:=
Click for copyable input
Out[6]=
Suppose that there is no closed form for a definite integral, for example :
In[7]:=
Click for copyable input
Out[7]=
In that case, you can get an approximation with NIntegrate:
In[8]:=
Click for copyable input
Out[8]=
If you want a numerical result, it is faster to use NIntegrate than to use Integrate and follow it with N:
In[9]:=
Click for copyable input
Out[9]=