All courses › Numerical Methods › Splines and Gaussian quadrature

Splines and Gaussian quadrature

A spline is a piecewise polynomial that is smooth across the joints between pieces; cubic splines are most common and avoid Runge's phenomenon. Gaussian quadrature is an integration method that chooses points and weights optimally, so that nn points give an exact answer for polynomials up to degree 2n−12n-1.

∫abf dx≈∑i=1nwif(xi)\int_a^b f\,dx \approx \sum_{i=1}^n w_i f(x_i)Gaussian quadrature with nn optimally chosen points and weights

Symbols

xix_iquadrature points (not evenly spaced)
wiw_ithe weight of each point

Example

With n=2n = 2 points, Gaussian quadrature gives an exact answer for all polynomials up to degree 2⋅2−1=32\cdot 2 - 1 = 3.

Gaussian quadrature needs far fewer points than trapezoid/Simpson for the same accuracy, but the points are not evenly spaced.
Practise interpolation and integration for free →

← Polynomial interpolation · Euler's method →

Part of Numerical Methods: Interpolation and integration.