The
AccuracyGoal option can be used to change the default absolute tolerance:
The integration process stops once the accuracy goal criterion has been exceeded:
The result with the default settings is different since the default uses only a precision criterion:
Get the number of evaluation points used in a numerical integration:
Show the evaluation points used in a numerical integration:
Integration by excluding the curves on which the integrand's denominator is zero:
The curves on which the integrand is singular:
Stop integration after a specified number of points has been exceeded:
Without enough adaptive recursion, the following gives a poor result:
Specifying a larger value for
MaxRecursion gives a much better result:
Specifying the singularity locations is even more efficient:
Left- and right-sided Riemann sum:
Riemann sum samples uniformly at the left or right endpoints of subregions:
Basic trapezoidal rule with no extrapolation, corresponding to piecewise linear approximation:
Trapezoidal rule with Romberg extrapolation:
The basic trapezoidal rule samples uniformly (when adaptivity is turned off):
Default adaptive method with trapezoidal rule:
Newton-Cotes rule with evenly spaced sampling points:
Closed formulas include endpoints, but open formulas do not:
A Newton-Cotes rule corresponds to polynomial interpolation:
The approximation with no adaptivity is the same as integrating the corresponding polynomial:
The method with order

is exact for polynomials up to degree

:
Clenshaw-Curtis quadrature rule with the strategy selected automatically:
The sampling points are non-uniform:
The points are rescaled versions of

:
Gaussian quadrature rule with Kronrod extension for error estimation:
Gaussian rules use non-uniform sample points:
The method with

Gauss points is exact for polynomials of degree

:
The method with order

uses enough points to be exact for polynomials of degree

:
Gaussian quadrature rule at Lobatto points with Kronrod extension:
Lobatto points are non-uniform and include the endpoints of the integration region:
Multi-panel rule (or composite rule) applies the specified rule to multiple subintervals:
Any other rule can be used together with a multi-panel rule:
Using the product of one-dimensional rules:
A list of rules is automatically interpreted as a product of rules:
Use uniform sampling in x and non-uniform sampling in y:
Multivariate integration using a multidimensional symmetric rule:
The multidimensional rule uses a sparse symmetric grid of sample points:
Increase the number of sample points:
Timing can sometimes be improved with a different number of generators:
Integration of an oscillatory function using a Levin-type collocation rule:
Multivariate Levin-type rule:
Globally adaptive integration strategy:
Subdivide regions based on largest error until global error is sufficiently small:
Locally adaptive integration strategy:
Subdivide every region until all local errors are sufficiently small:
Trapezoidal strategy that samples uniformly at increasing density:
Subdivide entire region and use a lower-order method:
Double-exponential ("tanh-sinh") strategy that samples densely near the endpoints:
Subdivide entire region, after transformation:
Monte Carlo integration with uniformly random sampling points:
With deterministic sequences of sampling points:
Globally adaptive versions of Monte Carlo and quasi Monte Carlo:
Plot sampling points used by different strategies:
By default some symbolic processing may be performed:
Use the automatic numeric methods, but no symbolic processing:
Use an explicit time limit for symbolic processing:
Control automatic subdivision of piecewise functions:
Automatic subdivision of piecewise functions usually leads to fewer function evaluations:
Control automatic simplification of even and odd integrands:
Automatic simplification usually leads to fewer function evaluations:
Control automatic method selection for highly oscillatory functions:
Specialized methods lead to fewer function evaluations for highly oscillatory functions:
Switching detection off can save time for non-oscillatory functions:
Control automatic subdivision at nodes of interpolating functions:
Subdivision of interpolating functions can lead to fewer evaluations:
Subdivision may be unnecessary for an accurate interpolation of a smooth function:
NIntegrate may miss sharp peaks of integrands:
Increasing

forces a finer subdivision of the integration region:
The number of samples used to evaluate

for different relative tolerances:
The number of samples needed typically increases exponentially with the
PrecisionGoal:
NIntegrate can compute integrals using higher working precision:
The
PrecisionGoal used is 10 less than the
WorkingPrecision: