Class GaussLegendreQuadrature

  • All Implemented Interfaces:
    Integrator

    public class GaussLegendreQuadrature
    extends GaussianQuadrature
    Gauss-Legendre quadrature considers the simplest case of uniform weighting: \(w(x) = 1\). Hence, this method is useful for functions \(f(x)\) which can be approximated by polynomials. Therefore, this method is for finding the integral \[ \int_{-1}^1 f(x)\,dx \] where \(f(x)\) can be well approximated by a polynomial.

    For finding an integral over the interval [a,b], that is, \[ \int_{a}^b f(x)\,dx \] change of variable can be used.

    Generating evaluation points is done by finding roots of Legendre polynomials, hence the name of this method. Finding the roots has to be done numerically, but the coefficients can be computed directly. Since the roots lie within the open interval (-1, 1), the formulae are open integration formulae.

    See Also:
    Wikipedia: Gaussian quadrature - Gauss-Legendre quadrature
    • Constructor Detail

      • GaussLegendreQuadrature

        public GaussLegendreQuadrature​(int n)
        Create an integrator of order n.
        Parameters:
        n - the number of points in the quadrature rule