Skip to content

Gaussian quadrature

Gaussian quadrature chooses nodes and weights for polynomial exactness. Derive the two-point Gauss–Legendre rule, map its interval and see its first failure.

Gaussian quadrature is a family of numerical integration rules that chooses both sampling locations and weights to integrate polynomials of the highest possible degree for a given number of evaluations. An nn-point Gaussian rule is exact through degree 2n−12n-1, for its specified interval and weight function, in exact arithmetic.

That economy matters when evaluating an integrand is expensive: one value may itself require a pricing calculation. But polynomial exactness is a property of the integration rule. It does not validate the payoff, probability model or market inputs being integrated.

Moving the sample points

The most familiar case is Gauss–Legendre quadrature, for an ordinary, unweighted definite integral on a finite interval. On [−1,1][-1,1], its two-point rule is
∫−11f(t) dt≈f ⁣(−13)+f ⁣(13).\int_{-1}^{1}f(t)\,dt\approx f\!\left(-\frac{1}{\sqrt{3}}\right)+f\!\left(\frac{1}{\sqrt{3}}\right).

Neither sample is an endpoint or the midpoint. To see where these points come from, impose symmetry: take nodes −c,c-c,c and equal weights ww. Exactness for the constant function gives 2w=22w=2, hence w=1w=1. Exactness for t2t^2 then requires 2c2=2/32c^2=2/3, hence c=1/3c=1/\sqrt{3}. Odd powers through the cubic integrate to zero and their weighted values cancel. The rule therefore integrates every cubic, not just the four individual monomials.

More generally, the Gauss–Legendre nodes are the roots of the degree-nn Legendre polynomial. Those polynomials are orthogonal under integration on [−1,1][-1,1]. This is why a carefully selected set of nodes can deliver more polynomial exactness than arbitrary fixed nodes with weights alone. Polynomial interpolation supplies the underlying connection between sampled values and integrated polynomials.

Two values on zero to one

Changing intervals also changes the weights. With

x=a+b2+b−a2t,dx=b−a2 dt,x=\frac{a+b}{2}+\frac{b-a}{2}t,\qquad dx=\frac{b-a}{2}\,dt,

the mapped rule is

Qn=b−a2∑i=1nwi f ⁣(a+b2+b−a2ti).Q_n=\frac{b-a}{2}\sum_{i=1}^{n}w_i\, f\!\left(\frac{a+b}{2}+\frac{b-a}{2}t_i\right).

The factor (b−a)/2(b-a)/2 is essential. For [0,1][0,1], the two sample locations and their mapped weights are

x−=12−123≈0.211325,x+=12+123≈0.788675,W−=W+=12.x_-=\frac12-\frac{1}{2\sqrt3}\approx0.211325,\qquad x_+=\frac12+\frac{1}{2\sqrt3}\approx0.788675,\qquad W_-=W_+=\frac12.

Take two synthetic dimensionless functions. Use the actual irrational nodes, rather than their rounded labels:

IntegrandTwo-point estimate Q2Q_2Exact integral IISigned error Q2−IQ_2-I
x3x^31/41/41/41/400
x4x^47/36≈0.1944444447/36\approx0.1944444441/5=0.21/5=0.2−1/180≈−0.005555556-1/180\approx-0.005555556
Two-point Gauss–Legendre on zero to one samples 0.211325 and 0.788675 with weight one half each. The cubic integral is exactly one quarter; the quartic estimate seven thirty-sixths understates one fifth by one one-hundred-eightieth.
Two-point Gauss–Legendre on zero to one samples 0.211325 and 0.788675 with weight one half each. The cubic integral is exactly one quarter; the quartic estimate seven thirty-sixths understates one fifth by one one-hundred-eightieth.
Original dimensionless benchmark. The same two nodes integrate the cubic exactly but miss the quartic. Filled dots show evaluated values; shaded areas show the true integrals.

The cubic result does not mean that two points reconstruct the whole cubic curve. They recover its integral. The quartic is the first degree outside this rule's exactness guarantee; three-point Gauss–Legendre would integrate that quartic exactly. Floating-point calculations should report agreement within a stated tolerance, even for a mathematically exact case.

Match the rule to the integral

“Gaussian” here refers to Gauss's quadrature construction, not an assumption that the variable follows a normal distribution. Gauss–Legendre uses weight function 11 on [−1,1][-1,1]. Gauss–Hermite instead uses the weight e−t2e^{-t^2} on the whole real line. Their nodes and weights cannot be exchanged unchanged. Normal expectations require the appropriate density scaling and change of variables.
For a finite-support continuous model, an expected value has the form
E[g(X)]=∫abg(x)p(x) dx.\mathbb{E}[g(X)]=\int_a^b g(x)p(x)\,dx.

Applying Gauss–Legendre here means evaluating the entire product g(x)p(x)g(x)p(x). Cubic exactness concerns that product, not the payoff gg alone. If the original distribution has infinite support, cutting the domain to [a,b][a,b] introduces a separate tail-truncation error.

Smooth integrands often suit Gaussian rules. A payoff kink, discontinuity or singularity deserves attention before increasing the order: splitting at a known feature or choosing a rule adapted to the weight may work better. Composite quadrature describes interval subdivision and can also be combined with local Gaussian rules. A higher polynomial degree of exactness is no universal accuracy ranking across all integrands.
For the financial expectation setup and a transparent trapezoid baseline, read Root-Finding and Numerical Integration (public preview; full lesson requires membership).

Sources

Last updated
  • quadrature
  • numerical integration
  • gauss legendre
  • polynomial exactness
  • change of variables
← Back to the glossaryBack to top ↑