Application Center - Maplesoft

App Preview:

Numeric Integration: Trapezoid Rule

You can switch back to the summary page by clicking here.

Learn about Maple
Download Application


 

Image 

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 theImage buttons to watch the videos. 

Problem Statement 

Evaluate numerically the definite integral of Typesetting:-mrow(Typesetting:-mi( on the interval Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mn(. 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 Typesetting:-mrow(Typesetting:-mi(, 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>Typesetting:-mrow(Typesetting:-mi( and insert the limits of integration in the ensuing dialog box.  

 

HyperlinkImage 

 

Right-click on the definite integral, select Approximations and the number of digits desired. 

 

 

Typesetting:-mrow(Typesetting:-mi( 

sin(`*`(x, `*`(ln(x)))) (3.1)
 

Typesetting:-mover(Typesetting:-mo(Int(sin(`*`(x, `*`(ln(x)))), x = 1 .. 3)Typesetting:-mrow(Typesetting:-mi(1.1798 

 

 

 

 

 

 

To access Maple's built-in trapezoid rule, load the Student Calculus 1 package.  

 

Tools>Load package>Student Calculus 1. 

 

HyperlinkImage 

 

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.  

 

HyperlinkImage 

Typesetting:-mrow(Typesetting:-mi( 

sin(`*`(x, `*`(ln(x)))) (3.2)
 

 

 

Image 

Figure 1 The trapezoid rule applied to Typesetting:-mrow(Typesetting:-mi( 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 Typesetting:-mrow(Typesetting:-mi( and Typesetting:-mrow(Typesetting:-mi( and whose height is Typesetting:-mrow(Typesetting:-mi( 

 

Enter the expression for the area of this trapezoid and press [Enter] to obtain an equation label. 

 

HyperlinkImageTypesetting:-mrow(Typesetting:-mo( 

 

Typesetting:-mrow(Typesetting:-mi( 

`+`(`*`(`/`(1, 2), `*`(h, `*`(`+`(f(x[k]), f(x[`+`(k, 1)])))))) (3.3)
 

 

 

Sum the areas of six such trapezoids. 

 

Enter the expression for the sum of trapezoids for Typesetting:-mrow(Typesetting:-mi( using the sum template in the Expression palette and referencing the summand by its equation label. Press [Enter]. Factor the expression, (right-click, Factor).  

 

HyperlinkImage 

Typesetting:-mrow(Typesetting:-mi( 

`+`(`*`(`/`(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...
`+`(`*`(`/`(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...
(3.4)
 

Typesetting:-mover(Typesetting:-mo(`+`(`*`(`/`(1, 2), `*`(h, `*`(`+`(f(x[0]), `*`(2, `*`(f(x[1]))), `*`(2, `*`(f(x[2]))), `*`(2, `*`(f(x[3]))), `*`(2, `*`(f(x[4]))), `*`(2, `*`(f(x[5]))), f(x[6])))))) 

 

The generalization to Typesetting:-mrow(Typesetting:-mi( trapezoids is the following:  

 

Typesetting:-mrow(Typesetting:-mfrac(Typesetting:-mi(, 

where Typesetting:-mrow(Typesetting:-msub(Typesetting:-mi(.  

 

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.   

Image