Lecture 19 – Numerical Integration 1 Area under curve led to Riemann sum which led to FTC. But not...

12
Lecture 19 – Numerical Integration 1 Area under curve led to Riemann sum which led to FTC. dx e x 2 But not every function has a closed-form antiderivative. dx x e x

Transcript of Lecture 19 – Numerical Integration 1 Area under curve led to Riemann sum which led to FTC. But not...

Page 1: Lecture 19 – Numerical Integration 1 Area under curve led to Riemann sum which led to FTC. But not every function has a closed-form antiderivative.

1

Lecture 19 – Numerical Integration

Area under curve led to Riemann sum which led to FTC.

dxe x 2

But not every function has a closed-form antiderivative.

dxx

ex

Page 2: Lecture 19 – Numerical Integration 1 Area under curve led to Riemann sum which led to FTC. But not every function has a closed-form antiderivative.

2

Using rectangles based on the left endpoint of each subinterval.

Using rectangles based on the right endpoints of each subinterval

a b

a b

Page 3: Lecture 19 – Numerical Integration 1 Area under curve led to Riemann sum which led to FTC. But not every function has a closed-form antiderivative.

3

Using rectangles based on the midpoint of each subinterval.

a brectangles width equaln

usingion approximatnM

Page 4: Lecture 19 – Numerical Integration 1 Area under curve led to Riemann sum which led to FTC. But not every function has a closed-form antiderivative.

4

Regardless of what determines height:

x

*ixf

*ixfx *

ixfx

*ixfx

Page 5: Lecture 19 – Numerical Integration 1 Area under curve led to Riemann sum which led to FTC. But not every function has a closed-form antiderivative.

5

Example 1

estimate

*6

*5

*4

*3

*2

*1)20( xfxfxfxfxfxf

Use the midpoint rule to estimate the area from 0 to 120.

120

2468 02

6

0120

x

*ixfx

Page 6: Lecture 19 – Numerical Integration 1 Area under curve led to Riemann sum which led to FTC. But not every function has a closed-form antiderivative.

6

Example 2Compare the three rectangle methods in estimating area from

x = 1 to 9 using 4 subintervals.f(x)

x1 9

1 2 3 4 5 6 7 8 9

9

1

2 dxx

4L

4R

4M

Page 7: Lecture 19 – Numerical Integration 1 Area under curve led to Riemann sum which led to FTC. But not every function has a closed-form antiderivative.

7

Lecture 20 – More Numerical Integration

Instead of rectangles, look at other types easy to compute.

Trapezoid Rule: average of Left and Right estimates

Area for one trapezoid is (average length of parallel sides) times (width).

a b a b a b

Page 8: Lecture 19 – Numerical Integration 1 Area under curve led to Riemann sum which led to FTC. But not every function has a closed-form antiderivative.

8

Trapezoid Rule is the average of the left and right estimates, so

)()()()(L 1210 nn xfxfxfxfx

2T nnn

RL

x0 x1 xn-1x2 xn

)()()()(R 321 nn xfxfxfxfx

Page 9: Lecture 19 – Numerical Integration 1 Area under curve led to Riemann sum which led to FTC. But not every function has a closed-form antiderivative.

9

Simpson’s Rule: weighted average of Mid and Trap estimates

a

– must break into even number of subintervals

– areas under quadratic curves

– pairs of subintervals form quadratic function

b

Page 10: Lecture 19 – Numerical Integration 1 Area under curve led to Riemann sum which led to FTC. But not every function has a closed-form antiderivative.

10

Simpson’s Rule is the sum of these areas, so

...)2 area()1 area(S n

Calculate efficiency of estimates with absolute errors, relative errors, and percent error (change decimal of relative to %).

error absolute

error relative

Page 11: Lecture 19 – Numerical Integration 1 Area under curve led to Riemann sum which led to FTC. But not every function has a closed-form antiderivative.

11

Example 3Use the trapezoid and Simpson’s rules to estimate the integral.

9

9

1 ln dxx

1

8T

8S

Page 12: Lecture 19 – Numerical Integration 1 Area under curve led to Riemann sum which led to FTC. But not every function has a closed-form antiderivative.

12

Example 4Use the M6, T6, and S6 to fill in the table for the given integral.

8 8

2

lnx

1dx2 20855.4

Rule Estimate AbsoluteError

RelativeError

M6

T6

S6