Skip to main content

5.4 Gaussian quadrature

Source: Ideas from Computational Physics (Landau, Páez, Bordeianu), §5.4. Rewritten in original wording. Continues 5.3 Integration. Labs: 5.4b Gaussian quadrature labs.

Weighting function and exactness for high-degree polynomials​

Rewrite the basic weighted sum by splitting off a weight W(x)W(x) from a smoother piece g(x)g(x):

∫abf(x) dx≡∫abW(x) g(x) dx≃∑i=1Nwi g(xi).\int_a^b f(x)\,dx\equiv\int_a^b W(x)\,g(x)\,dx\simeq\sum_{i=1}^{N} w_i\,g(x_i).

Gaussian quadrature chooses both the nodes xix_i and the weights wiw_i so the rule is exact whenever gg is a polynomial of degree at most 2N−12N-1. That is an extraordinary bargain: NN evaluations match what a naive equal-spacing rule would need far more points to approach. The price is that the xix_i are not equally spaced — and, for the classical families, never sit exactly at the endpoints aa or bb. Different NN give entirely different node sets.

If gg is smooth (or can be made smooth by peeling WW off a singular or peaked factor), Gauss usually beats trapezoid / Simpson at the same NN. If the integrand changes character across the domain, split the integral and add the pieces — “smart” library integrators do that automatically.

IntegralName
∫−11f(y) dy\int_{-1}^{1} f(y)\,dyGauss–Legendre
∫−11F(y)/1−y2 dy\int_{-1}^{1} F(y)/\sqrt{1-y^{2}}\,dyGauss–Chebyshev
∫−∞∞e−y2F(y) dy\int_{-\infty}^{\infty} e^{-y^{2}} F(y)\,dyGauss–Hermite
∫0∞e−yF(y) dy\int_0^{\infty} e^{-y} F(y)\,dyGauss–Laguerre
∫0∞e−yy−1/2F(y) dy\int_0^{\infty} e^{-y} y^{-1/2} F(y)\,dyAssociated Gauss–Laguerre

For ordinary Gauss–Legendre on [−1,1][-1,1], the nodes are the zeros of the Legendre polynomial PNP_N, and the weights involve PN′P_N':

PN(yi)=0,wi=2(1−yi2)[PN′(yi)]2.P_N(y_i)=0, \qquad w_i=\frac{2}{(1-y_i^{2})\bigl[P_N'(y_i)\bigr]^{2}}.

Libraries, classical tables, or a short root finder will produce (yi,wi)(y_i,w_i). A four-point check set (positive half; mirror with ±\pm):

±yi\pm y_iwiw_i
0.3399810435848560.3399810435848560.6521451548625460.652145154862546
0.8611363115940530.8611363115940530.3478548451374540.347854845137454

Sum of all four weights on [−1,1][-1,1] is 22 (integral of 11).

Mapping Gaussian points​

Elementary Gauss–Legendre data live on −1<yi<1-1<y_i<1. Write (yi,wi′)(y_i,w_i') for the reference nodes/weights on [−1,1][-1,1]. Walk each target interval — pick the matching map equation (lookalikes included).

Derivation sketch (Gauss–Legendre)​

Walk the argument one sentence at a time — at each step pick the matching equation (two lookalikes included).

Coda. Nodes = zeros of PNP_N kill the qq term in the discrete sum. The classical weights

wi=2(1−yi2)[PN′(yi)]2w_i=\frac{2}{(1-y_i^{2})\bigl[P_N'(y_i)\bigr]^{2}}

then make the rule exact for every polynomial of degree ≤2N−1\le 2N-1.

Quiz

Gaussian quadrature

1 / 3

Order the Gauss–Legendre exactness argument (top = first).

OrderDrag the handle to rearrange — top should be first.

  1. 1Write f = q P_N + r; orthogonality ⇒ ∫f = ∫r
  2. 2Want ∫f = Σ w_i f(x_i) exact for deg ≤ 2N−1
  3. 3Expand Σ w_i f(x_i) = Σ w_i q P_N + Σ w_i r
  4. 4Pick nodes as zeros of P_N so the q-sum vanishes

Drag items into the correct order (or use ↑↓), then check.

Next: 5.4b Gaussian quadrature labs.