This is documentation for Mathematica 4, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)
Wolfram Research, Inc.

Integrals That Can and Cannot Be DoneManipulating Integrals in Symbolic Form

3.5.8 Definite Integrals

Integration functions.

Here is the integral .

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


This gives the multiple integral .

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


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}]


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]


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

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


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}]


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}]


Special functions nevertheless occur in this result.

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


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

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


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]


This subtracts the limits at each end point.

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


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

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


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

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


Taking limits in the indefinite integral gives 0.

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


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

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


Principal value integrals.

Here is the indefinite integral of .

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


Substituting in the limits and yields a strange result involving .

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


The ordinary Riemann definite integral is divergent.

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


The Cauchy principal value, however, is finite.

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


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]


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}]


If is replaced by 2, the condition is satisfied.

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


Options for Integrate.

With the assumption , the result is always .

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


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}]


Here is the result assuming that is real.

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

Assumptions -> Im[a] == 0]


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}]


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]


Here is a plot of the resulting function of .

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


Integrals That Can and Cannot Be DoneManipulating Integrals in Symbolic Form