Simpsons Rule Nicole Typaldos Basic Simpsons Rule NOTE
Simpson’s Rule Nicole Typaldos
Basic Simpson’s Rule: • NOTE: P(x)≈f(x) then ∫P(x)dx ≈ ∫f(x)dx • Using two equal subintervals say, [a, a+h] and [a+h, a+2 h] with the interpolating polynomial P(x) of degree two, on the integrated interval. • We have: • With error term:
Questions about approximating: • What if the graph oscillates greatly in some subintervals? • What if the oscillation of the interpolating polynomial P(x) is greater than the function we are trying to approximate?
Adaptive Simpson’s Rule: • With the basic Simpson’s Rule those subintervals with large magnitude first derivatives are not very accurate and grossly underestimate the amplitude and number of oscillations of the function. • Let ε be equal to the total error over the entire interval.
Adding more points • Let ε be equal to the total error over the entire interval. • Then with the 1 st Simpson’s we have 2 A B subintervals: • With ≈ errors: ε/2 • If the error in say “A”≤ ε/2 then that subinterval is left alone and the next is evaluated. • If the error in “B”> ε/2, then “B” is broken up into further subintervals until the total error of “B” ≤ ε/2.
Adaptive Simpson’s Rule: • For example: • We want to approximate a function using Simpson’s Adaptive Rule y=exp(t). *sin(t. *cos(exp(t))) using the error of 1*e^(-5) • To the example using MATLAB.
- Slides: 6