<<

Math 242 Lab Sums &

1 Part I: Riemann Sums

1.1 Sigma notation One strategy for calculating the area of a region is to cut the region into simple shapes, calculate the area of each simple shape, and then add these smaller areas together to get the area of the whole region. We will use that approach, but it is useful to have a notation for adding a lot of values together: the sigma (Σ) notation. The function to the right of the sigma is called the summand, and the numbers below and above the sigma are called the lower and upper limits of the .

Summation A way to read Sigma notation the sigma notation notation 2 2 2 2 2 5 2 1 + 2 + 3 + 4 + 5 the sum ofk squared k=1 k fork equals 1 tok equals 5 1 1 1 1 1 �7 1 3 + 4 + 5 + 6 + 7 the sum of 1 overk k=3 k− fork equals 3 tok equals 7 0 1 2 3 4 5 � 5 j 2 + 2 + 2 + 2 + 2 + 2 the sum of 2 to thej-th power j=0 2 forj equals 0 toj equals 5 �7 a2 +a 3 +a 4 +a 5 +a 6 +a 7 the sum ofa subi i=2 ai fori equals 2 toi equals 7 � The variable (typicallyi,j, ork) used in the summation is called the counter or index variable.

Problem 1: Write the summation denoted by each of the following:

5 3 (a) k=1 k = �

(b) 7 ( 1)j 1 = j=2 − j �

4 (c) m=0(2m + 1) = �

1 Math 242 Lab Riemann Sums & Numerical Integration

x f(x) g(x) h(x) 1 2 4 3 2 3 1 3 3 1 -2 3 4 0 3 3 5 3 5 3

Figure 1: Table for Example 1.

In practice, the sigma notation is frequently used with the standard function notation:

3 f(k + 2) =f(1 + 2) +f(2 + 2) +f(3 + 2) =f(3) +f(4) +f(5) �k=1 and 4 f(x i) =f(x 1) +f(x 2) +f(x 3) +f(x 4). �k=1 5 5 Example1. Use the values in Table 1 to evaluate k=2 2f(k) and j=3 (5 +f(j 2)). 5 − 5 Solution: k=2 2f(k)=2f(2)+2f(3)+2f(4)+2f(5)� = 2(3)+2(1)+2(0)+2(3)� = 14. j=3 (5+f(j 2)) = (5+f(3 2))+(5+f(4 2))+(5+f(5 2)) = (5+f(1))+(5+f(2))+(5+f(3)) = (5+2)+(5+3)+(5+1)− = 21. − � − − � Problem 2: Use the values off,g andh in Table 1 to evaluate the following:

5 (a) k=2 g(k)= �

(b) 5 [f(i 1) +h(i)] = i=3 − �

Since the sigma notation is simply a notation for addition, it has all of the familiar properties of addition.

Theorem 1. (Summation Properties)

Sum of Constants: n C=C+C+C+ +C(n terms)=nC. • k=1 ··· Addition: n (a �+b ) = n a + n b . • k=1 k k k=1 k k=1 k Subtraction:� n (a b )� = n a � n b . • k=1 k − k k=1 k − k=1 k Constant Multiple:� n Ca =�C n a�. • k=1 k k=1 k Preserves positivity:� ifb a for� allk then n b n a . In particular, ifa 0 • k ≥ k k=1 k ≥ k=1 k k ≥ for allk then n a 0. k=1 k ≥ � � Additivity of ranges:� if1 m n then m a + n a = n a . • ≤ ≤ k=1 k k=m+1 k k=1 k � � �

2 Math 242 Lab Riemann Sums & Numerical Integration

1.2 Sums of areas of rectangles Later, we will approximate the areas under curves by building rectangles as high as the curve, calculating the area of each rectangle, and then adding the rectangular areas together. Example2. Evaluate the sum of the rectangular areas in Figure 2 and write the sum using the sigma notation. Solution: sum of the rectangular areas = sum of (base) (height) for each rectangle = (1)(1/3) + (1)(1× /4) + (1)(1/5) = 47/60. Using the sigma notation, 5 1 (1)(1/3) + (1)(1/4) + (1)(1/5) = . k k�=3

Problem 3: Evaluate the sum of the rectangular areas in Figure 3 and write the sum using the sigma notation.

Solution:

3 Math 242 Lab Riemann Sums & Numerical Integration

Example3. Write the sum of the areas of the rectangles in Figure 5 using the sigma notation. Solution: The area of each rectangle is (base) (height). × rectangle base height area 1 x x f(x ) (x x )f(x ) 1 − 0 1 1 − 0 1 2 x2 x 1 f(x 2) (x2 x 1)f(x 2) 3 x −x f(x ) (x −x )f(x ) 3 − 2 3 3 − 2 3

