[Math] The quadrature weights for the trapezoid and the Simpsons rule

computational mathematicsintegrationlinear algebra

How to derive the quadrature weights for the trapezoid and the Simpsons rule?

Trapeziod rule:$\int\limits_a^b f(x)$$\approx$$\frac{b-a}{2}$[f(a)+f(b)]

Simpson's rule:$\int\limits_a^b f(x)$$\approx$$\frac{b-a}{6}$[f(a)+4f((a+b)/2)+f(b)]

I know the definition of the quadrature weights is $\omega_i$=$\int\limits_a^b$ $l_i$(x) dx, but still have no idea to do this question.

Best Answer

The Trapezoid and Simpson's rules are Newton-Cotes formulae. Derivation of the weights come from integrating Lagrange basis polynomials. Let $L(x)$ be a lagrange polynomial which interpolates $f(x)$ at $n+1$ points, $x_0, x_1, ... x_n$. Then

$$ \int_a^b f(x) dx \approx \int_a^b L(x) dx = \int_a^b \sum_{i=0}^n f(x_i) l_i (x) dx = \sum_{i = 0}^n f(x_i)\int_a^b l_i (x) dx,$$ and here $\int_{a}^b l_i (x) dx$ is the weight for the $i$-th interpolation point.

You can read more here:

https://en.wikipedia.org/wiki/Newton%E2%80%93Cotes_formulas

https://en.wikipedia.org/wiki/Lagrange_polynomial

The trapezoid rule comes from interpolating $f(x)$ using 2 points. Simpson's rule comes from interpolating $f(x)$ using 3 points.