Lab 3 Riemann Sums and Estimation of Areas and Definite Integrals

MATH 2414 - Lab 3
Riemann Sums and Estimation of Areas and Definite Integrals
(Calculator Version)
Purpose:
This lab has three purposes:
• You will learn how to use your calculators to evaluate Riemann sums
• You will learn how using upper and lower sums can (sometimes) help you put a bound on how big the error in
your estimate of the integral is
• You will discover a relationship between the size of the error and the number of subintervals you have in your
Riemann sum
A new mathematical idea: upper and lower Riemann sums:
In this lab, we will move from the ideas of Left Sums and Right Sums to Lower Sums (LS) and Upper Sums
(U S). For the LS, instead of always picking the leftmost or rightmost y-value to define the value of the function in
the subinterval, we always pick the minimum y-value. Similarly, for the US we always use the maximum y-value in
the subinterval. We use these sums because we have the inequalities
Z
LS ≤
b
f (x) dx ≤ U S
a
Note that for increasing functions, LS are the Left Sums and US are the Right Sums.
To express these ideas in terms of Riemann Sums:
Riemann sum =
n
X
f (xi ∗) ∆x
i=1
If xi * gives the maximum value of f in the interval [xi−1 , xi ], we obtain the US and if it gives the minimum value,
we obtain the LS.
Using your calculators to evaluate Riemann sums:
We will be using two programs that can be copied from the instructor’s calculator to yours, INTEGRAL and
RIEMAN83. (You might also be interested in visiting www.ticalc.org, where you can download lotsa software for
your TI-83’s, tho’ you need a cable capable of connecting your calculator to a PC–see instructor if you’re interested.)
RIEMAN83 draws pictures for you and can help you understand how the sums are behaving, but takes longer because
of the picture drawing. INTEGRAL does just the calculation, but as a result, is sometimes faster. So which you
would use would depend on what you were shooting for, speed or comprehension. We’ll walk you through both. If
you haven’t yet had these programs transferred to your calculator, tell your instructor/TA and do so now.
1
Example: For the function f (x) =
subintervals.
1
x2 ,
find the Upper and Lower Sums in the interval [1, 2] for n = 100
For this example only, we’ll show you how to use both programs; after that, use either one you want. As we did
last week, when you see things written this way, that refers to a calculator button. When you see things written
THIS WAY, that’s something displayed in the calculator window.
RIEMAN83: Hit the prgm key, then choose RIEMAN83 from the menu shown. Your calculator will respond
prgmRIEMAN83, and just hit enter. The next screen just is an introduction to the program, you can read it or skip
it, and hit enter again. Next you’re asked to enter the function, which for this example is 1/x^2. Our lower bound
is 1 and our upper bound is 2. When it asks for partitions, use 4, not 100 (yet).
You should get a picture of the graph of x12 between x = 1 and x = 2. Now hit enter again, and choose Left
Sum from the menu. You should then see the picture of four “left” rectangles added to the picture, as well as the
resulting Riemann sum estimate, 0.60274, at the bottom. From the picture, you should be able to understand that
for this example, the Left Sums are the same as the Upper Sums we talked about above, since in each case the
y-value defined by the Left Sum is also the largest y-value in each subinterval. Hit enter again, and choose the
Right Sum this time. Again, you get a picture and estimate, in this case, 0.41524. It should (hopefully) be obvious
that in this case, the Right Sum is the same as the Lower Sum. Therefore, we have the following inequality:
Z 2
1
0.41524 ≤
dx ≤ 0.60274
2
1 x
Therefore: (i) if we take the average of 0.60274 with 0.41524, which is 0.50899, that should be a better estimate
than either the Left or the Right sum; and (ii) the difference between the true integral and the average estimate of
0.50899 should be no more than half the distance between 0.41524 and 0.60274, or 0.60274−0.41524
= 0.09375. We will
2
R2
refer to this quantity, 0.09375, as the maximum error we would have if we used 0.50899 to estimate 1 x12 dx.
Now go back and repeat this for n = 100 subintervals instead of 4 (just do Left Sums; you don’t also have to do
Right Sums). You can now see why this is a slow program when you have large numbers of intervals–it takes a long
time to draw in all those teensy rectangles. Use the menu to Quit the RIEMAN83 program.
INTEGRAL: Before you use this program, you have to have the function entered as Y1 . So, hit the y= button.
In this particular case, the RIEMAN83 program has already entered 1/x^2 from the last example, so you don’t have
to, but if you hadn’t just used RIEMAN83, you’d have to enter the function now. Then use the prgm key to start
the INTEGRAL program.
Since the function is already entered as Y1 , all you have to specify is the lower and upper limits, 1 and 2
respectively, and the number of divisions, which is 100. There will be a noticeable pause, but before too long (and
faster than for RIEMAN83), you’ll see the left and right estimates. If you hit enter again, you get some other
estimates we’ve mentioned in class: trapezoid, midpoint and (a new one) Simpson’s. For today, we’ll be focusing on
better understanding left and right sums, so we won’t pay attention to these other estimates, but we’ll look at them
more carefully when we’re in Chapter 7. However, you might notice that the trapezoid estimate is the same as the
average of the Left and Right Sums.
To turn in:
Problem #1: For this same function and interval as the example above, find an n that is a power of 10 such that
the maximum error in the estimation of the area using the average of the Left and Right Sums is no more than
0.001 = 10−3 .
Problem #2: In this problem, we’ll be working with
R π/2
0
sin (x) dx.
(a) For each n = 10, n = 100, n = 1000, n = 10000, compute the Upper and Lower sums, the estimate of the
integral based on their average, and the corresponding maximum error. Put your results in a table that might look
something like this:
2
n
LS US Estimate Maximum Error
10
100
1000
10,000
(b) What kind of relation is there between n and the maximum errors, or if you prefer, between ∆x and the
maximum errors?
Problem #3: Find an estimate of the area under the function y = sin (x) in the interval [0, π] with a maximum
error ≤ 0.001. Note that the function is not increasing or decreasing in the whole interval. Hint: divide the area
into pieces.
Problem #4: Estimate the following definite integral
Z
π
x2 + sin (x) dx
0
Use a Riemann sum with n = 1000, and choose xi ∗ to be the middle point in each subinterval. Can you say how
close is your answer to the definite integral? Explain why you cannot give an error bound in the same way you did
above.
3