Quadrature Rules

All quadrature rules presented here attempt to approximate the 1D integral \(I(f)=\int_a^b f(x) dx\) using only a finite number of function values in the interval.

One-point Rule: Midpoint

Given only the function value at the midpoint \(m=\frac{a+b}{2}\), \(I(f)=\int_a^b f(x) dx\) is approximated as \(I(f)\approx M(f)\) where
$$ M(f)=(b-a)f(m)$$

Two-point Rule: Trapezoid

$$ T(f)=(b-a)(\frac{1}{2}f(a)+\frac{1}{2}f(b)) $$

Three-point Rule: Simpson

$$ S(f)=(b-a)\left(\frac{1}{6}f(a)+\frac{2}{3}f(m)+\frac{1}{6}f(b)\right) $$

N-point Rule

All three listed rules above have the nice form where the interval length \(b-a\) can be factored out. However, this is not generally true for a generic quadrature rule
$$ N(f)=\sum_{i=1}^N w_i f(p_i) $$