Gaussian quadrature
Template:Short description Script error: No such module "redirect hatnote". Template:More footnotes
The blue curve shows the function whose definite integral on the interval [−1, 1]Script error: No such module "Check for unknown parameters". 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) = −10Script error: No such module "Check for unknown parameters"., while the correct value is <templatestyles src="Fraction/styles.css" />2⁄3Script error: No such module "Check for unknown parameters".). 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 third-degree polynomial y(x) = 7x3 − 8x2 − 3x + 3Script error: No such module "Check for unknown parameters"., the 2-point Gaussian quadrature rule even returns an exact result.
In numerical analysis, an Template:Mvar-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 − 1Script error: No such module "Check for unknown parameters". or less by a suitable choice of the nodes Template:Mvar and weights Template:Mvar for i = 1, ..., nScript error: No such module "Check for unknown parameters"..
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]Script error: No such module "Check for unknown parameters"., so the rule is stated as
which is exact for polynomials of degree 2n − 1Script error: No such module "Check for unknown parameters". 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)Script error: No such module "Check for unknown parameters". is well-approximated by a polynomial of degree 2n − 1Script error: No such module "Check for unknown parameters". or less on [−1, 1]Script error: No such module "Check for unknown parameters"..
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)Script error: No such module "Check for unknown parameters". is well-approximated by a low-degree polynomial, then alternative nodes Template:Mvar and weights Template:Mvar 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 Template:Mvar 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.
Gauss–Legendre quadrature
Script error: No such module "labelled list hatnote".
For the simplest integration problem stated above, i.e., f(x)Script error: No such module "Check for unknown parameters". is well-approximated by polynomials on , the associated orthogonal polynomials are Legendre polynomials, denoted by Pn(x)Script error: No such module "Check for unknown parameters".. With the Template:Mvar-th polynomial normalized to give Pn(1) = 1Script error: No such module "Check for unknown parameters"., the Template:Mvar-th Gauss node, Template:Mvar, is the Template:Mvar-th root of Template:Mvar and the weights are given by the formula[3]
Some low-order quadrature rules are tabulated below (over interval [−1, 1]Script error: No such module "Check for unknown parameters"., see the section below for other intervals).
| Number of points, Template:Mvar | Points/abscissa, Template:Mvar | Weights, Template:Mvar | ||
|---|---|---|---|---|
| 1 | 0 | 2 | ||
| 2 | ±0.57735... | 1 | ||
| 3 | 0 | 0.888889... | ||
| ±0.774597... | 0.555556... | |||
| 4 | ±0.339981... | 0.652145... | ||
| ±0.861136... | 0.347855... | |||
| 5 | 0 | 0.568889... | ||
| ±0.538469... | 0.478629... | |||
| ±0.90618... | 0.236927... | |||
Change of interval
An integral over [a, b]Script error: No such module "Check for unknown parameters". must be changed into an integral over [−1, 1]Script error: No such module "Check for unknown parameters". before applying the Gaussian quadrature rule. This change of interval can be done in the following way:
with
Applying the point Gaussian quadrature rule then results in the following approximation:
Example of two-point Gauss quadrature rule
Use the two-point Gauss quadrature rule to approximate the distance in meters covered by a rocket from to as given by
Change the limits so that one can use the weights and abscissae given in Table 1. Also, find the absolute relative true error. The true value is given as 11061.34 m.
Solution
First, changing the limits of integration from to gives
Next, get the weighting factors and function argument values from Table 1 for the two-point rule,
Now we can use the Gauss quadrature formula since
Given that the true value is 11061.34 m, the absolute relative true error, is
Other forms
The integration problem can be expressed in a slightly more general way by introducing a positive weight function Template:Mvar into the integrand, and allowing an interval other than [−1, 1]Script error: No such module "Check for unknown parameters".. That is, the problem is to calculate for some choices of Template:Mvar, Template:Mvar, and Template:Mvar. For a = −1Script error: No such module "Check for unknown parameters"., b = 1Script error: No such module "Check for unknown parameters"., and ω(x) = 1Script error: No such module "Check for unknown parameters"., the problem is the same as that considered above. Other choices lead to other integration rules. Some of these are tabulated below. Equation numbers are given for Abramowitz and Stegun (A & S).
| Interval | ω(x)Script error: No such module "Check for unknown parameters". | Orthogonal polynomials | A & S | For more information, see ... |
|---|---|---|---|---|
| Template:Closed-closed | 1Script error: No such module "Check for unknown parameters". | Legendre polynomials | 25.4.29 | Template:Section link |
| Template:Open-open | Jacobi polynomials | 25.4.33 (β = 0Script error: No such module "Check for unknown parameters".) | Gauss–Jacobi quadrature | |
| Template:Open-open | Chebyshev polynomials (first kind) | 25.4.38 | Chebyshev–Gauss quadrature | |
| Template:Closed-closed | Chebyshev polynomials (second kind) | 25.4.40 | Chebyshev–Gauss quadrature | |
| Template:Closed-open | Laguerre polynomials | 25.4.45 | Gauss–Laguerre quadrature | |
| Template:Closed-open | Generalized Laguerre polynomials | Gauss–Laguerre quadrature | ||
| Template:Open-open | Hermite polynomials | 25.4.46 | Gauss–Hermite quadrature |
Fundamental theorem
Let Template:Mvar be a nontrivial polynomial of degree Template:Mvar such that
Note that this will be true for all the orthogonal polynomials above, because each Template:Mvar is constructed to be orthogonal to the other polynomials Template:Mvar for j<nScript error: No such module "Check for unknown parameters"., and xkScript error: No such module "Check for unknown parameters". is in the span of that set.
If we pick the Template:Mvar nodes Template:Mvar to be the zeros of Template:Mvar, then there exist Template:Mvar weights Template:Mvar which make the Gaussian quadrature computed integral exact for all polynomials h(x)Script error: No such module "Check for unknown parameters". of degree 2n − 1Script error: No such module "Check for unknown parameters". or less. Furthermore, all these nodes Template:Mvar will lie in the open interval (a, b)Script error: No such module "Check for unknown parameters"..[4]
To prove the first part of this claim, let h(x)Script error: No such module "Check for unknown parameters". be any polynomial of degree 2n − 1Script error: No such module "Check for unknown parameters". or less. Divide it by the orthogonal polynomial Template:Mvar to get where q(x)Script error: No such module "Check for unknown parameters". is the quotient, of degree n − 1Script error: No such module "Check for unknown parameters". or less (because the sum of its degree and that of the divisor Template:Mvar must equal that of the dividend), and r(x)Script error: No such module "Check for unknown parameters". is the remainder, also of degree n − 1Script error: No such module "Check for unknown parameters". or less (because the degree of the remainder is always less than that of the divisor). Since Template:Mvar is by assumption orthogonal to all monomials of degree less than Template:Mvar, it must be orthogonal to the quotient q(x)Script error: No such module "Check for unknown parameters".. Therefore
Since the remainder r(x)Script error: No such module "Check for unknown parameters". is of degree n − 1Script error: No such module "Check for unknown parameters". or less, we can interpolate it exactly using Template:Mvar interpolation points with Lagrange polynomials li(x)Script error: No such module "Check for unknown parameters"., where
We have
Then its integral will equal
where wiScript error: No such module "Check for unknown parameters"., the weight associated with the node xiScript error: No such module "Check for unknown parameters"., is defined to equal the weighted integral of li(x)Script error: No such module "Check for unknown parameters". (see below for other formulas for the weights). But all the Template:Mvar are roots of Template:Mvar, so the division formula above tells us that for all Template:Mvar. Thus we finally have
This proves that for any polynomial h(x)Script error: No such module "Check for unknown parameters". of degree 2n − 1Script error: No such module "Check for unknown parameters". or less, its integral is given exactly by the Gaussian quadrature sum.
To prove the second part of the claim, consider the factored form of the polynomial pnScript error: No such module "Check for unknown parameters".. Any complex conjugate roots will yield a quadratic factor that is either strictly positive or strictly negative over the entire real line. Any factors for roots outside the interval from Template:Mvar to Template:Mvar will not change sign over that interval. Finally, for factors corresponding to roots Template:Mvar inside the interval from Template:Mvar to Template:Mvar that are of odd multiplicity, multiply pnScript error: No such module "Check for unknown parameters". by one more factor to make a new polynomial
This polynomial cannot change sign over the interval from Template:Mvar to Template:Mvar because all its roots there are now of even multiplicity. So the integral since the weight function ω(x)Script error: No such module "Check for unknown parameters". is always non-negative. But pnScript error: No such module "Check for unknown parameters". is orthogonal to all polynomials of degree n − 1Script error: No such module "Check for unknown parameters". or less, so the degree of the product must be at least Template:Mvar. Therefore pnScript error: No such module "Check for unknown parameters". has Template:Mvar distinct roots, all real, in the interval from Template:Mvar to Template:Mvar.
General formula for the weights
The weights can be expressed as
where is the coefficient of in . To prove this, note that using Lagrange interpolation one can express r(x)Script error: No such module "Check for unknown parameters". in terms of as because r(x)Script error: No such module "Check for unknown parameters". has degree less than Template:Mvar and is thus fixed by the values it attains at Template:Mvar different points. Multiplying both sides by ω(x)Script error: No such module "Check for unknown parameters". and integrating from Template:Mvar to Template:Mvar yields
The weights Template:Mvar are thus given by
This integral expression for can be expressed in terms of the orthogonal polynomials and as follows.
We can write
where is the coefficient of in . Taking the limit of Template:Mvar to yields using L'Hôpital's rule
We can thus write the integral expression for the weights as
In the integrand, writing
yields
provided , because is a polynomial of degree k − 1Script error: No such module "Check for unknown parameters". which is then orthogonal to . So, if q(x)Script error: No such module "Check for unknown parameters". is a polynomial of at most nth degree we have
We can evaluate the integral on the right hand side for as follows. Because is a polynomial of degree n − 1Script error: No such module "Check for unknown parameters"., we have where s(x)Script error: No such module "Check for unknown parameters". is a polynomial of degree . Since s(x)Script error: No such module "Check for unknown parameters". is orthogonal to we have
We can then write
The term in the brackets is a polynomial of degree , which is therefore orthogonal to . The integral can thus be written as
According to equation (2), the weights are obtained by dividing this by and that yields the expression in equation (1).
can also be expressed in terms of the orthogonal polynomials and now . In the 3-term recurrence relation the term with vanishes, so in Eq. (1) can be replaced by .
Proof that the weights are positive
Consider the following polynomial of degree where, as above, the Template:Mvar are the roots of the polynomial . Clearly . Since the degree of is less than , the Gaussian quadrature formula involving the weights and nodes obtained from applies. Since for Template:Mvar not equal to Template:Mvar, we have
Since both and are non-negative functions, it follows that .
Computation of Gaussian quadrature rules
There are many algorithms for computing the nodes Template:Mvar and weights Template:Mvar of Gaussian quadrature rules. The most popular are the Golub-Welsch algorithm requiring O(n2)Script error: No such module "Check for unknown parameters". operations, Newton's method for solving using the three-term recurrence for evaluation requiring O(n2)Script error: No such module "Check for unknown parameters". operations, and asymptotic formulas for large n requiring O(n)Script error: No such module "Check for unknown parameters". operations.
Recurrence relation
Orthogonal polynomials with for for a scalar product , degree and leading coefficient one (i.e. monic orthogonal polynomials) satisfy the recurrence relation
and scalar product defined
for where Template:Mvar is the maximal degree which can be taken to be infinity, and where . First of all, the polynomials defined by the recurrence relation starting with have leading coefficient one and correct degree. Given the starting point by , the orthogonality of can be shown by induction. For one has
Now if are orthogonal, then also , because in all scalar products vanish except for the first one and the one where meets the same orthogonal polynomial. Therefore,
However, if the scalar product satisfies (which is the case for Gaussian quadrature), the recurrence relation reduces to a three-term recurrence relation: For is a polynomial of degree less than or equal to r − 1Script error: No such module "Check for unknown parameters".. On the other hand, is orthogonal to every polynomial of degree less than or equal to r − 1Script error: No such module "Check for unknown parameters".. Therefore, one has and for s < r − 1Script error: No such module "Check for unknown parameters".. The recurrence relation then simplifies to
or
(with the convention ) where
(the last because of , since differs from by a degree less than Template:Mvar).
The Golub-Welsch algorithm
The three-term recurrence relation can be written in matrix form where , is the th standard basis vector, i.e., , and Template:Mvar is the following tridiagonal matrix, called the Jacobi matrix:
The zeros of the polynomials up to degree Template:Mvar, which are used as nodes for the Gaussian quadrature can be found by computing the eigenvalues of this matrix. This procedure is known as Golub–Welsch algorithm.
For computing the weights and nodes, it is preferable to consider the symmetric tridiagonal matrix with elements
That is,
JScript error: No such module "Check for unknown parameters". and are similar matrices and therefore have the same eigenvalues (the nodes). The weights can be computed from the corresponding eigenvectors: If is a normalized eigenvector (i.e., an eigenvector with euclidean norm equal to one) associated with the eigenvalue Template:Mvar, the corresponding weight can be computed from the first component of this eigenvector, namely:
where is the integral of the weight function
See, for instance, Script error: No such module "Footnotes". for further details.
Error estimates
The error of a Gaussian quadrature rule can be stated as follows.[5] For an integrand which has 2nScript error: No such module "Check for unknown parameters". continuous derivatives, for some Template:Mvar in (a, b)Script error: No such module "Check for unknown parameters"., where Template:Mvar is the monic (i.e. the leading coefficient is 1Script error: No such module "Check for unknown parameters".) orthogonal polynomial of degree Template:Mvar and where
In the important special case of ω(x) = 1Script error: No such module "Check for unknown parameters"., we have the error estimate[6]
Stoer and Bulirsch remark that this error estimate is inconvenient in practice, since it may be difficult to estimate the order 2nScript error: No such module "Check for unknown parameters". derivative, and furthermore the actual error may be much less than a bound established by the derivative. Another approach is to use two Gaussian quadrature rules of different orders, and to estimate the error as the difference between the two results. For this purpose, Gauss–Kronrod quadrature rules can be useful.
Gauss–Kronrod rules
Script error: No such module "Labelled list hatnote".
If the interval [a, b]Script error: No such module "Check for unknown parameters". is subdivided, the Gauss evaluation points of the new subintervals never coincide with the previous evaluation points (except at zero for odd numbers), and thus the integrand must be evaluated at every point. Gauss–Kronrod rules are extensions of Gauss quadrature rules generated by adding n + 1Script error: No such module "Check for unknown parameters". points to an Template:Mvar-point rule in such a way that the resulting rule is of order 2n + 1Script error: No such module "Check for unknown parameters".. This allows for computing higher-order estimates while re-using the function values of a lower-order estimate. The difference between a Gauss quadrature rule and its Kronrod extension is often used as an estimate of the approximation error.
Gauss–Lobatto rules
In some applications, it is desirable to have quadrature rules that have the high accuracy of Gauss formulas, but that also include the end points of the interval among the evaluation points. Such rules are known as Gauss-Lobatto, or simply Lobatto quadrature,[7] named after Dutch mathematician Rehuel Lobatto. Because for an n point rule, one can no longer freely choose the locations of all quadrature points (2 of the points are fixed at the end points), one needs to expect that the rule is less accurate than regular Gaussian quadrature. Indeed, an n point Gauss-Lobatto rule is only accurate for polynomials up to degree 2n − 3Script error: No such module "Check for unknown parameters"..[8]
Lobatto quadrature of function f(x)Script error: No such module "Check for unknown parameters". on interval [−1, 1]Script error: No such module "Check for unknown parameters".:
Abscissas: Template:Mvar is the st zero of , here denotes the standard Legendre polynomial of Template:Mvar-th degree and the dash denotes the derivative.
Weights:
Remainder:
Some of the weights are:
| Number of points, n | Points, Template:Mvar | Weights, Template:Mvar |
|---|---|---|
An adaptive variant of this algorithm with 2 interior nodes[9] is found in GNU Octave and MATLAB as quadl and integrate.[10][11]
References
Citations
- ↑ Script error: No such module "Footnotes".
- ↑ Script error: No such module "Footnotes".
- ↑ Script error: No such module "Footnotes".
- ↑ Script error: No such module "Footnotes".
- ↑ Script error: No such module "Footnotes".
- ↑ Script error: No such module "Footnotes".
- ↑ Script error: No such module "Footnotes".
- ↑ Script error: No such module "Footnotes".
- ↑ Script error: No such module "Footnotes".
- ↑ Script error: No such module "Footnotes".
- ↑ Script error: No such module "Footnotes".
Bibliography
<templatestyles src="Refbegin/styles.css" />
- Script error: No such module "citation/CS1".
- Script error: No such module "Citation/CS1".
- Script error: No such module "Citation/CS1".
- Script error: No such module "citation/CS1".
- Script error: No such module "Citation/CS1".
- Script error: No such module "citation/CS1". datiert 1814, auch in Werke, Band 3, 1876, S. 163–196. English Translation by Wikisource.
- Script error: No such module "Citation/CS1".
- Script error: No such module "Citation/CS1".
- Script error: No such module "citation/CS1".
- Script error: No such module "citation/CS1".
- Script error: No such module "Citation/CS1".
- Script error: No such module "Citation/CS1".
- Script error: No such module "Citation/CS1".
- Script error: No such module "citation/CS1".
- Script error: No such module "Citation/CS1".
- Script error: No such module "citation/CS1".
- Script error: No such module "Citation/CS1".
- Script error: No such module "citation/CS1".
- Script error: No such module "Citation/CS1".
- Script error: No such module "citation/CS1".
- Script error: No such module "citation/CS1".
- Script error: No such module "Citation/CS1".
- Script error: No such module "Citation/CS1".
- Script error: No such module "citation/CS1".
- Template:Dlmf
- Script error: No such module "Citation/CS1".
External links
- Template:Springer
- ALGLIB contains a collection of algorithms for numerical integration (in C# / C++ / Delphi / Visual Basic / etc.)
- GNU Scientific Library — includes C version of QUADPACK algorithms (see also GNU Scientific Library)
- From Lobatto Quadrature to the Euler constant e
- Gaussian Quadrature Rule of Integration – Notes, PPT, Matlab, Mathematica, Maple, Mathcad at Holistic Numerical Methods Institute
- Script error: No such module "Template wrapper".
- Gaussian Quadrature by Chris Maes and Anton Antonov, Wolfram Demonstrations Project.
- Tabulated weights and abscissae with Mathematica source code, high precision (16 and 256 decimal places) Legendre-Gaussian quadrature weights and abscissas, for n=2 through n=64, with Mathematica source code.
- Mathematica source code distributed under the GNU LGPL for abscissas and weights generation for arbitrary weighting functions W(x), integration domains and precisions.
- Gaussian Quadrature in Boost.Math, for arbitrary precision and approximation order
- Gauss–Kronrod Quadrature in Boost.Math
- Nodes and Weights of Gaussian quadrature Template:Webarchive