Slideshare.net (beta)

 
Post: 
Myspace Hi5 Friendster Xanga LiveJournal Facebook Blogger Tagged Typepad Freewebs BlackPlanet gigya icons



All comments

Add a comment on Slide 1

If you have a SlideShare account, login to comment; else you can comment as a guest


Showing 1-50 of 1 (more)

Lesson 31: Numerical Integration

From leingang, 3 months ago

Three methods for approximating an integral are surprisingly good: more

444 views  |  0 comments  |  0 favorites  |  19 downloads
 

Groups/Events

 
 

Privacy InfoNew!

This slideshow is Public

 
Embed in your blog
Embed (wordpress.com)
custom

Slideshow Statistics
Total Views: 444
on Slideshare: 444
from embeds: 0* * Views from embeds since 21 Aug, 07

Slideshow transcript

Slide 1: Section 5.7 Numerical Integration Math 1a Introduction to Calculus April 25, 2008 Announcements Midterm III is Wednesday 4/30 in class (covers §4.9–5.6) ◮ Friday 5/2 is Movie Day! ◮ Final (tentative) 5/23 9:15am ◮ Problem Sessions Sunday, Thursday, 7pm, SC 310 ◮ ◮ . . . . . .

Slide 2: Announcements Midterm III is Wednesday 4/30 in class (covers §4.9–5.6) ◮ Friday 5/2 is Movie Day! ◮ Final (tentative) 5/23 9:15am ◮ Problem Sessions Sunday, Thursday, 7pm, SC 310 ◮ Office hours Tues, Weds, 2–4pm SC 323 ◮ . . . . . .

Slide 3: Outline Last Time: Integration by Parts The Trapezoidal Rule Trapezoids instead of rectangles The Midpoint Rule Simpson’s Rule Error estimates for the Trapezoidal and Midpoint Rules Error estimates for Simpson’s Rule . . . . . .

Slide 4: Theorem (Integration by Parts) Let u and v be differentiable functions. Then ∫ ∫ u(x)v′ (x) dx = u(x)v(x) − v(x)u′ (x) dx. Succinctly, ∫ ∫ u dv = uv − v du. . . . . . .

Slide 5: Theorem (Integration by Parts) Let u and v be differentiable functions. Then ∫ ∫ u(x)v′ (x) dx = u(x)v(x) − v(x)u′ (x) dx. Succinctly, ∫ ∫ u dv = uv − v du. Theorem (Integration by Parts, definite form) ∫ ∫ b b b − u dv = uv v du. a a a . . . . . .

Slide 6: Outline Last Time: Integration by Parts The Trapezoidal Rule Trapezoids instead of rectangles The Midpoint Rule Simpson’s Rule Error estimates for the Trapezoidal and Midpoint Rules Error estimates for Simpson’s Rule . . . . . .

Slide 7: Why estimate an integral when we have the FTC? Antidifferentiation is ◮ “hard” Sometimes ◮ antidifferentiation is impossible Sometimes all we need ◮ is an approximation These methods actually ◮ work pretty well! . . . . . .

Slide 8: Trapezoids instead of rectangles In the case of a simple ◮ decreasing function like this one, clearly Ln is too much and Rn is not f .(xi−1 ) enough. f .(xi ) . x x . i−1 .i . . . . . .

Slide 9: Trapezoids instead of rectangles In the case of a simple ◮ decreasing function like this one, clearly Ln is too much and Rn is not f .(xi−1 ) enough. f .(xi ) . x x . i−1 .i . . . . . .

Slide 10: Trapezoids instead of rectangles In the case of a simple ◮ decreasing function like this one, clearly Ln is too much and Rn is not f .(xi−1 ) enough. f .(xi ) Why not average them ◮ out and make a trapezoid? ∆A = . x x . i−1 .i . . . . . .

Slide 11: Trapezoids instead of rectangles In the case of a simple ◮ decreasing function like this one, clearly Ln is too much and Rn is not f .(xi−1 ) enough. f .(xi ) Why not average them ◮ out and make a trapezoid? f(xi−1 ) + f(xi ) ∆A = ∆x 2 . x x . i−1 .i . . . . . .

