Function Repository Resource:

ChebyshevQuadratureAbscissas

Source Notebook

Get a numerically sorted list of abscissas for Chebyshev equal-weight quadrature

Contributed by: Jan Mangaldan

ResourceFunction["ChebyshevQuadratureAbscissas"][n,{a,b}]

gives a list of the n abscissas xi of the n-point Chebyshev equal-weight formula for quadrature on the interval a to b.

ResourceFunction["ChebyshevQuadratureAbscissas"][n,{a,b},prec]

uses the working precision prec.

Details

Chebyshev equal-weight quadrature approximates the value of an integral as a linear combination of values of the integrand evaluated at optimal abscissas xi: .
In Chebyshev quadrature, the abscissas are chosen such that the equation above is exact for all polynomials up to degree n if n is odd, and up to degree n+1 if n is even.

Examples

Basic Examples (2) 

The abscissas for a 9-point Chebyshev quadrature on a given interval:

In[1]:=
ResourceFunction["ChebyshevQuadratureAbscissas"][9, {-2, 9}]
Out[1]=

Use the specified precision:

In[2]:=
ResourceFunction["ChebyshevQuadratureAbscissas"][9, {-2, 9}, 20]
Out[2]=

Applications (4) 

Use Chebyshev quadrature to approximate the area under a curve:

In[3]:=
f = x |-> Cos[x] + 3 x^3 - x + 3
Out[3]=

Plot the curve over a given interval:

In[4]:=
Plot[f[x], {x, -0.5, 1.5}, Filling -> Axis, AxesOrigin -> {0, 0}]
Out[4]=

Approximate the area under the curve using n-point Chebyshev quadrature:

In[5]:=
area[n_] := (1.5 - (-0.5)) Mean[
   f /@ ResourceFunction["ChebyshevQuadratureAbscissas"][
     n, {-0.5, 1.5}]]
In[6]:=
area[5]
Out[6]=

Compare to the output of NIntegrate:

In[7]:=
NIntegrate[f[x], {x, -0.5, 1.5}]
Out[7]=
In[8]:=
Abs[% - area[9]]
Out[8]=

Properties and Relations (2) 

Chebyshev abscissas are purely real-valued only for n7 and n=9:

In[9]:=
Append[Table[{n, ResourceFunction["ChebyshevQuadratureAbscissas"][n, {-1, 1}]}, {n,
     7}], {9, ResourceFunction["ChebyshevQuadratureAbscissas"][
    9, {-1, 1}]}] // Column
Out[9]=

For other values of n, complex-valued Chebyshev abscissas appear:

In[10]:=
ResourceFunction["ChebyshevQuadratureAbscissas"][8, {-1, 1}]
Out[10]=

Neat Examples (1) 

Plot the 100-point Chebyshev quadrature abscissas in the complex plane:

In[11]:=
ComplexListPlot[
 ResourceFunction["ChebyshevQuadratureAbscissas"][100, {-1, 1}, 25]]
Out[11]=

Version History

  • 1.0.0 – 26 January 2021

Source Metadata

Related Resources

License Information