Gauss–Legendre quadrature
In numerical analysis, Gauss–Legendre quadrature is a form of Gaussian quadrature for approximating the definite integral of a function. For integrating over the interval [−1, 1], the rule takes the form:
where
- n is the number of sample points used,
- wi are quadrature weights, and
- xi are the roots of the nth Legendre polynomial.
This choice of quadrature weights wi and quadrature nodes xi is the unique choice that allows the quadrature rule to integrate degree 2n − 1 polynomials exactly.
Many algorithms have been developed for computing Gauss–Legendre quadrature rules. The Golub–Welsch algorithm presented in 1969 reduces the computation of the nodes and weights to an eigenvalue problem which is solved by the QR algorithm. This algorithm was popular, but significantly more efficient algorithms exist. Algorithms based on the Newton–Raphson method are able to compute quadrature rules for significantly larger problem sizes. In 2014, Ignace Bogaert presented explicit asymptotic formulas for the Gauss–Legendre quadrature weights and nodes, which are accurate to within double-precision machine epsilon for any choice of n ≥ 21. This allows for computation of nodes and weights for values of n exceeding one billion.