part6 notes - Chapter 5 Numerical Integration and...

Info icon This preview shows pages 1–9. Sign up to view the full content.

Chapter 5: Numerical Integration and Differentiation PART I: Numerical Integration Newton-Cotes Integration Formulas The idea of Newton-Cotes formulas is to replace a complicated function or tabu- lated data with an approximating function that is easy to integrate. I = Z b a f ( x ) dx Z b a f n ( x ) dx where f n ( x ) = a 0 + a 1 x + a 2 x 2 + . . . + a n x n . 1 The Trapezoidal Rule Using the first order Taylor series to approximate f ( x ) , I = Z b a f ( x ) dx Z b a f 1 ( x ) dx where f 1 ( x ) = f ( a ) + f ( b ) - f ( a ) b - a ( x - a ) 1
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

Then I Z b a f ( a ) + f ( b ) - f ( a ) b - a ( x - a ) dx = ( b - a ) f ( b ) + f ( a ) 2 The trapezoidal rule is equivalent to approximating the area of the trapezoidal Figure 1: Graphical depiction of the trapezoidal rule under the straight line connecting f ( a ) and f ( b ) . An estimate for the local trun- 2
Image of page 2
cation error of a single application of the trapezoidal rule can be obtained using Taylor series as E t = - 1 12 f 00 ( ξ )( b - a ) 3 where ξ is a value between a and b . Example: Use the trapezoidal rule to numerically integrate f ( x ) = 0 . 2 + 25 x from a = 0 to b = 2 . Solution: f ( a ) = f (0) = 0 . 2 , and f ( b ) = f (2) = 50 . 2 . I = ( b - a ) f ( b ) + f ( a ) 2 = (2 - 0) × 0 . 2 + 50 . 2 2 = 50 . 4 The true solution is Z 2 0 f ( x ) dx = (0 . 2 x + 12 . 5 x 2 ) | 2 0 = (0 . 2 × 2 + 12 . 5 × 2 2 ) - 0 = 50 . 4 Because f ( x ) is a linear function, using the trapezoidal rule gets the exact solu- tion. Example: Use the trapezoidal rule to numerically integrate f ( x ) = 0 . 2 + 25 x + 3 x 2 3
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

from a = 0 to b = 2 . Solution: f (0) = 0 . 2 , and f (2) = 62 . 2 . I = ( b - a ) f ( b ) + f ( a ) 2 = (2 - 0) × 0 . 2 + 62 . 2 2 = 62 . 4 The true solution is Z 2 0 f ( x ) dx = (0 . 2 x + 12 . 5 x 2 + x 3 ) | 2 0 = (0 . 2 × 2 + 12 . 5 × 2 2 + 2 3 ) - 0 = 58 . 4 The relative error is | ² t | = fl fl fl fl 58 . 4 - 62 . 4 58 . 4 fl fl fl fl × 100% = 6 . 85% 4
Image of page 4
Multiple-application trapezoidal rule: Using smaller integration interval can reduce the approximation error. We can divide the integration interval from a to b into a number of segments and apply the trapezoidal rule to each segment. Divide ( a, b ) into n segments of equal width. Then I = Z b a f ( x ) dx = Z x 1 x 0 f ( x ) dx + Z x 2 x 1 f ( x ) dx + . . . + Z x n x n - 1 f ( x ) dx where a = x 0 < x 1 < . . . < x n = b , and x i - x i - 1 = h = b - a n , for i = 1 , 2 , . . . , n . Substituting the Trapezoidal rule for each integral yields I h f ( x 0 ) + f ( x 1 ) 2 + h f ( x 1 ) + f ( x 2 ) 2 + . . . + h f ( x n - 1 ) + f ( x n ) 2 = h 2 " f ( x 0 ) + 2 n - 1 X i =1 f ( x i ) + f ( x n ) # = ( b - a ) f ( x 0 ) + 2 n - 1 i =1 f ( x i ) + f ( x n ) 2 n The approximation error using the multiple trapezoidal rule is a sum of the indi- vidual errors, i.e., E t = - n X i =1 h 3 12 f 00 ( ξ i ) = - n X i =1 ( b - a ) 3 12 n 3 f 00 ( ξ i ) 5
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

Let f 00 = n i =1 f 00 ( ξ i ) n . Then the approximate error is E t = - ( b - a ) 3 12 n 2 f 00 Example: Use the 2-segment trapezoidal rule to numerically integrate f ( x ) = 0 . 2 + 25 x + 3 x 2 from a = 0 to b = 2 . 6
Image of page 6
Solution: n = 2 , h = ( a - b ) /n = (2 - 0) / 2 = 1 . f (0) = 0 . 2 , f (1) = 28 . 2 , and f (2) = 62 . 2 . I = ( b - a ) f (0) + 2 f (1) + f (2) 2 n = 2 × 0 . 2 + 2 × 28 . 2 + 62 . 2 4 = 59 . 4 The relative error is | ² t | = fl fl fl fl 58 . 4 - 59 . 4 58 . 4 fl fl fl fl × 100% = 1 . 71% 7
Image of page 7

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

2 Simpson’s Rules Aside from using the trapezoidal rule with finer segmentation, another way to improve the estimation accuracy is to use higher order polynomials.
Image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern