  Module

for

We wish to find the area under the curve .  What method gives the best answer if only two function evaluations are to be made?  We have already seen that the trapezoidal rule is a method for finding the area under the curve that uses two function evaluations at the endpoints (-1,f[-1]),  and  (1,f).  But if the graph of  y = f[x]  is concave, the error in approximation is the entire region that lies between the curve and the line segment joining the points.  If we are permitted to use the nodes and that lie inside the interval  [-1,1],  the line through the two points and crosses the curve, and the area under the line more closely approximates the area under the curve.  This method is attributed to Johann Carl Friedrich Gauss (1777-1855) and Adrien-Marie Legendre (1752-1833).  The line through .         The line through .

The equation of the line through the two points and is

(1) ,

and the area of the trapezoid under this line is

(2) .

Notice that the trapezoidal rule is a special case of (2).  When we choose and , and , .

The trapezoidal rule is ,

and it exact for straight lines  (i.e. ).

If the abscissas and = ,   and weights are used, we have the Gauss-Legendre 2 point quadrature rule ,

which exact for cubic polynomials (i.e. ).

Theorem (Gauss-Legendre Quadrature).  An approximation to the integral is obtained by sampling at the unequally spaced abscissas , where the corresponding weights are .
The abscissa's and weights for Gauss-Legendre quadrature are often expressed in decimal form.

n=2 Rule where  n=3 Rule where   n=4 Rule where    n=5 Rule where     Remark. For ease of reading the above list of rules has used the notation and instead of and , respectively.

Truth.

Theorem (Error for Gauss-Legendre Quadrature).  The error terms for the rules n = 2, 3, 4 and 5 can be expressed as follows:

n=2 Rule n=3 Rule n=4 Rule n=5 Rule Mathematica Subroutine (Gauss-Legendre Quadrature).

`````` ``````

Example 1.  Use the Gauss-Legendre quadrature rules for n = 2, 3, 4 and 5 points to compute numerical approximations for .
Solution 1.

Example 2.  For Example 3, compare the accuracy of the Trapezoidal Rule, Simpson's Rule, Simpson's Rule and Boole's Rule, with the Gauss-Legendre quadrature rules for n = 2, 3, 4 and 5 points, respectively.
Solution 2.

Example 3.  Use the Gauss-Legendre quadrature rules for n = 2, 3, 4 and 5 points to compute numerical approximations for .
Solution 3.

Example 4.  For Example 3, compare the accuracy of the Trapezoidal Rule, Simpson's Rule, Simpson's Rule and Boole's Rule, with the Gauss-Legendre quadrature rules for n = 2, 3, 4 and 5 points, respectively.
Solution 4.

The shifted Gauss-Legendre rule for [a,b].

Theorem (The Gauss-Legendre Translation).
Suppose that the abscissas and weights are given for the n-point Gauss-Legendre rule over [-1,1].  To apply the rule over the interval [a,b], use the change of variable .

Then the relationship is used to obtain the quadrature formula .

Algorithm  (The Gauss-Legendre Translation).  To approximate the integral use the change of variable . Then use and apply the Gauss-Legendre rules for .

`````` ``````

Example 5.  Use the shifted Gauss-Legendre rules for n = 3 points to compute approximations for the integrals .
Solution 5.

Various Scenarios and Animations for Gauss-Legendre Quadrature.

Example 6.  Let over .  Use Gauss-Legendre quadrature to approximate the value of the integral.
Solution 6.

Old Lab Project (Gauss-Legendre Quadrature  Gauss-Legendre Quadrature).  Internet hyperlinks to an old lab project.

Research Experience for Undergraduates

Gauss-Legendre Quadrature  Gauss-Legendre Quadrature  Internet hyperlinks to web sites and a bibliography of articles.

Return to Numerical Methods - Numerical Analysis

(c) John H. Mathews 2004