Reimann Sums and Integrals with Maple
Maple can do both sums and limits. We give some examples.
| > | sum(k^2-k,k=1..500); |
| > | sum(1/k^2,k=1..100); |
| > | evalf(%); |
Write out these sums in Sigma notation. Next we do limits.
| > | limit(tan(3*x)*sin(2*x)/x^2,x=0); |
| > | limit((1+2/n)^n, n=infinity); |
You of course already knew how to do these! Now watch this:
| > | limit(sum(1/k^2,k=1..m),m=infinity); |
Now we set up a Reimann sum for the area under x^5 from 2 to 7 using right end points.
Let's do the sum for n=5, n=50, n=100, and n=1000.
| > | n:=5; |
| > | sum((2+i*(5/n))^5*(5/n),i=1..n); |
| > | n:=50; |
| > | sum((2+i*(5/n))^5*(5/n),i=1..n); |
| > | evalf(%); |
| > | n:=100; |
| > | evalf(sum((2+i*(5/n))^5*(5/n),i=1..n)); |
| > | n:=1000; |
| > | evalf(sum((2+i*(5/n))^5*(5/n),i=1..n)); |
Now watch this: (We m instead of n, since once we assign n a fixed value, Maple will not let us use it as a varying index.)
| > | limit(evalf(sum((2+i*(5/m))^5*(5/m),i=1..m)),m=infinity); |
We compare with the definite (although you should check this result by hand):
| > | int(x^5,x=2..7); |
| > | evalf(%); |
Problem 1: What is the smallest value of n such that this Reimann sum is correct when rounded to one decimal place?
Problem 2: Set up a Reimann sum using the mid points. Now how many terms do you need to be correct when rounded to one decimal place?
Problem 3: Read section 7.7 of your textbook. Use the Trapezoidal Rule to approximate the integral. How many terms to you need to be correct when rounded to one decimal place?