Trapezoid Rule � b The Trapezoid Rule is used to estimate an integral a f ( x ) dx . Let: h = ∆ x = b − a n x k = a + kh y k = f ( x k ) � b a f ( x ) dx ≈ h 2( y 0 + 2 y 1 + 2 y 2 + · · · + 2 y n − 1 + y n ) = b − a 2 n ( y 0 + 2 y 1 + 2 y 2 + · · · + 2 y n − 1 + y n ) Area Under a Parabola It will be shown that the integral of a quadratic function depends only on the width of the interval over which it’s integrated and the values of the function at the midpoint and endpoints. To simplify the calculations, assume that the interval is of the form [ − h, h ] and that the quadratic function is of the form f ( x ) = ax 2 + bx + c . � h Let I = − h f ( x ) dx . This may be integrated easily using the Funda- mental Theorem of Calculus. � h � h − h ax 2 + bx + c dx I = − h f ( x ) dx = = ax 3 / 3 + bx 2 / 2 + cx | h − h = ah 3 / 3 + bh 2 / 2 + ch − { a ( − h ) 3 / 3 + b ( − h ) 2 / 2 + c ( − h ) } = ah 3 / 3 + bh 2 / 2 + ch + ah 3 / 3 − bh 2 / 2 + ch = 2 ah 3 / 3 + 2 ch = h 3 · (2 ah 2 + 6 c ) Let y − h = f ( − h ) = ah 2 − bh + c y 0 = f (0) = c y h = f ( h ) = ah 2 + bh + c Since y − h + y h = 2 ah 2 +2 c , it is easily seen that 2 ah 2 +6 c = y − h +4 y 0 + y h , and thus I = h 3 · ( y − h + 4 y 0 + y h ). Simpson’s Rule 1
2 The Parabola Rule � b Simpson’s Rule may be used to approximate a f ( x ) dx . It takes the idea of the Trapezoid Rule one degree higher. Rationale Partition the interval [ a, b ] evenly into n subintervals, where n is even, so that each subinterval has width h = b − a and let y k = f ( x k ). n Estimate the integral over adjacent pairs of integrals by the integral of a quadratic function agreeing with f at the midpoint and endpoints of the interval. x 0 f ( x ) dx ≈ h � x 2 3 · ( y 0 + 4 y 1 + y 2 ) x 2 f ( x ) dx ≈ h � x 4 3 · ( y 2 + 4 y 3 + y 4 ) x 4 f ( x ) dx ≈ h � x 6 3 · ( y 4 + 4 y 5 + y 6 ) . . . x n − 2 f ( x ) dx ≈ h � x n 3 · ( y n − 2 + 4 y n − 1 + y n ) If everything is added together, we obtain the estimate a f ( x ) dx ≈ h � b 3 · ( y 0 + 4 y 1 + 2 y 2 + 4 y 3 + 2 y 4 + · · · + 2 y n − 2 + 4 y n − 1 + y n ). This is known as Simpson’s Rule. Summary Midpoint Rule � b � x 0 + x 1 � x 1 + x 2 � x n − 1 + x n � � � �� a f ( x ) dx ≈ h · f + f + · · · + f 2 2 2 Trapezoid Rule � b a f ( x ) dx ≈ h 2( y 0 + 2 y 1 + 2 y 2 + · · · + 2 y n − 1 + y n ) = b − a 2 n ( y 0 + 2 y 1 + 2 y 2 + · · · + 2 y n − 1 + y n ) Simpson’s Rule � b a f ( x ) dx ≈ h 3 · ( y 0 + 4 y 1 + 2 y 2 + 4 y 3 + 2 y 4 + · · · + 2 y n − 2 + 4 y n − 1 + y n ) = b − a · ( y 0 + 4 y 1 + 2 y 2 + 4 y 3 + 2 y 4 + · · · + 2 y n − 2 + 4 y n − 1 + y n ) 3 n
3 Error Estimates Let E T be the error in the Trapezoid Rule. Let E M be the error in the Midpoint Rule. Let E S be the error in Simpson’s Rule. Let K be a bound on the second derivative. Let K ∗ be a bound on the fourth derivative. | E T | ≤ K ( b − a ) 3 12 n 2 | E M | ≤ K ( b − a ) 3 24 n 2 | E S | ≤ K ∗ ( b − a ) 5 180 n 4
Recommend
More recommend