MAPLE HELPSHEETS: Approximating Areas / Integrals

MAPLE:   Approximating Areas / Integrals


Some key commands are:

leftbox rightbox middlebox
leftsum rightsum middlesum
trapezoid simpson
value evalf

NOTE:   First you must load the necessary commands by entering:

> with( student ) ;


I.   Graphing Regions & Rectangles

Example:   Suppose we want to graph the region bound between the function

f (x) = 4 – x2,

the x axis, and the vertical lines x = –1, x = 2, and show rectangles.

> f := 4 - x^2 ;   defines function f as an expression

> rightbox( f , x = -1.0 .. 2.0, 6 ) ;   plots f showing 6 right–endpoint rectangles

> leftbox( f , x = -1.0 .. 2.0 , 12 ) ;   plots f showing 12 left–endpoint rectangles

> middlebox( f , x = -1.0 .. 2.0 , 10 ) ;   plots f showing 10 midpoint rectangles


II.   Approximating Areas of Regions Using Rectangles

Example:   Suppose we want to approximate the area of the region bound between the function

f (x) = 4 – x2,

the x axis, and the vertical lines x = –1 and x = 2.

> f := 4 - x^2 ;   defines function f as an expression

> R := rightsum( f , x = -1.0 .. 2.0 , 6 ) ;   using 6 right–endpoint rectangles

> value( R ) ;   numerical value of the result R

> evalf( R ) ;   decimal value of the result R

> L := leftsum( f , x = -1.0 .. 2.0 , 12 ) ;   using 12 left–endpoint rectangles

> value( L ) ;   numerical value of the result L

> evalf( L ) ;   decimal value of the result L

> M := middlesum( f , x = -1.0 .. 2.0 , 10 ) ;   using 10 midpoint rectangles

> evalf( M ) ;   decimal value of the result M


III.   Approximating Areas / Integrals Using the Trapezoidal Rule

Example:   Suppose we want to approximate the area of the region bound between the function

f (x) = ex2,

the x axis, and the vertical lines x = –1 and x = 2.

> f := exp( -x^2 ) ;   defines function f as an expression

> T := trapezoid( f , x = -1.0 .. 2.0 , 6 ) ;   using 6 subintervals

> evalf( T ) ;   decimal value of the result T


IV.   Approximating Areas / Integrals Using Simpson's (1/3) Rule

Note: &nsbp; The number of subintervals must be even.

Example:   Suppose we want to approximate the area of the region bound between the function

f (x) = ex2,

the x axis, and the vertical lines x = –1 and x = 2.

> f := exp( -x^2 ) ;   defines function f as an expression

> S := simpson( f , x = -1.0 .. 2.0 , 6 ) ;   using 6 subintervals

> evalf( S ) ;   decimal value of the result S


V.   Exact Areas Using Limits

Example:   Determine the exact area of the region bound between the function

f (x) = 4 – x2,

the x axis, and the vertical lines x = –1 and x = 2.

> n:='n';   resets n in case it was previously assigned a value

> f := 4 - x^2 ;   defines function f as an expression

> approx := rightsum( f , x = -1.0 .. 2.0 , n ) ;   uses n right–endpoint rectangles

> Riemann := value( approx ) ;   simplifies the sums and calls result Riemann

> area := limit( Riemann , n = infinity ) ;   lets the number of rectangles go to infinity


NOTE:   For many other commands common to student use, enter

> ?student;


Go to the Maple Help Sheet Index

Written and Maintained by

Prof. Kevin G. TeBeest
Applied Mathematics
Kettering University

Last modified: 03/28/2020

Maple® is a registered trademark of Waterloo Maple Software.

Copyright © 1997–2023 Kevin G. TeBeest. All rights reserved.