Gauss quadrature · Hubbard 2.5, exercise 2.5.10

n well-chosen points integrate every polynomial of degree ≤ 2n − 1 exactly. Here is how, and why.

What this page is about

Exercise 2.5.10: for all a < b there are reals c₀, …, cₖ such that ∫ₐᵇ p(t) dt = Σ cᵢ p(i) whenever deg p ≤ k. Integration is a linear functional, and the exercise says it can be written as a weighted sum of point values. Any k + 1 distinct points will do, but some are far better than others. Put n points at the roots of the Legendre polynomial Pₙ and the sum is exact for degree up to 2n − 1, twice what the exercise promises, with weights that are all positive.

  1. Bars: the rule drawn as a Riemann sum that happens to be exact.
  2. Legendre: what Pₙ is and why its roots are the right points.
  3. Why it's exact: the three-line proof, drawn.
  4. Node choices: what goes wrong with equally spaced points and with the integers.
  5. How it works: the whole argument in prose.

Everything is on [−1, 1]. Any other interval is a linear change of variables away.