Numeric Integration - Trapezoid Rule
? Maplesoft, a division of Waterloo Maple Inc., 2007
Introduction
This application is one of a collection of examples teaching Calculus with Maple. These applications use Clickable Calculus? methods to solve problems interactively. Steps are given at every stage of the solution, and many are illustrated using short video clips. Click on the
buttons to watch the videos.
Problem Statement
Evaluate numerically the definite integral of
on the interval
. Compare the results of Maple's built-in integrator with that produced by the trapezoid rule. Use Maple to investigate the derivation of the trapezoid rule.
Solution
Step
|
Result
|
Enter the expression for , then use the context menu to construct the definite integral and evaluate it with Maple's built-in integrator.
Form the expression for the function. Press [Enter]. Right-click, select Constructions>Definite Integral> and insert the limits of integration in the ensuing dialog box.
Right-click on the definite integral, select Approximations and the number of digits desired.
|
 |
(3.1) |
  
|
To access Maple's built-in trapezoid rule, load the Student Calculus 1 package.
Tools>Load package>Student Calculus 1.
|
Loading
Student:-Calculus1
|
Use Maple's Approximate Integration Tutor to explore the numerical evaluation of the integral via the trapezoid rule.
Use the equation label to obtain a copy of the integrand.
Right click on the integrand to access the Approximate Integration Tutor.
Select Tutors>Calculus-Single Variable>Approximate Integration. Enter the limits of integration. Set n to be the desired number of partitions and set "Partition Type" to "Normal." Select "Trapezoidal Rule" for the method of approximation. Click Display, (see Figure 1 below). Click Close to display the plot in the worksheet.
|
 |
(3.2) |
|
|
Figure 1 The trapezoid rule applied to via the Approximate Integration Tutor.
|
|
Derivation of the Trapezoid Rule
Step
|
Result
|
Enter the area of the single trapezoid whose parallel sides have lengths of and and whose height is
Enter the expression for the area of this trapezoid and press [Enter] to obtain an equation label.

|
![`+`(`*`(`/`(1, 2), `*`(h, `*`(`+`(f(x[k]), f(x[`+`(k, 1)]))))))](/view.aspx?SI=5174/43-NumericIntegration-TrapezoidRule_26.gif) |
(3.3) |
|
Sum the areas of six such trapezoids.
Enter the expression for the sum of trapezoids for using the sum template in the Expression palette and referencing the summand by its equation label. Press [Enter]. Factor the expression, (right-click, Factor).
|
![`+`(`*`(`/`(1, 2), `*`(h, `*`(`+`(f(x[0]), f(x[1]))))), `*`(`/`(1, 2), `*`(h, `*`(`+`(f(x[1]), f(x[2]))))), `*`(`/`(1, 2), `*`(h, `*`(`+`(f(x[2]), f(x[3]))))), `*`(`/`(1, 2), `*`(h, `*`(`+`(f(x[3]), f...](/view.aspx?SI=5174/43-NumericIntegration-TrapezoidRule_30.gif)
![`+`(`*`(`/`(1, 2), `*`(h, `*`(`+`(f(x[0]), f(x[1]))))), `*`(`/`(1, 2), `*`(h, `*`(`+`(f(x[1]), f(x[2]))))), `*`(`/`(1, 2), `*`(h, `*`(`+`(f(x[2]), f(x[3]))))), `*`(`/`(1, 2), `*`(h, `*`(`+`(f(x[3]), f...](/view.aspx?SI=5174/43-NumericIntegration-TrapezoidRule_31.gif) |
(3.4) |

|
The generalization to
trapezoids is the following:
,
where
.
Legal Notice: The copyright for this application is owned by Maplesoft. The application is intended to demonstrate the use of Maple to solve a particular problem. It has been made available for product evaluation purposes only and may not be used in any other context without the express permission of Maplesoft.