legendre_polynomial
    
    
    
      legendre_polynomial,
      a Octave 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:
    
    
      
      legendre_polynomial_test
    
    
      
      companion_matrix,
      an Octave code which
      computes the companion matrix for a polynomial.
      The polynomial may be represented in the standard monomial basis,
      or as a sum of Chebyshev, Gegenbauer, Hermite, Laguerre, or Lagrange
      basis polynomials.  All the roots of the polynomial can be determined as 
      the eigenvalues of the corresponding companion matrix.
    
    
      
      legendre_rule,
      a Octave code which
      computes a 1d Gauss-Legendre quadrature rule.
    
    
      
      matlab_polynomial,
      a Octave code which
      analyzes a variety of polynomial families, returning the polynomial
      values, coefficients, derivatives, integrals, roots, or other information.
    
    
      
      pce_legendre,
      a Octave code which
      assembles the system matrix of a 2d stochastic pde, 
      using a polynomal chaos expansion in terms of Legendre polynomials;
    
    
      
      polpak,
      a Octave code which
      evaluates a variety of mathematical functions.
    
    
      
      polynomial_conversion,
      a Octave code which
      converts representations of a polynomial between monomial, Bernstein,
      Chebyshev, Hermite, Lagrange, Laguerre and other forms.
    
    
      
      test_values,
      a Octave code which
      supplies test values of various mathematical functions.
    
    
      Reference:
    
    
      
        - 
          Theodore Chihara,
          An Introduction to Orthogonal Polynomials,
          Gordon and Breach, 1978,
          ISBN: 0677041500,
          LC: QA404.5 C44.
         
        - 
          Walter Gautschi,
          Orthogonal Polynomials: Computation and Approximation,
          Oxford, 2004,
          ISBN: 0-19-850672-4,
          LC: QA404.5 G3555.
         
        - 
          Frank Olver, Daniel Lozier, Ronald Boisvert, Charles Clark,
          NIST Handbook of Mathematical Functions,
          Cambridge University Press, 2010,
          ISBN: 978-0521192255,
          LC: QA331.N57.
         
        - 
          Gabor Szego,
          Orthogonal Polynomials,
          American Mathematical Society, 1992,
          ISBN: 0821810235,
          LC: QA3.A5.v23.
         
      
    
    
      Source Code:
    
    
      
        - 
          imtqlx.m,
          diagonalizes a symmetric tridiagonal matrix;
        
 
        - 
          legendre_to_monomial_matrix.m,
          returns a matrix that transforms a polynomial expansion from Legendre
          to monomial form.
        
 
        - 
          
          monomial_to_legendre_matrix.m,
          returns a matrix that transforms a polynomial expansion from monomial
          to Legendre form.
        
 
        - 
          p_exponential_product.m,
          exponential products for P(n,x).
        
 
        - 
          p_integral.m,
          evaluates a monomial integral associated with P(n,x).
        
 
        - 
          p_polynomial_coefficients.m,
          coefficients of Legendre polynomials P(n,x).
        
 
        - 
          p_polynomial_plot.m,
          plots one or more Legendre polynomials P(n,x).
        
 
        - 
          p_polynomial_prime.m,
          evaluates the derivative of Legendre polynomials P(n,x).
        
 
        - 
          p_polynomial_prime2.m,
          evaluates the second derivative of Legendre polynomials P(n,x).
        
 
        - 
          p_polynomial_value.m,
          evaluates the Legendre polynomials P(n,x).
        
 
        - 
          p_polynomial_values.m,
          selected values of the Legendre polynomials P(n,x).
        
 
        - 
          p_polynomial_zeros.m,
          zeros of Legendre function P(n,x).
        
 
        - 
          p_power_product.m,
          power products for Legendre polynomial P(n,x).
        
 
        - 
          p_quadrature_rule.m,
          quadrature for Legendre function P(n,x).
        
 
        - 
          pm_polynomial_value.m,
          evaluates the Legendre polynomials Pm(n,m,x).
        
 
        - 
          pm_polynomial_values.m,
          returns values of Legendre polynomials Pm(n,m,x).
        
 
        - 
          pmn_polynomial_value.m,
          evaluates the normalized Legendre polynomials Pmn(n,m,x).
        
 
        - 
          pmns_polynomial_value.m,
          evaluates the sphere normalized Legendre polynomials Pmns(n,m,x).
        
 
        - 
          pn_pair_product.m,
          pair products for normalized Legendre polynomial Pn(n,x).
        
 
        - 
          pn_polynomial_coefficients.m,
          coefficients of the normalized Legendre polynomials Pn(n,x).
        
 
        - 
          pn_polynomial_value.m,
          evaluates the normalized Legendre polynomials Pn(n,x).
        
 
        - 
          pn_polynomial_values.m,
          selected values of the normalized Legendre polynomials Pn(n,x).
        
 
        - 
          r8_sign.m,
          returns the sign of an R8.
        
 
        - 
          r8mat_print.m,
          prints an R8MAT;
        
 
        - 
          r8mat_print_some.m,
          prints some of an R8MAT;
        
 
        - 
          r8vec_linspace.m,
          creates a column vector of linearly spaced values.
        
 
        - 
          r8vec_print.m,
          prints an R8VEC;
        
 
        - 
          r8vec2_print.m,
          prints a pair of R8VEC's;
        
 
      
    
    
    
      Last revised on 12 January 2021.