Function Repository Resource:

Get a numerically sorted list of abscissa-weight pairs for various modifications of Gaussian quadrature

Contributed by: Jan Mangaldan
 ResourceFunction["ModifiedGaussianQuadratureWeights"][type,n] gives a list of the n pairs {xi,wi} of the n-point modified Gaussian formula for quadrature on the interval -1 to 1, where wi is the weight of the abscissa xi. ResourceFunction["ModifiedGaussianQuadratureWeights"][type,n,{a,b}] rescales the Gaussian formula for the interval a to b. ResourceFunction["ModifiedGaussianQuadratureWeights"][type,n,{a,b},prec] uses the working precision prec.

## Details

Modified Gaussian quadrature approximates the value of an integral as a linear combination of values of the integrand evaluated at optimal abscissas xi: .
Modified Gaussian quadrature formulae are obtained as appropriate modifications of the usual Gauss-Legendre quadrature formula to incorporate endpoint or error information.
The following modification types are supported:
The precision argument acts similarly to the WorkingPrecision option used in many Wolfram Language numeric functions; it is not at all like the PrecisionGoal option. If the n argument is too small to allow for a high-precision result, extra precision in a result will not be meaningful.

## Examples

### Basic Examples (3)

The abscissas and weights for a 10-point Lobatto quadrature rule:

 In[1]:=
 Out[1]=

Lobatto quadrature rule over the interval 0 to 1:

 In[2]:=
 Out[2]=

Use the specified precision:

 In[3]:=
 Out[3]=

### Scope (2)

The abscissas and weights for a 10-point anti-Gaussian rule:

 In[4]:=
 Out[4]=

The "RadauLeft" and "RadauRight" rules are basically reflections of each other over the integration interval:

 In[5]:=
 Out[5]=
 In[6]:=
 Out[6]=

### Applications (3)

Use the modified Gaussian quadrature to approximate the area under a curve:

 In[7]:=

Compare the results of the various modifications with classical Gaussian quadrature for a fixed n:

 In[8]:=
 Out[8]=

Compare with the result of NIntegrate by computing the absolute error:

 In[9]:=
 Out[9]=

## Version History

• 1.0.0 – 03 May 2021