Integrate
Usage Message: Integrate[f, x] gives the indefinite integral of f with respect to x. Integrate[f, {x, xmin,
xmax}] gives the definite integral of f with respect to x from xmin to xmax. Integrate[f, {x, xmin, xmax}, {y, ymin, ymax}] gives a multiple definite
integral of f with respect to x and y. Attributes[Integrate] = {Protected, ReadProtected}
Options: Assumptions
-> {} GenerateConditions
-> Automatic
PrincipalValue
-> False
Notes: The most useful general suggestion for any problem involving the Integrate function is to try simplifying your input. Integrate is the most complicated function in Mathematica. Anything that you can do to combine or eliminate constants in the integrand, or break the integral up into simpler operations, such as integrating a sum term by term, will often lead to better or faster results. Detailed comments about Integrate depend on the type of integral that you are doing. Different type of integrals use different internal algorithms, and lead to different sets of problems and suggestions. Indefinite Integrals Incorrect results from indefinite integration are very rare. The only known errors in indefinite integration in Version 3.0 of Mathematica are in certain integrals in which the constants are inexact numbers, in certain integrals that involve both fractional powers (roots) and trigonometric functions, and in certain non-elementary logarithmic integrals (Version 3.0.0 only). You can check indefinite integrals by checking whether or not the derivative of the result is mathematically equivalent to the integrand. If the result is too complicated to simplify symbolically, this check can be done by inserting numerical values for symbolic constants and for the variable of integration. Here is one of the integrals that is known to be incorrect in Version 3.0 of Mathematica. The error can be seen by observing that the difference between the integrand and the derivative of the result is not zero.
In[1]:= f = Sqrt[x^2 Cos[y]^2 + Sin[y]^2 + 1]
2 2 2
Out[1]= Sqrt[1 + x Cos[y] + Sin[y] ]
In[2]:= int = Integrate[f, x]
2 2
-(x (-3 + Cos[2 y])) x Sqrt[3 + x - Cos[2 y] + x Cos[2 y]]
Out[2]= -------------------- + ---------------------------------------
2 Sqrt[2] 2 Sqrt[2]
In[3]:= D[int, x] - f /. {x -> 1.3, y -> 2.1}
Out[3]= 0.642456
You can get a correct result in this example by simplifying the integrand before doing the integral. This procedure clearly should not be necessary, but it does provide a way to get a correct result using the current version of Mathematica. (We expect that this problem will be fixed in the next release of Mathematica.)
In[4]:= int = Integrate[Sqrt[x^2 c^2 + s^2 + 1], x] /.
{c -> Cos[y], s -> Sin[y]}
2 2 2 2
Log[2 x Cos[y] + 2 Sqrt[1 + x Cos[y] + Sin[y] ]] Sec[y] (1 + Sin[y] )
Out[4]= ----------------------------------------------------------------------- +
2
2 2 2
x Sqrt[1 + x Cos[y] + Sin[y] ]
> --------------------------------
2
In[5]:= Simplify[D[int, x] - f]
Out[5]= 0
Here is an example of one of the non-elementary logarithmic integrals that is incorrect in Mathematica Version 3.0.0 (release 0 of Version 3.0). The warning messages reflect the fact that this version of Mathematica is not programmed to do this integral.
In[6]:= Integrate[Log[x]*Log[1-x]/(x*(1-x)), x]
1
Power::infy: Infinite expression - encountered.
0
1
Power::infy: Infinite expression - encountered.
0
1
Power::infy: Infinite expression - encountered.
0
General::stop: Further output of Power::infy
will be suppressed during this calculation.
Infinity::indet: Indeterminate expression 0 (-Infinity) encountered.
Infinity::indet:
Indeterminate expression (-Infinity) + <<18>> +
2 PolyLog[3, ComplexInfinity] encountered.
Out[6]= 0
Definite Integrals Definite integrals are computed either by looking them up in tables or by taking limits of the corresponding indefinite integrals. Improper integrals, and integrals involving special functions, are usually done by looking them up in tables. Other integrals are usually done using the indefinite integral. For integrals that are computed using limits of the corresponding indefinite integral, errors can arise if the Integrate function is unable to compensate for discontinuities in the range of integration. Here is an example of an error of this type in Version 3.0 of Mathematica:
In[1]:= Integrate[Sqrt[Sin[x + 1/2]^2], {x, 0, Pi}]
Out[1]= 0
An identifying characteristic for these types of errors is that there will be a discontinuity in the indefinite integral. This discontinuity can typically be seen using a plot. In most cases the Integrate function is either able to compensate for these discontinuities, or will generate a warning message if it is unable to do so. This is a very difficult problem, however, and there are still a few examples (such as this one) where important discontinuities remain undetected.
In[2]:= int = Integrate[Sqrt[Sin[x + 1/2]^2], x]
1 1 2
Out[2]= -(Cot[- + x] Sqrt[Sin[- + x] ])
2 2
In[3]:= Plot[int, {x, -1, 4}]
Out[3]= -Graphics-
The second source of errors in symbolic definite integration is errors in the integration tables. Here is an example of an error of this type.
In[1]:= Integrate[(1/(E^t-1)-1/(t E^t)),{t,0,Infinity}]
Out[1]= Infinity
In this example you can cause the integral to return unevaluated by clearing the internal symbol Integrate`Definite, which disables
the corresponding part of the integration tables. This symptom is typical of errors in the integration tables. The correct result for this integral is EulerGamma
which can be computed numerically using NIntegrate
.
In[2]:= Block[{Integrate`Definite},
Integrate[(1/(E^t-1)-1/(t E^t)),{t,0,Infinity}]
]
1 1
Out[2]= Integrate[------- - ----, {t, 0, Infinity}]
t t
-1 + E E t
Here is another example of an error in Integrate which is caused by an error in the integration
tables. As in the previous example, this error can be avoided by temporarily disabling the integration tables. The correct result for this integral is Infinity
.
In[3]:= Integrate[Sqrt[Pi] Erf[y], {y, 0, Infinity}]
Out[3]= -1
In[4]:= Block[{Integrate`Definite},
Integrate[Sqrt[Pi] Erf[y], {y, 0, Infinity}] ]
Out[4]= Infinity
Multiple Integrals There are no special facilities in current versions of the Integrate function for doing multiple integrals. Multiple integrals are always treated as iterated single integrals. Any analysis of problems with multiple integrals proceeds by analyzing the corresponding single integrals.
Additional Online Documentation:
Mathematica 3.0
http://documents.wolfram.com/v3/RefGuide/Integrate.html
Mathematica 4.0
http://documents.wolfram.com/v4/RefGuide/Integrate.html
Questions or comments? Send email to support@wolfram.com.
| |