Mathematica Journal
Volume 9, Issue 4


In This Issue
Tricks of the Trade
In and Out
Trott's Corner
New Products
New Publications
News Bulletins
New Resources

Download This Issue 

About the Journal
Editorial Policy
Staff and Contributors
Back Issues
Contact Information

Tricks of the Trade
Edited by Paul Abbott

Legendre-Gauss Quadrature

Gaussian quadrature gives the best estimate of an integral by picking optimal abscissas, , at which to evaluate the function . It is optimal because the -point formula is exact for polynomials of degree . Legendre-Gauss quadrature (see is a Gaussian quadrature over the interval with weighting function , that is,

where the abscissas, , for quadrature order , satisfy , and the weights are

Define the abscissas as the roots of using Root and save them as they are computed. This is an exact expression for the roots.

Define the weights. RootReduce expresses the weights as a single Root object. Save the weights as they are computed.

Here are the and for .

Here is and for , expressed as radicals.

Abscissas and weights for higher are better left as Root objects (see "Root versus Radicals," TMJ, 9(3), 2005, pp. 535-537). Note that, for fixed , each can be expressed as a particular root of a polynomial of degree .

Here are the weights for .

The weights satisfy . Here we check this for .

Now consider computing the integral of a polynomial of degree , denoted .

Compute the integral of over .

As expected, an identical answer is obtained using Legendre-Gauss quadrature with since .

About Mathematica | Download Mathematica Player
© Wolfram Media, Inc. All rights reserved.