legendre_polynomial


legendre_polynomial, a Python code which evaluates the Legendre polynomial and associated functions.

The Legendre polynomial P(n,x) can be defined by:

        P(0,x) = 1
        P(1,x) = x
        P(n,x) = (2*n-1)/n * x * P(n-1,x) - (n-1)/n * P(n-2,x)
      
where n is a nonnegative integer.

The N zeroes of P(n,x) are the abscissas used for Gauss-Legendre quadrature of the integral of a function F(X) with weight function 1 over the interval [-1,1].

The Legendre polynomials are orthogonal under the inner product defined as integration from -1 to 1:

        Integral ( -1 <= x <= 1 ) P(i,x) * P(j,x) dx 
          = 0 if i =/= j
          = 2 / ( 2*i+1 ) if i = j.
      

Licensing:

The information on this web page is distributed under the MIT license.

Languages:

legendre_polynomial is available in a C version and a C++ version and a Fortran90 version and a MATLAB version and an Octave version and a Python version.

Related Data and Programs:

polpak, a Python code which evaluates a variety of mathematical functions.

polynomial_conversion, a Python code which converts representations of a polynomial between monomial, Bernstein, Chebyshev, Hermite, Lagrange, Laguerre and other forms.

python_polynomial, a Python code which analyzes a variety of polynomial families, returning the polynomial values, coefficients, derivatives, integrals, roots, or other information.

test_values, a python code which supplies test values of various mathematical functions.

Source Code:


Last revised on 27 January 2020.