Numerical integration and differentiation · Definition

Gaussian quadrature

numerical methodsnumerical integration and differentiation

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.

\[\int_{a}^{b} f(x)\,dx \approx \sum_{i=1}^{n} w_i\, f(x_i)\]

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

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.