|
Numerical Integration I. Quiz II. Homework III. Review of Left and Right sums. We will review left and right sums in class. For more information click here IV. The Midpoint Approximation
To get a better approximation of , for example, as the height. The new numbers are as follows: 2.2 + 0(.5),2.5 + 1(.5), 2.5 + 2(.5), 2.5 + 3(.5), 2.5 + 4(.5), 2.5 + 5(.5) so that the y coordinates are (2.5 + 0(.5))2,(2.5 + 1(.5))2, (2.5 + 2(.5))2, (2.5 + 3(.5))2, (2.5 + 4(.5))2, (2.5 + 5(.5))2 We see that the ith rectangle has y coordinate: height = (2.5 + i(.5))2 = 6.25 + 2.5i + .25i2 To get the area of the ith rectangle we multiply the height by the base: (6.25+ 2.5i + .25i2)(.5) Finally to get the total area we add the terms up: sum[(6.25 + 2.5i + .25i2)(.5)] V. The Trapezoidal Approximation A fourth method involves the trapezoidal rule which geometrically calculates the area of the trapezoid with base on the x-axis and heights f(xi) and f(xi+1)
The area of the trapezoid is T(n) = f(x0) + 2f(x1) + 2f(x2) +...+ 2f(xn-1) + f(xn) We will demonstrate this in class. Exercise: Use the Trapezoidal Approximation to approximate the integral
VI. Error The error in approximating an integral can be found by subtracting the true value from the estimated value. The graphs show that the error is directly inked to the concavity of the integrand. Without proof, bounds for the errors are: |EM| < B(b - a)3/24n2 |ET| < B(b - a)3/12n2 Where B = max |f''(x)| Example: If you want to approximate int from 0 to 2 of ex2 dx using the midpoint rule with an error of less than .001, we compute f''(x) = (2 + 4x2)ex2 which in an increasing function on [0,2], hence has its maximum at x = 2. So B = (2 + 4(4))e4 < 983 so we find 983(23)/24n2 < .001 or n > 572. Hence n = 573 will do. V. Simpson's Estimate Yesterday, we saw that the Trapezoidal and Midpoint estimates provided better accuracy than the Left and Right endpoint estimates. It turns out that a certain combination of the Trapezoid and Midpoint estimates is even better. Definition: Let f(x) be a function defined on [a,b]. Then S(n) = 1/3 T(n) + 2/3 M(n) where T(n) and M(n) are the Trapezoidal and Midpoint Estimates. Geometrically, if n is an even number then Simpson's Estimate gives the area under the parabolas defined by connecting three adjacent points. Let n be even then using the even subscripted x values for the trapezoidal estimate and the midpoint estimate, gives S(n) = 1/3[(b - a)/2 (f(x0) + 2f( f(x2) + f(x4)+ ... + f(xn-2) + f(xn)] + 2/3[f(x1) + f(x3) + f(x5) + ... + f(xn-1) = (b - a)/6 ( f(x0) + 4f(x1) + 2f(x2) + 4f(x3) + 2f(x4) + 4f(x5) + ... + 2f(xn-2) + 4f(xn-1) + f(xn) Notice the 1 2 4 2 4 ... 2 4 2 4 1 pattern.
Exercise: Approximate VI. Error in Simpson's Estimate Without proof, we state Let M = max |f''''(x)| and let ES be the error in using Simpson's estimate then |ES| < M(b - a)5/180n4 Examples will be given.
|