Numerical integration and differentiation · Definition
Gaussian quadrature
Before you start you need to know
If you already know Simpson's rule, the challenge here is choosing where to evaluate the function, not just how to combine the values.
Definition
Numerical integration method that chooses optimal nodes \(x_i\) and weights \(w_i\) to approximate an integral with the highest possible accuracy for a fixed number of function evaluations.
A Gaussian quadrature rule with \(n\) nodes has degree of exactness \(2n-1\): it integrates without error every polynomial of that degree. The nodes \(x_i\) are the roots of the orthogonal polynomial of degree \(n\) with respect to the inner product on the interval, and the weights \(w_i\) come from solving a linear system or from closed formulas.
For \(\int_{-1}^{1} f(x)\,dx\) with \(n=2\), the nodes are \(\pm 1/\sqrt{3}\) and the weights equal \(1\). Thus \(\int_{-1}^{1} x^2\,dx\) is approximated by \(1/3+1/3=2/3\), which matches the exact value. Before applying the formula, any interval \([a,b]\) must be mapped to \([-1,1]\).
A typical mistake is pairing Gauss nodes with Simpson's weights, or using equally spaced nodes: the degree of exactness drops and the rule is no longer Gaussian. It is also unwise to assume that more nodes always improve the result without checking that the function is smooth.
Think about it
Why can an n-node Gaussian rule integrate exactly up to degree 2n-1 and not just degree n?
Because the n nodes and n weights give 2n free parameters, enough to impose exactness on the powers 1, x, ..., x^{2n-1}.
Exercises 10
- What is the name of the integral approximation that chooses nodes \(x_i\) and weights \(w_i\) to gain accuracy?
- What are the nodes \(x_i\) of an \(n\)-point Gaussian quadrature?
- In the formula \(\sum w_i f(x_i)\), what do the \(w_i\) represent?
- On which standard interval are the Gauss-Legendre nodes defined?
- Which family of orthogonal polynomials generates the Gauss-Legendre nodes?
- Apply the 2-point rule (nodes \(\pm 1/\sqrt{3}\), weights 1) to \(\int_{-1}^{1} x^2\,dx\). What do you get?
- To map \([a,b]\) onto \([-1,1]\), which change of variable is used?
- If the \(n\)-point rule is exact up to degree \(2n-1\), up to what degree is it exact with \(n=3\)?
- Which statement about the 2-node Gaussian quadrature on \([-1,1]\) is false?
- Using the 2-point Gaussian rule after mapping \([0,2]\) to \([-1,1]\), what is \(\int_0^2 x^3\,dx\)? Use \(x=t+1\) with \(t\in[-1,1]\).
References
- Richard L. Burden, J. Douglas Faires, Annette M. Burden, Numerical Analysis, 10th edition, Cengage Learning, 2016.
- Lloyd N. Trefethen, David Bau III, Numerical Linear Algebra, 1st edition, SIAM, 1997.