Slide 12: Trapezoids instead of rectangles In the case of a simple ◮ decreasing function like this one, clearly Ln is too much and Rn is not f .(xi−1 ) enough. f .(xi ) Why not average them ◮ out and make a trapezoid? f(xi−1 ) + f(xi ) ∆A = ∆x 2 . x x . i−1 .i The smaller the ◮ intervals, the better the approximation . . . . . .

Slide 13: The Trapezoidal Rule Definition b−a Divide the interval [a, b] up into n pieces. Let ∆x = , n xi = a + i∆x, and yi = f(xi ) for each i from 1 to n. ∫ b f(x) dx The (n + 1)-point Trapezoidal Rule approximation to a is given by n ∑ f(xi−1 ) + f(xi ) Tn (f) = ∆x 2 i=1 [ ] y + yn y + y 1 y 1 + y2 + · · · + n−1 = ∆x 0 + 2 2 2 ∆x ( ) y0 + 2y1 + 2y2 + · · · + 2yn−1 + yn = 2 . . . . . .

Slide 14: Example Example ∫ 1 x2 dx with the Trapezoidal Rule and n = 4. Estimate 0 . . . . . .

Slide 15: Example Example ∫ 1 x2 dx with the Trapezoidal Rule and n = 4. Estimate 0 Solution The set of values is } { ( )2 ( )2 ( )2 ( )2 } { y0 , y1 , y2 , y3 , y4 = 0, 1 , 2 , 3 , 4 4 4 4 4 So ( ) 1 1 4 9 16 0+2· +2· +2· Tn (f) = + 2·4 16 16 16 16 ( ) 1 2 + 8 + 18 + 16 = 8 16 44 11 = = 128 32 . . . . . .

Slide 16: Your Turn Example Estimate ∫ 2 1 dx ln 2 = x 1 with the Trapezoidal Rule and n = 8. . . . . . .

Slide 17: Your Turn Example Estimate ∫ 2 1 dx ln 2 = x 1 with the Trapezoidal Rule and n = 8. Solution 0.694122 . . . . . .

Slide 18: Outline Last Time: Integration by Parts The Trapezoidal Rule Trapezoids instead of rectangles The Midpoint Rule Simpson’s Rule Error estimates for the Trapezoidal and Midpoint Rules Error estimates for Simpson’s Rule . . . . . .

Slide 19: Midpoints to cancel out the slop The Trapezoidal Rule ◮ averages the values f .(xi−1 ) f .(xi ) . x x . i−1 .i . . . . . .

Slide 20: Midpoints to cancel out the slop The Trapezoidal Rule ◮ averages the values f .(xi−1 ) f .(xi ) . x x . i−1 .i . . . . . .

Slide 21: Midpoints to cancel out the slop The Trapezoidal Rule ◮ averages the values f .(xi−1 ) f .(xi ) . x x . i−1 .i . . . . . .

Slide 22: Midpoints to cancel out the slop The Trapezoidal Rule ◮ averages the values f .(xi−1 ) Another possibility ◮ would be to average the f .(xi ) points. ∆A = . x x . i−1 .i . . . . . .

Slide 23: Midpoints to cancel out the slop The Trapezoidal Rule ◮ averages the values f .(xi−1 ) Another possibility ◮ would be to average the f .(xi ) points. ( ) xi−1 + xi ∆A = f ∆x 2 . x x . i−1 .i . . . . . .

Slide 24: Midpoints to cancel out the slop The Trapezoidal Rule ◮ averages the values f .(xi−1 ) Another possibility ◮ would be to average the f .(xi ) points. ( ) xi−1 + xi ∆A = f ∆x 2 Again, the smaller the ◮ . x x . i−1 .i intervals, the better the approximation . . . . . .

Slide 25: The Midpoint Rule Definition b−a Divide the interval [a, b] up into n pieces. Let ∆x = , and n xi = a + i∆x for each i from 1 to n. ∫b f(x) dx is The (n + 1)-point Midpoint Rule approximation to a given by ∑ ( xi−1 + xi ) n Mn (f) = f ∆x 2 i=1 (( ) ( ) ( )) x0 + x1 x1 + x 2 xn−1 + xn + ··· + f = ∆x f +f 2 2 2 . . . . . .

Slide 26: Example Example ∫ 1 x2 dx with the Midpoint Rule and n = 4. Estimate 0 . . . . . .

Slide 27: Example Example ∫ 1 x2 dx with the Midpoint Rule and n = 4. Estimate 0 Solution The set of midpoints is { } 0, 8 , 3 , 5 , 7 1 888 So 1( ( )2 ( )2 ( )2 ( )2 ) 0+ 1 + 3 + 5 + 7 Mn (f) = 8 8 8 8 4 ( ) 1 1 + 9 + 25 + 49 = 4 64 84 21 = = . 256 64 . . . . . .

Slide 28: Your Turn Example Estimate ∫ 2 1 dx ln 2 = x 1 with the Midpoint Rule and n = 8. . . . . . .

Slide 29: Your Turn Example Estimate ∫ 2 1 dx ln 2 = x 1 with the Midpoint Rule and n = 8. Solution 0.692661 . . . . . .

Slide 30: Outline Last Time: Integration by Parts The Trapezoidal Rule Trapezoids instead of rectangles The Midpoint Rule Simpson’s Rule Error estimates for the Trapezoidal and Midpoint Rules Error estimates for Simpson’s Rule . . . . . .

Slide 31: Parabolas instead of lines Trapezoidal Rule ◮ approximates the function with a line Why not use a parabola? ◮ A section of a parabola ◮ passing through equally spaced points is ∆x (y + 4y1 + y2 ) 30 . need an even number of ◮ points . . . . . .

Slide 32: Simpson’s Rule Definition Divide the interval [a, b] up into n pieces, where n is even. Let b−a , xi = a + i∆x, and yi = f(xi ) for each i from 1 to n. ∆x = n ∫ b f(x) dx is The (n + 1)-point Simpson’s Rule approximation to a given by n/2 ∑ ∆x ( ) Sn (f) = y2i + 4y2i+1 + y2i+2 3 i=1 b−a( ) y0 + 4y1 + 2y2 + 4y3 + · · · + 2yn−2 + 4yn−1 + yn = 3n . . . . . .

Slide 33: Meet the Simpsons Thomas Simpson Homer Simpson (1710-1761) . . . . . .

Slide 34: Examples Example ∫ 1 x2 dx Use Simpson’s rule with n = 4 to estimate 0 . . . . . .

Slide 35: Examples Example ∫ 1 x2 dx Use Simpson’s rule with n = 4 to estimate 0 Solution } { ( )2 ( )2 ( )2 ( )2 } { y0 , y1 , y2 , y3 , y4 = 0, 1 , 2 , 3 , 4 4 4 4 4 So ( ) 1 1 4 9 16 0+4· +2· +4· S4 (f) = + 3·4 16 16 16 16 ( ) 1 4 + 8 + 36 + 16 1 64 1 · = = = 12 16 12 16 3 . . . . . .

Slide 36: Examples Example ∫ 1 x2 dx Use Simpson’s rule with n = 4 to estimate 0 Solution } { ( )2 ( )2 ( )2 ( )2 } { y0 , y1 , y2 , y3 , y4 = 0, 1 , 2 , 3 , 4 4 4 4 4 So ( ) 1 1 4 9 16 0+4· +2· +4· S4 (f) = + 3·4 16 16 16 16 ( ) 1 4 + 8 + 36 + 16 1 64 1 · = = = 12 16 12 16 3 No surprise we get the exact value; approximating a parabola with a parabola should be exact! . . . . . .

Slide 37: Your turn Example Use Simpson’s Rule with n = 8 to estimate ln 2. . . . . . .

Slide 38: Your turn Example Use Simpson’s Rule with n = 8 to estimate ln 2. Solution 0.693155 . . . . . .