Overview: Quadrature
This section introduces some of the mathematical concepts used in the IDL Advanced Math and Stats integration routines.
Univariate and Bivariate Quadrature
The first function in this chapter, IMSL_INTFCN, is designed to compute approximations to integrals of the following form:

or:

The weight function w is used to incorporate known singularities (either algebraic or logarithmic) or to incorporate oscillations. The default action of this function assumes univariate quadrature, a weight function w(x) = 1, and the existence of endpoint singularities. Even if no endpoint singularities exist, the default method is still effective for general-purpose integration. If more efficiency is desired, then a more specialized method can be specified through the use of specific parameter and keyword combinations. The available methods can be summarized as follows, where the description refers to subsections of the documentation for the IMSL_INTFCN function:
- w(x) = 1
- Integration of a function with endpoint singularities (default method)
- Integration of a function based on Gauss-Kronrod rules
- Integration of a function with singular points given
- Integration of a function over an infinite or semi-infinite interval
- Integration of a smooth function using a nonadaptive method
- Integration of a two-dimensional iterated integral
- w(x) = sinωx or w(x) = cosωx
- Integration of a function containing a sine or cosine factor
- Computing the Fourier sine or cosine transform
, where the ln factors are optional- Integration of functions with algebraic-logarithmic singularities
- w(x) = 1/(x – c)
- Integrals in the Cauchy principle value sense
The IMSL_INTFCN function returns an estimated answer R and provides keywords to specify a requested absolute error ε, the requested relative error ρ, and a named variable in which to return an estimate of the error E. These numbers are related in the equation:

One situation that arises in univariate quadrature concerns the approximation of integrals when only tabular data is given. The functions above do not directly address this question. However, the standard method for handling this problem is to interpolate the data then integrate the interpolant. This can be accomplished by using the IDL Advanced Math and Stats spline interpolation functions with the spline integration function, IMSL_SPINTEG.
Multivariate Quadrature
Two functions, IMSL_INTFCN and IMSL_INTFCNHYPER, have been included in this chapter that can be used to approximate certain multivariate integrals.
IMSL_INTFCN can be called with additional parameters and keywords to return an approximation to a two-dimensional iterated integral of the form:

The IMSL_INTFCNHYPER function returns an approximation to the integral of a function of n variables over a hyper-rectangle as shown in the equation:

When working with two-dimensional, tensor-product tabular data, use the IDL Advanced Math and Stats spline interpolation the IMSL_BSINTERP function, followed by the spline integration the IMSL_SPINTEG function.
Gauss Quadrature
For a fixed number of nodes, N, the Gauss quadrature rule is the unique rule that integrates polynomials of degree less than 2N. These quadrature rules can be easily computed using the IMSL_GQUAD procedure, which produces the points {xi} and weights {wi} for i = 1, ..., N that satisfy:

for all functions f that are polynomials of degree less than 2N. The weight functions w can be selected from Table 7-1:
Where permissible, IMSL_GQUAD also computes Gauss-Radau and Gauss-Lobatto quadrature rules.