Numerical Integration AP Calculus Numerical Integration * Used when normal definite integration is not possible. a). When there is no elementary function for the anti-derivative; i.e.: 1 x dx 3 or x cos xdx b). Data is given in tabular or graphical form and it is too much effort to find the representative function. I. RIEMANN’S SUMS REM: Riemann’s Sum uses Rectangles to approximate the accumulation. b a n f ( x)dx Lim f (ci ) xi n i 1 A = bh => h - Left Endpoints - Right Endpoints - Midpoint The more accurate is the Midpoint Sum (must remember how to use all three – Left, Right, and Midpoint) .................................................................. n b Midpoint Rule: f ( x)dx f xi xi1 x with x b a a 2 n i 1 xn 1 xn x1 x2 b a x0 x1 A f ... f f n 2 2 2 In Words: The width of the subinterval times the sum of the heights AT THE MIDPOINT of each subinterval. Illustration: Function: f ( x) 4 x x 2 4 0 (4 x x 2 )dx on [0,4] with n=4 Example: Graphical Find the Average Revenue for the 5 years. II. TRAPEZOID METHOD: Uses Trapezoids to fill the regions rather than rectangles: REM: A 1 h(b1 b2 ) 2 1 ba A ( )( f ( x0 ) f ( x1 )) 2 n 1ba A1 ( f ( x0 ) f ( x1 )) 2 n 1ba A2 2 n 1ba A3 2 n ( f ( x1) f ( x2 )) ( f ( x2 ) f ( x3 )) --------------------------------------------------------------- 1ba A ( f ( x0 ) 2 f ( x1 ) 2 f ( x2 ) f ( x3 )) 2 n (Notice this is the average of the Left and Right Riemann's Sums) Trapezoid Rule: ........................................................................ b a 1 b a f ( x ) dx f ( xi ) f ( xi 1 ) n i 1 2 n 1 b a ( f ( x0 ) 2 f ( x1 ) 2 f ( x2 ) ... 2 f ( xn1 ) f ( xn )) 2 n In Words: One half * width of subinterval * the ( 1 , 2 , 2 , … , 2 , 1 ) pattern of the heights found at the points of the subinterval. ........................................................................ Illustration: (Trapezoid) Function: f ( x) 4 x x 2 4 0 (4 x x 2 )dx on [0,4] with n=4 Example: Data The data for the acceleration a(t) of a car from 1 to 15 seconds are given in the table below. If the velocity at t = 0 is 5 ft/sec, which of the following gives the approximate velocity at t = 15 using the Trapezoidal Rule? t (sec) 0 3 6 9 12 15 a(t) (ft/sec2) 4 8 6 9 10 10 A lot is bounded by a stream. and two straight roads that meet at right angles. Use the Trapezoid Rule to approximate the area of the lot (x and y are measured in square meters) III. SIMPSON’S METHOD Built on: b a ( Ax2 Bx C )dx The area of the region below a quadratic function. REM: Three points are required to write a quadratic equation since the equation has 3 variables; A,B,C in y Ax 2 Bx C Therefore, to get the 3 points needed, Simpson’s uses double subintervals to approximate the accumulation. ............................ THEOREM: 1 ba a ( Ax Bx C )dx 3 n ( f ( x1 ) 4 f ( x2 ) f ( x3 )) with n even b 2 Simpson’s: (cont) EXTENDED: 1 ba ( f ( x1 ) 4 f ( x2 ) f ( x3 )) 3 n 1ba ( f ( x3 ) 4 f ( x4 ) f ( x5 )) 3 __________________________________________________ n 1 ba [ f ( x1 ) 4 f ( x2 ) 2 f ( x3 ) 4 f ( x4 ) f ( x5 )] 3 n ....................................................... Simpson’s Formula: b a xi1 2 f ( x)dx ( Ax Bx C )dx i 1 xi 1ba [ f ( x1 ) 4 f ( x2 ) 2 f ( x3 ) 4 f ( x4 ) f ( x5 )] 3 n n Note the pattern: 1,4,2,4,1 1,4,2,4,2,4,1 etc Illustration: (Simpson’s) Function: f ( x) 4 x x 2 4 0 (4 x x 2 )dx on [0,4] with n=4 Although the economy is continuously changing, we analyze it with discrete measurements. The following table records the annual inflation rate as measured each month for 13 consecutive months. Use Simpson’s Rule with n = 12 to find the overall inflation rate for the year. Month Annual Rate January 0.04 February 0.04 March 0.05 April 0.06 May 0.05 June 0.04 July 0.04 August 0.05 September 0.04 October 0.06 November 0.06 December 0.05 January 0.05 Example: Graphical - all three Error: Approximation gives rise to two questions>>>> 1) How close are we to the actual answer? and 2) How do we get close enough? Error: MIDPOINT E M n Error using Midpoint with n partitions (b a) E 2 24n M n 3 f (c) C is an un-findable number in [a,b] but whose existence is guaranteed; therefore do “ERROR BOUND” (b a) E Mi 2 24n 3 M n Where Mi the MAX of f ( x) on i[a,b] Error: TRAPEZIOD E T n Error using Trapezoid with n partitions (b a) E 2 12n T n 3 f (c) C is an un-findable number in [a,b] but whose existence is guaranteed; therefore do “ERROR BOUND” (b a) E Mi 2 12n 3 T n Where Mi the MAX of f ( x) on i[a,b] Example: How close are we? 1 Approximate (1 x 2 ) dx using Trapezoid Method 0 with 4 intervals and find the Error bound. Example: How many intervals are required? 1 Approximate 4 5x dx 0 to within . 1 1000 using Midpoint Rule Error: SIMPSONS E S n Error using Simpson’s with n partitions (b a) E 4 180n S n 5 f IV (c ) C is an un-findable number in [a,b] but whose existence is guaranteed; therefore do “ERROR BOUND” (b a) E 4 180n S n 5 Mi Where Mi the MAX of f IV ( x) on i[a,b] Last Update: • 02/05/10