Class GaussLegendre

java.lang.Object
org.episteme.core.mathematics.analysis.integration.GaussLegendre

public final class GaussLegendre extends Object
Gauss-Legendre Quadrature.

Approximates integrals using roots of Legendre polynomials as nodes. Exact for polynomials of degree 2n-1.

* @author Silvere Martin-Michiellot

Reference:
Gauss, C. F. (1814). Methodus nova integralium valores per approximationem inveniendi. Commentationes Societatis Regiae Scientiarum Gottingensis Recentiores.

Since:
1.0
Author:
Gemini AI (Google DeepMind)
  • Method Details

    • integrate

      public static Real integrate(Function<Real,Real> f, int n)
      Computes the integral of f(x) over [-1, 1] using n points.
      Parameters:
      f - function to integrate
      n - number of points
      Returns:
      integral value
    • integrate

      public static Real integrate(Function<Real,Real> f, Real a, Real b, int n)
      Computes the integral of f(x) over [a, b] using n points.

      Performs change of variables from [-1, 1] to [a, b].

      Parameters:
      f - function to integrate
      a - lower bound
      b - upper bound
      n - number of points
      Returns:
      integral value