1.Gauss quadrature

Recall that the method of moments approach to numerical integration based upon sampling 𝒟={(xi,yi=f(xi)),i=0,,n},

abω(t)f(t)dt=i=0nwiyi+ei=0nwiyi,

imposes exact results for a finite number of members of a basis set {ϕ0,,ϕn,}

abω(t)ϕk(t)dt=i=0nwiϕk(xi),k=0,1,,n.

The trapezoid, Simpson formulas arise from the monomial basis set {1,t,t2,}, in which case

abω(t)tkdt=i=0nwixik,k=0,1,,n,

but any basis set can be chosen. Instead of prescribing the sampling points xi a priori, which typically leads to an error e=𝒪(ϕn+1(t)), the sampling points can be chosen to minimize the error e. For the monomial basis this leads to a system of 2(n+1) equations

abω(t)tkdt=i=0nwixik,k=0,1,,2n+1,

for the unknown n+1 quadrature weights wi and the n+1 sampling points xi. The system is nonlinear, but can be solved in an insightful manner exploiting the properties of orthogonal polynomials known as Gauss quadrature.

The basic idea is to consider a Hilbert function space with the scalar product

(f,g)=abω(t)f(t)g(t)dt,

and orthonormal basis set {ϕ0(t),ϕ1(t),ϕ2(t),,},

(ϕj,ϕk)=abω(t)ϕj(t)ϕk(t)dt=δjk.

Assume that ϕk(t) are polynomials of degree k. A polynomial p2n+1 of degree 2n+1 can be factored as

p2n+1(t)=qn(t)ϕn+1(t)+rn(t),

where qn(t) is the quotient polynomial of degree n, and rn is the remainder polynomial of degree n. The weighted integral of p2n+1 is therefore

abω(t)p2n+1(t)dt=abω(t)[qn(t)ϕn+1(t)+rn(t)]dt=(qn,ϕn+1)+abω(t)rn(t)dt.

Since {ϕ0,,ϕn+1} is an orthonormal set, (qn,ϕn+1)=0, and the integral becomes

abω(t)p2n+1(t)dt=abω(t)rn(t)dt.

The integral of the nth remainder polynomial can be exactly evaluated through an n+1 point quadrature

abω(t)rn(t)dt=i=0nwir(xi),

that however evaluates r(t) rather than the original integrand p2n+1(t). However, evaluation of the factorization (1) at the roots xi of ϕn+1, ϕn+1(xi)=0, i=0,1,,n, gives

p2n+1(xi)=qn(xi)ϕn+1(xi)+rn(xi)=rn(xi),

stating that the values of the remainder at these nodes are the same as those of the p2n+1 polynomial. This implies that

abω(t)p2n+1(t)dt=i=0nwip2n+1(xi),

is an exact quadrature of order 2n+1, e=𝒪(t2n+1). The weights wi can be determined through any of the previously outlined methods, e.g., method of moments

abω(t)tkdt=i=0nwixik,k=0,,n,

which is now a linear system that can be readily solved. Alternatively, the weights are also directly given as integrals of the Lagrange polynomials based upon the nodes that are roots of ϕn+1

wi=abω(t)i(t)dt.