Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Get a numerically sorted list of abscissa-weight pairs for generalized Gaussian quadrature
ResourceFunction["GeneralizedGaussianQuadratureWeights"][n,poly] gives a list of the n pairs {xi,wi} of the elementary n-point Gaussian quadrature formula associated with the orthogonal polynomial represented by poly, where wi is the weight of the abscissa xi. | |
ResourceFunction["GeneralizedGaussianQuadratureWeights"][n,poly,prec] uses the working precision prec. |
| "ChebyshevFirst" | Gauss–Chebyshev quadrature of the first kind, |
| "ChebyshevSecond" | Gauss–Chebyshev quadrature of the second kind, |
| "Hermite" | Gauss–Hermite quadrature, |
| "Laguerre" | Gauss–Laguerre quadrature, |
| "Legendre" | Gauss–Legendre quadrature, |
| {"Gegenbauer",m} | Gauss–Gegenbauer quadrature, |
| {"Laguerre",a} | generalized Gauss–Laguerre quadrature, |
| {"Jacobi",a,b} | Gauss–Jacobi quadrature, |
Generate the abscissas and weights for three-point Gauss–Legendre quadrature:
| In[1]:= |
| Out[1]= |
Use 25-digit precision:
| In[2]:= |
| Out[2]= | ![]() |
Generate a four-point Gauss-Jacobi quadrature with specific values of a and b:
| In[3]:= |
| Out[3]= |
An equivalent specification:
| In[4]:= |
| Out[4]= |
Use generalized Gauss–Laguerre quadrature to approximate the integral
:
| In[5]:= |
| Out[5]= |
Compare with the exact answer:
| In[6]:= |
| Out[6]= |
This work is licensed under a Creative Commons Attribution 4.0 International License