290 likes | 628 Views
Numerical Integration. Section 4.6. Section outline. Why numerical integration? Trapezoidal rule Simpson’s rule Error analysis. Be able to…. Derive the Trapezoidal Rule formula Use the Trapezoidal Rule to approximate the area under a curve
E N D
Numerical Integration Section 4.6
Section outline • Why numerical integration? • Trapezoidal rule • Simpson’s rule • Error analysis
Be able to… • Derive the Trapezoidal Rule formula • Use the Trapezoidal Rule to approximate the area under a curve • Use Simpson’s rule to approximate the area under a curve • Analyze the error in using these integral approximations
Why numerical integration? Some functions do not have antiderivatives that are elementary functions, or easily integrable. • For example: • In these cases the best we can do is use an approximation.
Method 1: Using trapezoids to approximate area The area under this curve from a to bcan be approximated by 4 trapezoids
Using trapezoids to approximate area Area of a general trapezoid Area of 1st Trapezoid: Area of ith Trapezoid:
Sum of n trapezoids AREA =
The Trapezoidal Rule Let f be continuous on the closed interval [a,b]. The Trapezoidal Rule for approximating is given by: Moreover, as n ∞, the right-hand side approaches N.B! n MUST be an integer. Pattern of coefficients: 1, 2, 2, …, 2, 1.
Applying the Rule Use the Trapezoidal rule to approximate Compare the results for n = 4 and n = 8.
Applying the rule • When n = 4, , and you get:
Applying the rule • When n = 4, , and you get:
Method 2: Using parabolas to approximate the area • Thomas Simpson (1710 -- 1761) • Let f be continuous on [a,b]. To approximate the integral: N.B! n MUST be an even integer. Pattern of coefficients: 1, 4, 2, 4, … , 4, 1.
Simpson’s Rule, applied Use Simpson’s Rule to approximate: Compare the results for n = 4 and n = 8
Simpson’s Rule, applied • When n = 4:
Simpson’s Rule, applied • When n = 8
Error analysis for the Trapezoidal Rule If f has a continuous 2nd derivative on [a,b], then the error E in approximating by the Trapezoidal Rule is:
Error analysis for Simpson’s Rule • …Moreover, if f has a continuous 4th derivative on [a, b], then the error E in approximating by Simpson’s Rule is:
Example of error analysis • Determine a value of n such that the Trapezoidal Rule will approx. the value of w/an error < 0.01. • Let . Then,
Example of error analysis • Find the maximum value of on [0,1]… • The maximum occurs at x = 0. • Therefore, the maximum value occurs at • Apply Theorem 4.19:
Example of error analysis • E must be less than or equal to 1/100: Because n can only be an even number, where n is an even integer, will satisfy the conditions.
Summary of techniques • Trapezoidal rule: • Using trapezoids to approximate area under a curve • Simpson’s rule: • Using parabolas to approximate the area under a curve • Error analysis: • Because Trapezoidal and Simpson’s rule are approximations, not exact answers