MATH 163, Spring 2001 Due Date: Name(s): Project 5.1a: Integration: Riemann Sums Objective To illustrate how Maple can be used to approximate an area using Riemann sums. Narrative If you have not already done so, read Section 5.1 of the text. Finding the area under a curve using Riemann sums, while being conceptually straightforward, can be computationally challenging. In this project you will see how Maple can be used to simplify computations. In this project we introduce the commands: sum(E(i),i=1..n) The numerical value of the sum of E(i) from i = 1 to i = n. Sum(E(i),i=1..n) The symbol for the sum of E(i) from i = 1 to i = n. int(f(x),x=a..b) The numerical value of the definite integral b x=a f(x) dx. Int(f(x),x=a..b) The symbol for the definite integral b x=a f(x) dx. Task a) Type the command lines in the left-hand column below into Maple in the order in which they are listed. These commands are aimed at finding the area under the graph of f(x) = x2 + x from x = 1 to x = 3. The effect of each command is described in the right-hand column for your reference. Your lab report will be a hard copy of your typed input and Maple's responses (both text and graphics). > # Project 5.1a: Integration: Riemann Sums > restart; Clear Maple's memory. > f := x -> x^2+x; Let f(x) = x2 + x. > a := 1; b := 3; Let a = 1 and b = 3. > dx := (b-a)/n; Let dx = (b - a)/n. > LHSum := sum(f(a+i*dx)*dx,i=0..n-1); Let LHSum denote the left-hand Riemann sum. > MPSum := sum(f(a+(2*i-1)*dx/2)*dx,i=1..n); Let MPSum denote the midpoint Riemann sum. > RHSum := sum(f(a+i*dx)*dx,i=1..n); Let RHSum denote the right-hand Riemann sum. b) Continue by typing the command line in the left-hand column below into Maple. > plot(f(x),x=a..b); %; %; Draw the graph of f, not just once or twice, but three times! Later, after you have made a hard copy of your typed input and Maple's responses, you will be asked to draw the rectangles and "sample points" (x i , f(x i )) used to compute LHSum, MPSum, and RHSum for n = 4 on these graphs. c) Continue by typing the command lines in the left-hand column below into Maple in the order in which they are listed. These commands allow us to investigate LHSum, MPSum, and RHSum as n goes to . > for n from 4 to 204 by 20 do print(n,evalf(LHSum),evalf(MPSum),evalf(RHSum)) od: > n := ´n´; Redefine n as a variable. > evalf(limit(LHSum,n=infinity)); Compute the limit of LHSum as n goes to . > evalf(limit(MPSum,n=infinity)); Compute the limit of MPSum as n goes to . > evalf(limit(RHSum,n=infinity)); Compute the limit of RHSum as n goes to . > Int(f(x),x=a..b) = evalf(int(f(x),x=a..b)); Find b x=a f(x) dx. At this time make a hard copy of your typed input and Maple's responses. Then, ... d) on the graphs you produced in part (b), draw the rectangles, and plot and label the "sample points" (x i , f(x i )), used to compute LHSum, MPSum, and RHSum for n = 4. Comments 1. Over the interval [1, 3], f(x) = x2 +x is increasing (can you see why?); thus the right-hand Riemann sum is associated with circumscribed rectangles, and the left-hand Riemann sum is associated with inscribed rectangles. Over the interval [-3, -1], on the other hand, f(x) = x2 + x is decreasing (can you see why?); thus here the right-hand Riemann sum is associated with inscribed rectangles, and the left-hand Riemann sum is associated with circumscribed rectangles. 2. Observe that the values of LHSum, MPSum and RHSum are not necessarily the same for any finite n, but they get closer and closer to each other as n gets larger and larger, and their limits (as n goes to ) are all the same. 3. As indicated above, in addition to the command sum(E(i),i=1..n) there is a command Sum(E(i),i=1..n). Although we have not used it in this project, the difference between sum) and Sum) is that the former automatically expands and simplifies the sum, while the later does not: after using the later, you must expand and simplify it yourself if you want it done. (The value of the later command is that the former does not always work, so if you want to do your own simplification, you can.)