MAT210/Integration/Basic 2013-14

22
St. John's University of Tanzania MAT210 NUMERICAL ANALYSIS 2013/14 Semester II INTEGRATION Trapezoidal Rule, Simpson's Rule Kaw, Chapter 7.01-7.03

description

Lecture slides introducing Numerical Integration with the Trapezoidal Rule and Simpson's 1/3 Rule. Some parts of this presentation are based on resources at http://nm.MathForCollege.com, primarily http://mathforcollege.com/nm/topics/trapezoidal_rule.html and http://mathforcollege.com/nm/topics/simpsons_13rd_rule.html

Transcript of MAT210/Integration/Basic 2013-14

Page 1: MAT210/Integration/Basic 2013-14

St. John's University of Tanzania

MAT210 NUMERICAL ANALYSIS2013/14 Semester II

INTEGRATIONTrapezoidal Rule, Simpson's Rule

Kaw, Chapter 7.01-7.03

Page 2: MAT210/Integration/Basic 2013-14

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

Page 3: MAT210/Integration/Basic 2013-14

MAT210 2013/14 Sem II 3 of 22

Riemann Sum

The Riemann Sum is foundational in our numerical approach to integration

Page 4: MAT210/Integration/Basic 2013-14

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)

Page 5: MAT210/Integration/Basic 2013-14

MAT210 2013/14 Sem II 5 of 22

Pictorial Example

Page 6: MAT210/Integration/Basic 2013-14

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

Page 7: MAT210/Integration/Basic 2013-14

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?

Page 8: MAT210/Integration/Basic 2013-14

MAT210 2013/14 Sem II 8 of 22

Other perspectives

Page 9: MAT210/Integration/Basic 2013-14

MAT210 2013/14 Sem II 9 of 22

Example 1

Page 10: MAT210/Integration/Basic 2013-14

MAT210 2013/14 Sem II 10 of 22

Error in the Example

Not very good!

Page 11: MAT210/Integration/Basic 2013-14

MAT210 2013/14 Sem II 11 of 22

Multiple-Segment Trapezoidal Rule● We can improve the approximation by

dividing the interval into more trapezoids

Page 12: MAT210/Integration/Basic 2013-14

MAT210 2013/14 Sem II 12 of 22

Revisting the Example

Page 13: MAT210/Integration/Basic 2013-14

MAT210 2013/14 Sem II 13 of 22

Compare the Errors● From 807 to 205 is a good improvement● What about further segmentation?

Page 14: MAT210/Integration/Basic 2013-14

MAT210 2013/14 Sem II 14 of 22

Error Analysis

Average2nd derivative

Page 15: MAT210/Integration/Basic 2013-14

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

Page 16: MAT210/Integration/Basic 2013-14

MAT210 2013/14 Sem II 16 of 22

Simpson's 1/3 Rule● Quadratic polynomial instead of a line

Page 17: MAT210/Integration/Basic 2013-14

MAT210 2013/14 Sem II 17 of 22

Resulting Formula

Page 18: MAT210/Integration/Basic 2013-14

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

Page 19: MAT210/Integration/Basic 2013-14

MAT210 2013/14 Sem II 19 of 22

Error in Simpson's Rule

Final result

Page 20: MAT210/Integration/Basic 2013-14

MAT210 2013/14 Sem II 20 of 22

Revisiting the Example

Page 21: MAT210/Integration/Basic 2013-14

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

Page 22: MAT210/Integration/Basic 2013-14

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