Legendre-Gauss Quadrature formula
The Legendre-Gauss Quadratude formula is the approximation of the integral
- (1)
with special choice of nodes and weights , characterised in that, if the function is polynomial of order smaller than , then the exact equality takes place in equation (1).
The Legendre-Gauss quadratude formula is a special case of Gaussian quadratures which allow efficient approximation of a function with known asymptotic behavior at the edges of the interval of integration.
Nodes and weights
Nodes in equation (1) are zeros of the Polynomial of Legendre :
- (2)
- (3)
Weight in equation (1) can be expressed with
- (4)
There is no straightforward expression for the nodes ; they can be approximated to many decimal places through only few iterations, solving numerically equation (2) with initial approach
- (5)
These formulas are described in the books [1] [2]
Precision of the approximation
Example
In Fig.1, the decimal logarithm of the modulus of the residual of the appdoximation of integral with Gaussian quadrature is shown versus number of terms in the sum, for four examples of the integrand.
- (black)
- (red)
- (green)
- (blue)
The first of these functions is integrated "exactly" at , and the residual is determined by the rounding errors at the long double arithmetic. The second function (red) has branch points at the end of the interval; therefore, the approximation does not improve quickly at the increase of number terms in the sum. The last two functions are analytic within the range of integration; the residual decreases exponentially, and the precision of evaluation of the integral is limited only by the rounding errors.
Extension to other interval
is straightforward. Should I copypast the obvious formulas here?
References
- ↑ Abramovitz, Milton; I. Stegun (1964). Handbook of mathematical functions. National Bureau of Standards. ISBN 0-486-61272-4.
- ↑ W.H.Press, S.A.Teukolsky, W.T.Vetterling, B.P.Flannery (1988). Numerical Resipes in C. Cambridge University Press. ISBN 0-521-43108-5.