Integrated Calculus II Notes 1/6/4 Riemann Sums
Total Page:16
File Type:pdf, Size:1020Kb
Integrated Calculus II Notes 1/6/4 Riemann sums We reviewed the idea of a Riemann sum approximation, In, to an integral: b I = a f(x)dx: R n ∗ In = X f(xk)∆xk: k=1 • Here (when a ≤ b) the interval [a; b] is divided into n subintervals, with end-points denoted by xk, for k = 0; 1; : : : n, with a = x0 ≤ x1 ≤ x2 ≤ x3 · · · ≤ xn−1 ≤ xn = b. Then the k-th interval is [xk−1; xk]. • The width of the k-th subinterval is ∆xk = xk − xk−1. ∗ ∗ • The point xk is a point in the k-th interval, so xk−1 ≤ xk ≤ xk. • When f > 0 and a < b, we think of the integral as giving the area under the curve y = f(x) from a to b and then In is an approximation to this area obtained by adding the area of n rectangles, such that the ∗ k-th rectangle has base the k-th subinterval and height f(xk), i.e. the ∗ ∗ rectangle goes up to the point on the curve (xk; f(xk)). • In the limit as n ! 1, we find that limn!1 In = I, provided, for ex- ample, that f is continuous on the interval [a; b] and that the maximum width of each subinterval of the Riemann sum goes to zero. Commonly used special cases of the Riemann sum are: ∗ • The left Riemann sum, Ln: xk = xk−1: n Ln = X f(xk−1)∆xk: k=1 ∗ • The right Riemann sum, R: xk = xk: n Rn = X f(xk)∆xk: k=1 ∗ 1 • The midpoint Riemann sum, M: xk = 2 (xk−1 + xk): n 1 Mn = X f( (xk−1 + xk)) ∆xk: k=1 2 − ∗ • The lower Riemann sum: In : this has xk a point in the interval where f takes its minimal value, mk: this applies for example when f is continuous, which guarantees that this point exists. n − In = X mk∆xk: k=1 In this case the approximating rectangles never go above the curve, so we have the inequality: − In ≤ S: + ∗ • The upper Riemann sum: In : this has xk a point in the interval where f takes its maximal value, Mk: this applies for example when f is continuous, which guarantees that this point exists. n + In = X Mk∆xk: k=1 In this case the approximating rectangles never go below the curve, so we have the inequality: + S ≤ In : b−a We usually take each subinterval to be the same width, written ∆x = n . Then the general Riemann sum is rewritten: n ∗ ∗ ∗ ∗ In = ∆x X f(xk) = ∆x(f(x1) + f(x2) + · · · + f(xn)): k=1 In this case we have the formula for xk: k 1 xk = x0 + k∆x = a + (b − a) = ((n − k)a + kb): n n Note that this formula gives x0 = a and xn = b, as expected. Then the k-th subinterval is the interval [a + (k − 1)∆x; a + k∆x]. Our various sums may be written more explicitly as: n • Ln = ∆x X f(xk−1) = ∆x(f(a) + f(a + ∆x) + f(a + 2∆x) + · · · + f(b − ∆x)), k=1 n • Rn = ∆x X f(xk) = ∆x(f(a + ∆x) + f(a + 2∆x) + f(a + 3∆x) + · · · + f(b)), k=1 n 1 1 3 1 • Mn = ∆x X f( (xk−1 + xk)) = ∆x(f(a + ∆x) + f(a + ∆x) + · · · + f(b − ∆x)), k=1 2 2 2 2 n − In = ∆x X mk = ∆x(m1 + m2 + : : : mn): k=1 n + In = ∆x X Mk = ∆x(M1 + M2 + : : : Mn): k=1 When f is differentiable, the midpoint rule may be represented by sum of the areas of tangent trapezoids, one for each subinterval, where the upper edge of the tangent trapezoid is tangent to the curve at the point of the curve above the midpoint of the interval in question. In particular, if the curve is concave up, the tangent trapezoids lie below the curve and Mn is an under-estimate of the integral. 00 If f ≥ 0; then Mn ≤ I: On the other hand, if the curve is concave down, the tangent trapezoids lie above the curve and Mn is an over-estimate of the integral. 00 If f ≤ 0; then Mn ≥ I: The trapezoidal rule and Simpson's rule The trapezoidal rule Tn replaces the approximating rectangles by trapezoids connecting the points on the graph above the ends of each subinterval, so the k-th trapezoid has upper edge the line segment from (xk−1; f(xk−1)) to (xk; f(xk)). Then the trapezoidal rule is just the average of the left and right Riemann sums: 1 Tn = (Ln + Rn): 2 In the case of equal subintervals, we have: ∆x • Tn = (f(a) + 2f(a + ∆x) + 2f(a + 2∆x) + · · · + 2f(b − ∆x) + f(b)). 2 In particular, if the curve is concave up, the trapezoids lie above the curve and Tn is an over-estimate of the integral: 00 If f ≥ 0; then Tn ≥ I: On the other hand, if the curve is concave down, the trapezoids lie below the curve and Tn is an under-estimate of the integral. 00 If f ≤ 0; then Tn ≤ I: We may simplify the look of some of these formulas by putting yk = f(xk). Then we have in the equal interval case: • Ln = ∆x(y0 + y1 + · · · + yn−1), • Rn = ∆x(y1 + y2 + · · · + yn), ∆x • Tn = (y1 + 2y2 + 2y3 + · · · + 2yn−1 + yn). 2 Simpson's rule Sn applies only in the case that n is even. It takes the intervals two at a time and approximates the curve on each pair of intervals by parabolas through the three points on the curve above the ends of the (adjacent) intervals. Simpson's formula is: ∆x Sn = (y0 + 4y1 + 2y2 + 4y3 + 2y4 + · · · + 2yn−2 + 4yn−1 + yn): 3 Riemann sum inequalities depending on the shape of the curve If we know that f is monotonic or concave up or concave down on the interval [a; b], we can relate some of these sums to each other or to the exact integral: • If f is increasing on the interval [a; b], then: − + Ln = In ≤ I ≤ Rn = In : • If f is decreasing on the interval [a; b], then: − + Rn = In ≤ I ≤ Ln = In : • If f is concave up on the interval [a; b], then: Mn ≤ I ≤ Tn: • If f is concave down on the interval [a; b], then: Tn ≤ I ≤ Mn: Error estimates Introduce the following quantities, denoted K2 and K4: 00 • K2 is the maximum of jf (x)j on the interval [a; b], 0000 • K4 is the maximum of jf (x)j on the interval [a; b]. Then we have the following error estimates: • ET , the maximum possible error in the trapezoidal rule estimate with n intervals, is: 3 (b − a) K2 ET = : 12n2 • EM, the maximum possible error in the midpoint rule estimate with n intervals, is: 3 (b − a) K2 EM = : 24n2 • ES, the maximum possible error in the Simpson's rule estimate with n intervals, is: 5 (b − a) K4 ES = : 180n4.