Gaussian quadrature

Comparison between 2-point Gaussian and trapezoidal quadrature.
Comparison between 2-point Gaussian and trapezoidal quadrature.
The blue curve shows the function whose definite integral on the interval [−1, 1] is to be calculated (the integrand). The trapezoidal rule approximates the function with a linear function that coincides with the integrand at the endpoints of the interval and is represented by an orange dashed line. The approximation is apparently not good, so the error is large (the trapezoidal rule gives an approximation of the integral equal to y(–1) + y(1) = –10, while the correct value is 23). To obtain a more accurate result, the interval must be partitioned into many subintervals and then the composite trapezoidal rule must be used, which requires many more calculations.
The Gaussian quadrature chooses more suitable points instead, so even a linear function approximates the function better (the black dashed line). As the integrand is the polynomial of degree 3 (y(x) = 7x3 – 8x2 – 3x + 3), the 2-point Gaussian quadrature rule even returns an exact result.

In numerical analysis, an n-point Gaussian quadrature rule, named after Carl Friedrich Gauss,[1] is a quadrature rule constructed to yield an exact result for polynomials of degree 2n − 1 or less by a suitable choice of the nodes xi and weights wi for i = 1, ..., n.

The modern formulation using orthogonal polynomials was developed by Carl Gustav Jacobi in 1826.[2] The most common domain of integration for such a rule is taken as [−1, 1], so the rule is stated as

which is exact for polynomials of degree 2n − 1 or less. This exact rule is known as the Gauss–Legendre quadrature rule. The quadrature rule will only be an accurate approximation to the integral above if f (x) is well-approximated by a polynomial of degree 2n − 1 or less on [−1, 1].

The Gauss–Legendre quadrature rule is not typically used for integrable functions with endpoint singularities. Instead, if the integrand can be written as

where g(x) is well-approximated by a low-degree polynomial, then alternative nodes xi' and weights wi' will usually give more accurate quadrature rules. These are known as Gauss–Jacobi quadrature rules, i.e.,

Common weights include (Chebyshev–Gauss) and . One may also want to integrate over semi-infinite (Gauss–Laguerre quadrature) and infinite intervals (Gauss–Hermite quadrature).

It can be shown (see Press et al., or Stoer and Bulirsch) that the quadrature nodes xi are the roots of a polynomial belonging to a class of orthogonal polynomials (the class orthogonal with respect to a weighted inner-product). This is a key observation for computing Gauss quadrature nodes and weights.