Numerical quadrature from Lagrange
The general idea of numerical integration: approximate an integral by a weighted sum of function values, obtained by integrating the Lagrange polynomial.
What problem it solves
Many integrals cannot be computed by hand because the function is only tabulated or because its antiderivative is not manageable. Numerical quadrature replaces the exact area by a combination of heights measured at nodes.
Derivation with the interpolating polynomial
If we interpolate with the Lagrange polynomial and then integrate, the integral of separates into a sum of values multiplied by integrals of the bases .
Which method to choose
- If the nodes are equally spaced and the endpoints are used, closed Newton-Cotes formulas appear.
- If the nodes are equally spaced but the endpoints are not used, open Newton-Cotes formulas appear.
- If the evaluation points can be chosen, Gaussian quadrature places non-equally spaced nodes to increase the degree of exactness.
- For double integrals, the same rules are applied as a product: one direction and then the other.