Gauss–Laguerre quadrature

In numerical analysis Gauss–Laguerre quadrature (named after Carl Friedrich Gauss and Edmond Laguerre) is an extension of the Gaussian quadrature method for approximating the value of integrals of the following kind:

In this case

where xi is the i-th root of Laguerre polynomial Ln(x) and the weight wi is given by

The following Python code with the SymPy library will allow for calculation of the values of and to 20 digits of precision:

from sympy import *

def lag_weights_roots(n):
    x = Symbol("x")
    roots = Poly(laguerre(n, x)).all_roots()
    x_i = [rt.evalf(20) for rt in roots]
    w_i = [(rt / ((n + 1) * laguerre(n + 1, rt)) ** 2).evalf(20) for rt in roots]
    return x_i, w_i

print(lag_weights_roots(5))
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.