Let f:[a,b]→R be integrable over [a,b] and divide [a,b] into nodes such as a=x1<⋯<xn=b.
In(f):=j=1∑nwjf(xj)≈∫abf(x)dx=I(f)
Calculating the weights wj of the defined In and computing the numerical integration this way is called Gaussian quadrature.
Explanation
As there is a guarantee that there exists a polynomial pn−1 that approximates f well, we consider pn−1 in place of f. Let’s call it w(x)=1 for convenience. [ NOTE: In this case, it is called Gauss-Legendre quadrature. ]
En(pn−1):=∫abpn−1(x)dx−j=1∑nwjpn−1(xj)
The defined error En is linear, therefore
En(pn−1)==En(a0+a1x+⋯+an−1xn−1)a0En(1)+a1En(x)+⋯+an−1En(xn−1)
Thus, regardless of what a0,a1,⋯,an−1 is, to find wj such that En(pn−1)=0, for all i=0,1,⋯,(n−1),
En(xi)=∫abxidx−j=1∑nwjxji=0
when written out explicitly
w1+⋯+wn=w1x1+⋯+wnxn=w1x12+⋯+wnxn2=⋮w1x1n−1+⋯+wnxnn−1=∫ab1dx∫abxdx∫abx2dx∫abxn−1dx
Represented as a matrix
1x1⋮x1n−11x2⋮x2n−1⋯⋯⋱⋯1xn⋮xnn−1w1w2⋮wn=∫ab1dx∫abxdx⋮∫abxn−1dx
Here, the existence of w1,⋯,wn is ensured by the Vandermonde determinant.
The advantage of the Gaussian quadrature is that, unlike the Newton-Cotes integration formulas, it doesn’t matter how the nodes are positioned.
Atkinson. (1989). An Introduction to Numerical Analysis(2nd Edition): p524. ↩︎