Wolfram Research, Inc.

3.5.8 Definite Integrals

Integration functions.

Here is the integral .

In[1]:= Integrate[x^2, {x, a, b}]

Out[1]=

This gives the multiple integral .

In[2]:= Integrate[x^2 + y^2, {x, 0, a}, {y, 0, b}]

Out[2]=

The y integral is done first. Its limits can depend on the value of x. This ordering is the same as is used in functions like Sum and Table.

In[3]:= Integrate[x^2 + y^2, {x, 0, a}, {y, 0, x}]

Out[3]=

In simple cases, definite integrals can be done by finding indefinite forms and then computing appropriate limits. But there is a vast range of integrals for which the indefinite form cannot be expressed in terms of standard mathematical functions, but the definite form still can be.

This indefinite integral cannot be done in terms of standard mathematical functions.

In[4]:= Integrate[Cos[Sin[x]], x]

Out[4]=

This definite integral, however, can be done in terms of a Bessel function.

In[5]:= Integrate[Cos[Sin[x]], {x, 0, 2Pi}]

Out[5]=

Here is an integral where the indefinite form can be found, but it is much more efficient to work out the definite form directly.

In[6]:= Integrate[Log[x] Exp[-x^2], {x, 0, Infinity}]

Out[6]=

Just because an integrand may contain special functions, it does not mean that the definite integral will necessarily be complicated.

In[7]:= Integrate[BesselK[0, x]^2, {x, 0, Infinity}]

Out[7]=

Special functions nevertheless occur in this result.

In[8]:= Integrate[BesselK[0, x] BesselJ[0, x], {x, 0, Infinity}]

Out[8]=

The integrand here is simple, but the definite integral is not.

In[9]:= Integrate[Sin[x^2] Exp[-x], {x, 0, Infinity}]

Out[9]=

Even when you can find the indefinite form of an integral, you will often not get the correct answer for the definite integral if you just subtract the values of the limits at each end point. The problem is that within the domain of integration there may be singularities whose effects are ignored if you follow this procedure.

Here is the indefinite integral of .

In[10]:= Integrate[1/x^2, x]

Out[10]=

This subtracts the limits at each end point.

In[11]:= Limit[%, x->2] - Limit[%, x->-2]

Out[11]=

The true definite integral is divergent because of the double pole at .

In[12]:= Integrate[1/x^2, {x, -2, 2}]

Out[12]=

Here is a more subtle example, involving branch cuts rather than poles.

In[13]:= Integrate[1/(1 + a Sin[x]), x]

Out[13]=

Taking limits in the indefinite integral gives 0.

In[14]:= Limit[%, x -> 2Pi] - Limit[%, x -> 0]

Out[14]=

The definite integral, however, gives the correct result which depends on .

In[15]:= Integrate[1/(1 + a Sin[x]), {x, 0, 2Pi}]

Out[15]=

Principal value integrals.

Here is the indefinite integral of .

In[16]:= Integrate[1/x, x]

Out[16]=

Substituting in the limits and yields a strange result involving .

In[17]:= Limit[%, x -> 2] - Limit[%, x -> -1]

Out[17]=

The ordinary Riemann definite integral is divergent.

In[18]:= Integrate[1/x, {x, -1, 2}]

Out[18]=

The Cauchy principal value, however, is finite.

In[19]:= Integrate[1/x, {x, -1, 2}, PrincipalValue->True]

Out[19]=

When parameters appear in an indefinite integral, it is essentially always possible to get results that are correct for almost all values of these parameters. But for definite integrals this is no longer the case. The most common problem is that a definite integral may converge only when the parameters that appear in it satisfy certain specific conditions.

This indefinite integral is correct for all .

In[20]:= Integrate[x^n, x]

Out[20]=

For the definite integral, however, must satisfy a condition in order for the integral to be convergent.

In[21]:= Integrate[x^n, {x, 0, 1}]

Out[21]=

If is replaced by 2, the condition is satisfied.

In[22]:= % /. n -> 2

Out[22]=

Options for Integrate.

With the assumption , the result is always .

In[23]:= Integrate[x^n, {x, 0, 1}, Assumptions -> (n > 2)]

Out[23]=

Even when a definite integral is convergent, the presence of singularities on the integration path can lead to discontinuous changes when the parameters vary. Sometimes a single formula containing functions like Sign can be used to summarize the result. In other cases, however, an explicit If is more convenient.

The If here gives the condition for the integral to be convergent.

In[24]:= Integrate[Sin[a x]/x, {x, 0, Infinity}]

Out[24]=

Here is the result assuming that is real.

In[25]:= Integrate[Sin[a x]/x, {x, 0, Infinity},

Assumptions -> Im[a] == 0]

Out[25]=

The result is discontinuous as a function of . The discontinuity can be traced to the essential singularity of at .

In[26]:= Plot[%, {a, -5, 5}]

Out[26]=

There is no convenient way to represent this answer in terms of Sign, so Mathematica generates an explicit If.

In[27]:= Integrate[Sin[x] BesselJ[0, a x]/x, {x, 0, Infinity},

Assumptions -> Im[a] == 0]

Out[27]=

Here is a plot of the resulting function of .

In[28]:= Plot[Evaluate[%], {a, -5, 5}]

Out[28]=