St. John's University of Tanzania
MAT210 NUMERICAL ANALYSIS2013/14 Semester II
INTEGRATIONTrapezoidal Rule, Simpson's Rule
Kaw, Chapter 7.01-7.03
MAT210 2013/14 Sem II 2 of 22
● What is integration?● General: Combining parts so that they work
together or form a whole● Mathematical: Finding
the area under a curve from one point to another
Introduction
∫a
bf (x)dx
MAT210 2013/14 Sem II 3 of 22
Riemann Sum
The Riemann Sum is foundational in our numerical approach to integration
MAT210 2013/14 Sem II 4 of 22
Mean Value Theorem for Integrals● MVT is another part of the foundation
● Theorem: If the function f is continuous on the closed interval [a,b], then there exists a number c in [a,b] such that:
f (c) = 1b−a
∫a
bf (x)dx
⇒ I =∫a
bf (x)dx = f (c)(b−a)
MAT210 2013/14 Sem II 5 of 22
Pictorial Example
MAT210 2013/14 Sem II 6 of 22
Trapezoidal Rule
Based on the Newton-Cotes formula that if one approximates the integrand by an nth order polynomial, then the integral of the function is approximated by the integral of that nth order polynomial
∫a
bxndx=(b
n+1−an+1
n+1 ) , n≠−1
f (x)≈ f n(x)⇒∫a
bf (x)dx≈∫a
bf n(x)dx
MAT210 2013/14 Sem II 7 of 22
Trapezoid: n=1But what are a0 and a1?
Well, use (a,f(a)) and (b,f(b)) to fix a line and thus get the two coefficients
Mean Value Theorem?
MAT210 2013/14 Sem II 8 of 22
Other perspectives
MAT210 2013/14 Sem II 9 of 22
Example 1
MAT210 2013/14 Sem II 10 of 22
Error in the Example
Not very good!
MAT210 2013/14 Sem II 11 of 22
Multiple-Segment Trapezoidal Rule● We can improve the approximation by
dividing the interval into more trapezoids
MAT210 2013/14 Sem II 12 of 22
Revisting the Example
MAT210 2013/14 Sem II 13 of 22
Compare the Errors● From 807 to 205 is a good improvement● What about further segmentation?
MAT210 2013/14 Sem II 14 of 22
Error Analysis
Average2nd derivative
MAT210 2013/14 Sem II 15 of 22
Half to Quarter
● Why not exactly 1/4 each time?● This will be useful for a very efficient integration
method called Romberg Integration
MAT210 2013/14 Sem II 16 of 22
Simpson's 1/3 Rule● Quadratic polynomial instead of a line
MAT210 2013/14 Sem II 17 of 22
Resulting Formula
MAT210 2013/14 Sem II 18 of 22
Multiple-segment Simpson’s Rule● Just like in multiple-segment trapezoidal
rule, one can subdivide the interval [a,b] into n segments and apply the rule repeatedly over every two segments● Note that n needs to be even
MAT210 2013/14 Sem II 19 of 22
Error in Simpson's Rule
Final result
MAT210 2013/14 Sem II 20 of 22
Revisiting the Example
MAT210 2013/14 Sem II 21 of 22
Summary● Trapezoidal is simple● Multi-segment Trapezoidal is better● Simpson's is better yet● Multi-segment Simpson is excellent
● But it is hard● We will never use it, instead we will use a very
clever alternative Romberg Integration
MAT210 2013/14 Sem II 22 of 22
A little extra to hold onto
View each in terms of MVT & Riemann Sum
Try to find f(c) and the sum for Simpson's Multi-segment method