The area of thek-th rectangle is (x k x k 1)f(x k), and the total area of the rectangles is the sum 3 − − (xk x k 1)f(x k). k=1 − − �

1.3 Area under a curve by Riemann sums Suppose we want to calculate the area between the graph of a positive functionf and the [a, b] on thex–axis (Fig. 7). The Riemann Sum method is to build several rectangles withy=f(x) bases on the interval [a, b] and sides that reach up to the graph off (Fig. 8). Then the areas of the rectangles can be calculated and added together to get a number called a Riemann sum off on[a, b]. The area of the region formed by the rectangles is an approximation of the area we want. Example4. Approximate the area in Figure 2(a) between the graph off and the interval [2, 5] on thex–axis by summing the areas of the rectangles in Figure 2(b). Solution: The total area of rectangles is (2)(3) + (1)(5) = 11 square units.

Figure 2: Illustration for Example 4.

In order to effectively describe this process, some new vocabulary is helpful: a “partition” of an interval and the mesh of the partition. A partitionP of a closed interval [a,b] inton subintervals is a set ofn + 1 points x 0 = a, x1, x2, x3, ..., xn 1, xn =b in increasing order,a=x 0 < x1 < x2 < { − } x3 < ... < xn =b. (A partition is a collection of points on the axis and it does not depend on the function in any way.) The points of the partitionP divide the interval inton subintervals (Figure 3): [x 0, x1], [x1, x2], [x2, x3], . . . , and [xn 1, xn] with lengths Δx1 =x 1 x 0,Δx2 =x 2 x 1,...,Δxn =x n x n 1. The − − − − − pointsx k of the partitionP are the locations of the vertical lines for the sides of the rectangles,

4 Math 242 Lab Riemann Sums & Numerical Integration

and the bases of the rectangles have lengths Δxk fork=1,2,3, ..., n. The mesh or norm of the partition is the length of the longest of the subintervals [xk 1, xk], or, equivalently, the maximum − of the Δxk fork=1,2,3, ..., n.

Figure 3: Partition of the interval [a, b].

A function, a partition, and a point in each subinterval determine a Riemann sum. Supposef is a positive function on the interval [a, b],P= x 0 = a, x1, x2, x3, ..., xn 1, xn =b is a partition { − } of [a, b], andc k is anx-value in thek-th subinterval [x k 1, xk]:x k 1 c k x k. Then the area of − − ≤ ≤ thek-th rectangle isf(c k) (x k x k 1) =f(c k)Δxk. (Figure 4) · − −

Figure 4: Part of a Riemann sum.

n Definition 1. A summation of the form k=1 f(c k)Δxk is called a Riemann sum off for the partitionP. � This Riemann sum is the total of the areas of the rectangular regions and is an approximation of the area between the graph off and thex–axis. Example5. Find the Riemann sum forf(x)=1/x and the partition 1,4,5 using valuesc = 2 andc = 5. { } 1 2 Solution: The two subintervals are [1, 4] and [4, 5] so Δx1 = 3 and Δx2 = 1. Then the Riemann sum for this partition is n 1 1 f(c )Δx =f(c )Δx +f(c )Δx =f(2)(3) +f(5)(1) = (3) + (1) = 1.7. k k 1 1 2 2 2 5 k�=1 Problem 4: Calculate the Riemann sum forf(x)=1/x on the partition 1,4,5 using the values { } c1 = 3,c 2 = 4. Answer:

5 Math 242 Lab Riemann Sums & Numerical Integration

Problem 5: What is the smallest value a Riemann sum forf(x)=1/x and the partition 1,4,5 { } can have? (You will need to select values forc 1 andc 2.) What is the largest value a Riemann sum can have for this function and partition? (Draw a picture if necessary.) Answers:

Finally, it is important to note that iff is a continuous function on [a, b], then by taking more and more (skinnier and skinnier) rectangles, our choice of locations for the pointsc i in the interval [xi 1, xi] becomes unimportant. − Theorem 2. Iff is a continuous function on[a, b] (or has finitely many jump discontinuities), then n lim Sn = lim f(c i)Δx n n →∞ →∞ �i=1 exists and is the same value no matter what choice ofc i we make. As we will see later, when the functionf is continuous, the limit in the theorem above approaches b the value of the a f(x)dx, which is the area under the curve. Thus, no matter what method we use for choosing the pointsc , if we take enough rectangles, we can expect the Riemann sum to � i provide a good approximation to the area under the curve.

6