# NIntegrate

NIntegrate[f,{x,xmin,xmax}]

gives a numerical approximation to the integral .

NIntegrate[f,{x,xmin,xmax},{y,ymin,ymax},]

gives a numerical approximation to the multiple integral .

NIntegrate[f,{x,y,}reg]

integrates over the geometric region reg.

# Details and Options    • Multiple integrals use a variant of the standard iterator notation. The first variable given corresponds to the outermost integral and is done last.
• NIntegrate by default tests for singularities at the boundaries of the integration region and at the boundaries of regions specified by settings for the Exclusions option.
• NIntegrate[f,{x,x0,x1,,xk}] tests for singularities in a one-dimensional integral at each of the intermediate points xi. If there are no singularities, the result is equivalent to an integral from x0 to xk. You can use complex numbers xi to specify an integration contour in the complex plane.
• The following options can be given:
•  AccuracyGoal Infinity digits of absolute accuracy sought EvaluationMonitor None expression to evaluate whenever expr is evaluated Exclusions None parts of the integration region to exclude MaxPoints Automatic maximum total number of sample points MaxRecursion Automatic maximum number of recursive subdivisions Method Automatic method to use MinRecursion 0 minimum number of recursive subdivisions PrecisionGoal Automatic digits of precision sought WorkingPrecision MachinePrecision the precision used in internal computations
• NIntegrate usually uses adaptive algorithms, which recursively subdivide the integration region as needed. MinRecursion specifies the minimum number of recursive subdivisions to try. MaxRecursion gives the maximum number.
• NIntegrate usually continues doing subdivisions until the error estimate it gets implies that the final result achieves either the AccuracyGoal or the PrecisionGoal specified.
• For low-dimensional integrals, the default setting for PrecisionGoal is related to WorkingPrecision. For high-dimensional integrals, it is typically taken to be a fixed value, usually 2.
• You should realize that with sufficiently pathological functions, the algorithms used by NIntegrate can give wrong answers. In most cases, you can test the answer by looking at its sensitivity to changes in the setting of options for NIntegrate.
• Possible explicit settings for the Method option include:
• With Method->{"strategy",Method->"rule"} or Method->{"strategy",Method->{rule1,rule2,}} possible strategy methods include:
•  "GlobalAdaptive" subdivide based on global error estimates "LocalAdaptive" subdivide based only on local error estimates
• Methods used as rules include:
•  "CartesianRule" multidimensional product of rules "ClenshawCurtisRule" Clenshaw–Curtis rule "GaussKronrodRule" Gauss points with Kronrod extension "LevinRule" Levin-type oscillatory rules "LobattoKronrodRule" Gauss–Lobatto points with Kronrod extension "MultidimensionalRule" multidimensional symmetric rule "MultipanelRule" combination of 1D rules "NewtonCotesRule" Newton–Cotes rule "RiemannRule" Riemann sum rule "TrapezoidalRule" uniform points in one dimension
• With the setting Method->"rule", the strategy method will be selected automatically.
• Additional method suboptions can be given in the form Method->{,opts}.
• NIntegrate symbolically analyzes its input to transform oscillatory and other integrands, subdivide piecewise functions, and select optimal algorithms.
• The method suboption "SymbolicProcessing" specifies the maximum number of seconds for which to attempt performing symbolic analysis of the integrand.
• N[Integrate[]] calls NIntegrate for integrals that cannot be done symbolically.
• NIntegrate first localizes the values of all variables, then evaluates f with the variables being symbolic, and then repeatedly evaluates the result numerically.
• NIntegrate has attribute HoldAll and effectively uses Block to localize variables.

# Examples

open all close all

## Basic Examples(5)

Compute a numerical integral:

 In:= Out= Compute a multidimensional integral (with singularity at the origin):

 In:= Out= Compute areas and volumes for implicitly defined regions:

 In:= Out= In:= Out= Integrate over any region:

 In:= Out= In:= Out= Integrate oscillatory and other complicated functions:

 In:= Out= In:= Out= ## Neat Examples(2)

Introduced in 1988
(1.0)
|
Updated in 2014
(10.0)