Numerical Differentiation & Integration Numerical - - PowerPoint PPT Presentation

numerical differentiation integration numerical
SMART_READER_LITE
LIVE PREVIEW

Numerical Differentiation & Integration Numerical - - PowerPoint PPT Presentation

Numerical Differentiation & Integration Numerical Differentiation II Numerical Analysis (9th Edition) R L Burden & J D Faires Beamer Presentation Slides prepared by John Carroll Dublin City University c 2011 Brooks/Cole, Cengage


slide-1
SLIDE 1

Numerical Differentiation & Integration Numerical Differentiation II

Numerical Analysis (9th Edition) R L Burden & J D Faires

Beamer Presentation Slides prepared by John Carroll Dublin City University

c 2011 Brooks/Cole, Cengage Learning

slide-2
SLIDE 2

Numerical Example Higher Derivatives

Outline

1

Application of the 3-Point and 5-Point Formulae

Numerical Analysis (Chapter 4) Numerical Differentiation II R L Burden & J D Faires 2 / 21

slide-3
SLIDE 3

Numerical Example Higher Derivatives

Outline

1

Application of the 3-Point and 5-Point Formulae

2

Numerical Approximations to Higher Derivatives

Numerical Analysis (Chapter 4) Numerical Differentiation II R L Burden & J D Faires 2 / 21

slide-4
SLIDE 4

Numerical Example Higher Derivatives

Outline

1

Application of the 3-Point and 5-Point Formulae

2

Numerical Approximations to Higher Derivatives

Numerical Analysis (Chapter 4) Numerical Differentiation II R L Burden & J D Faires 3 / 21

slide-5
SLIDE 5

Numerical Example Higher Derivatives

Numerical Differentiation: Application of the Formulae

Example

Values for f(x) = xex are given in the following table: x 1.8 1.9 2.0 2.1 2.2 f(x) 10.889365 12.703199 14.778112 17.148957 19.855030 Use all the applicable three-point and five-point formulas to approximate f ′(2.0).

Numerical Analysis (Chapter 4) Numerical Differentiation II R L Burden & J D Faires 4 / 21

slide-6
SLIDE 6

Numerical Example Higher Derivatives

Numerical Differentiation: Application of the Formulae

Solution (1/4)

The data in the table permit us to find four different three-point approximations.

See 3-Point Endpoint & Midpoint Formulae Numerical Analysis (Chapter 4) Numerical Differentiation II R L Burden & J D Faires 5 / 21

slide-7
SLIDE 7

Numerical Example Higher Derivatives

Numerical Differentiation: Application of the Formulae

Solution (1/4)

The data in the table permit us to find four different three-point approximations.

See 3-Point Endpoint & Midpoint Formulae

We can use the endpoint formula with h = 0.1 or with h = −0.1, and

Numerical Analysis (Chapter 4) Numerical Differentiation II R L Burden & J D Faires 5 / 21

slide-8
SLIDE 8

Numerical Example Higher Derivatives

Numerical Differentiation: Application of the Formulae

Solution (1/4)

The data in the table permit us to find four different three-point approximations.

See 3-Point Endpoint & Midpoint Formulae

We can use the endpoint formula with h = 0.1 or with h = −0.1, and we can use the midpoint formula with h = 0.1 or with h = 0.2.

Numerical Analysis (Chapter 4) Numerical Differentiation II R L Burden & J D Faires 5 / 21

slide-9
SLIDE 9

Numerical Example Higher Derivatives

Numerical Differentiation: Application of the Formulae

Solution (2/4)

Using the 3-point endpoint formula with h = 0.1 gives 1 0.2[−3f(2.0) + 4f(2.1) − f(2.2]

Numerical Analysis (Chapter 4) Numerical Differentiation II R L Burden & J D Faires 6 / 21

slide-10
SLIDE 10

Numerical Example Higher Derivatives

Numerical Differentiation: Application of the Formulae

Solution (2/4)

Using the 3-point endpoint formula with h = 0.1 gives 1 0.2[−3f(2.0) + 4f(2.1) − f(2.2] = 5[−3(14.778112) + 4(17.148957) − 19.855030)]

Numerical Analysis (Chapter 4) Numerical Differentiation II R L Burden & J D Faires 6 / 21

slide-11
SLIDE 11

Numerical Example Higher Derivatives

Numerical Differentiation: Application of the Formulae

Solution (2/4)

Using the 3-point endpoint formula with h = 0.1 gives 1 0.2[−3f(2.0) + 4f(2.1) − f(2.2] = 5[−3(14.778112) + 4(17.148957) − 19.855030)] = 22.032310 and with h = −0.1 gives 22.054525.

Numerical Analysis (Chapter 4) Numerical Differentiation II R L Burden & J D Faires 6 / 21

slide-12
SLIDE 12

Numerical Example Higher Derivatives

Numerical Differentiation: Application of the Formulae

Solution (2/4)

Using the 3-point endpoint formula with h = 0.1 gives 1 0.2[−3f(2.0) + 4f(2.1) − f(2.2] = 5[−3(14.778112) + 4(17.148957) − 19.855030)] = 22.032310 and with h = −0.1 gives 22.054525. Using the 3-point midpoint formula with h = 0.1 gives 1 0.2[f(2.1) − f(1.9]

Numerical Analysis (Chapter 4) Numerical Differentiation II R L Burden & J D Faires 6 / 21

slide-13
SLIDE 13

Numerical Example Higher Derivatives

Numerical Differentiation: Application of the Formulae

Solution (2/4)

Using the 3-point endpoint formula with h = 0.1 gives 1 0.2[−3f(2.0) + 4f(2.1) − f(2.2] = 5[−3(14.778112) + 4(17.148957) − 19.855030)] = 22.032310 and with h = −0.1 gives 22.054525. Using the 3-point midpoint formula with h = 0.1 gives 1 0.2[f(2.1) − f(1.9] = 5(17.148957 − 12.7703199)

Numerical Analysis (Chapter 4) Numerical Differentiation II R L Burden & J D Faires 6 / 21

slide-14
SLIDE 14

Numerical Example Higher Derivatives

Numerical Differentiation: Application of the Formulae

Solution (2/4)

Using the 3-point endpoint formula with h = 0.1 gives 1 0.2[−3f(2.0) + 4f(2.1) − f(2.2] = 5[−3(14.778112) + 4(17.148957) − 19.855030)] = 22.032310 and with h = −0.1 gives 22.054525. Using the 3-point midpoint formula with h = 0.1 gives 1 0.2[f(2.1) − f(1.9] = 5(17.148957 − 12.7703199) = 22.228790 and with h = 0.2 gives 22.414163.

Numerical Analysis (Chapter 4) Numerical Differentiation II R L Burden & J D Faires 6 / 21

slide-15
SLIDE 15

Numerical Example Higher Derivatives

Numerical Differentiation: Application of the Formulae

Solution (3/4)

The only five-point formula for which the table gives sufficient data is the midpoint formula

See Formula with h = 0.1. Numerical Analysis (Chapter 4) Numerical Differentiation II R L Burden & J D Faires 7 / 21

slide-16
SLIDE 16

Numerical Example Higher Derivatives

Numerical Differentiation: Application of the Formulae

Solution (3/4)

The only five-point formula for which the table gives sufficient data is the midpoint formula

See Formula with h = 0.1. This gives

1 1.2[f(1.8) − 8f(1.9) + 8f(2.1) − f(2.2)] = 1 1.2[10.889365 − 8(12.703199) + 8(17.148957) − 19.855030] =22.166999

Numerical Analysis (Chapter 4) Numerical Differentiation II R L Burden & J D Faires 7 / 21

slide-17
SLIDE 17

Numerical Example Higher Derivatives

Numerical Differentiation: Application of the Formulae

Solution (3/4)

The only five-point formula for which the table gives sufficient data is the midpoint formula

See Formula with h = 0.1. This gives

1 1.2[f(1.8) − 8f(1.9) + 8f(2.1) − f(2.2)] = 1 1.2[10.889365 − 8(12.703199) + 8(17.148957) − 19.855030] =22.166999 If we had no other information, we would accept the five-point midpoint approximation using h = 0.1 as the most accurate, and expect the true value to be between that approximation and the three-point mid-point approximation, that is in the interval [22.166, 22.229].

Numerical Analysis (Chapter 4) Numerical Differentiation II R L Burden & J D Faires 7 / 21

slide-18
SLIDE 18

Numerical Example Higher Derivatives

Numerical Differentiation: Application of the Formulae

Solution (4/4)

The true value in this case is f ′(2.0) = (2 + 1)e2 = 22.167168, so the approximation errors are actually: Method h Approximation Error Three-point endpoint 0.1 1.35 × 10−1 Three-point endpoint −0.1 1.13 × 10−1 Three-point midpoint 0.2 −2.47 × 10−1 Three-point midpoint 0.1 −6.16 × 10−2 Five-point midpoint 0.1 1.69 × 10−4

Numerical Analysis (Chapter 4) Numerical Differentiation II R L Burden & J D Faires 8 / 21

slide-19
SLIDE 19

Numerical Example Higher Derivatives

Outline

1

Application of the 3-Point and 5-Point Formulae

2

Numerical Approximations to Higher Derivatives

Numerical Analysis (Chapter 4) Numerical Differentiation II R L Burden & J D Faires 9 / 21

slide-20
SLIDE 20

Numerical Example Higher Derivatives

Numerical Approximations to Higher Derivatives

Illustrative Method of Construction

Numerical Analysis (Chapter 4) Numerical Differentiation II R L Burden & J D Faires 10 / 21

slide-21
SLIDE 21

Numerical Example Higher Derivatives

Numerical Approximations to Higher Derivatives

Illustrative Method of Construction

Expand a function f in a third Taylor polynomial about a point x0 and evaluate at x0 + h and x0 − h.

Numerical Analysis (Chapter 4) Numerical Differentiation II R L Burden & J D Faires 10 / 21

slide-22
SLIDE 22

Numerical Example Higher Derivatives

Numerical Approximations to Higher Derivatives

Illustrative Method of Construction

Expand a function f in a third Taylor polynomial about a point x0 and evaluate at x0 + h and x0 − h. Then f(x0 + h) = f(x0) + f ′(x0)h + 1 2f ′′(x0)h2 + 1 6f ′′′(x0)h3 + 1 24f (4)(ξ1)h4

Numerical Analysis (Chapter 4) Numerical Differentiation II R L Burden & J D Faires 10 / 21

slide-23
SLIDE 23

Numerical Example Higher Derivatives

Numerical Approximations to Higher Derivatives

Illustrative Method of Construction

Expand a function f in a third Taylor polynomial about a point x0 and evaluate at x0 + h and x0 − h. Then f(x0 + h) = f(x0) + f ′(x0)h + 1 2f ′′(x0)h2 + 1 6f ′′′(x0)h3 + 1 24f (4)(ξ1)h4 and f(x0 − h) = f(x0) − f ′(x0)h + 1 2f ′′(x0)h2 − 1 6f ′′′(x0)h3 + 1 24f (4)(ξ−1)h4 where x0 − h < ξ−1 < x0 < ξ1 < x0 + h.

Numerical Analysis (Chapter 4) Numerical Differentiation II R L Burden & J D Faires 10 / 21

slide-24
SLIDE 24

Numerical Example Higher Derivatives

Numerical Approximations to Higher Derivatives

f(x0 + h) = f(x0) + f ′(x0)h + 1 2f ′′(x0)h2 + 1 6f ′′′(x0)h3 + 1 24f (4)(ξ1)h4 f(x0 − h) = f(x0) − f ′(x0)h + 1 2f ′′(x0)h2 − 1 6f ′′′(x0)h3 + 1 24f (4)(ξ−1)h4

Illustrative Method of Construction (Cont’d)

If we add these equations, the terms involving f ′(x0) and −f ′(x0) cancel,

Numerical Analysis (Chapter 4) Numerical Differentiation II R L Burden & J D Faires 11 / 21

slide-25
SLIDE 25

Numerical Example Higher Derivatives

Numerical Approximations to Higher Derivatives

f(x0 + h) = f(x0) + f ′(x0)h + 1 2f ′′(x0)h2 + 1 6f ′′′(x0)h3 + 1 24f (4)(ξ1)h4 f(x0 − h) = f(x0) − f ′(x0)h + 1 2f ′′(x0)h2 − 1 6f ′′′(x0)h3 + 1 24f (4)(ξ−1)h4

Illustrative Method of Construction (Cont’d)

If we add these equations, the terms involving f ′(x0) and −f ′(x0) cancel, so f(x0 + h) + f(x0 − h) = 2f(x0) + f ′′(x0)h2 + 1 24[f (4)(ξ1) + f (4)(ξ−1)]h4

Numerical Analysis (Chapter 4) Numerical Differentiation II R L Burden & J D Faires 11 / 21

slide-26
SLIDE 26

Numerical Example Higher Derivatives

Numerical Approximations to Higher Derivatives

f(x0 + h) = f(x0) + f ′(x0)h + 1 2f ′′(x0)h2 + 1 6f ′′′(x0)h3 + 1 24f (4)(ξ1)h4 f(x0 − h) = f(x0) − f ′(x0)h + 1 2f ′′(x0)h2 − 1 6f ′′′(x0)h3 + 1 24f (4)(ξ−1)h4

Illustrative Method of Construction (Cont’d)

If we add these equations, the terms involving f ′(x0) and −f ′(x0) cancel, so f(x0 + h) + f(x0 − h) = 2f(x0) + f ′′(x0)h2 + 1 24[f (4)(ξ1) + f (4)(ξ−1)]h4 Solving this equation for f ′′(x0) gives f ′′(x0) = 1 h2 [f(x0 − h) − 2f(x0) + f(x0 + h)] − h2 24[f (4)(ξ1) + f (4)(ξ−1)]

Numerical Analysis (Chapter 4) Numerical Differentiation II R L Burden & J D Faires 11 / 21

slide-27
SLIDE 27

Numerical Example Higher Derivatives

Numerical Approximations to Higher Derivatives

f ′′(x0) = 1 h2 [f(x0 − h) − 2f(x0) + f(x0 + h)] − h2 24[f (4)(ξ1) + f (4)(ξ−1)]

Illustrative Method of Construction (Cont’d)

Suppose f (4) is continuous on [x0 − h, x0 + h]. Since

1 2[f (4)(ξ1) + f (4)(ξ−1)] is between f (4)(ξ1) and f (4)(ξ−1), the

Intermediate Value Theorem

Theorem implies that a number ξ exists

between ξ1 and ξ−1, and hence in (x0 − h, x0 + h), with f (4)(ξ) = 1 2

  • f (4)(ξ1) + f (4)(ξ−1)
  • Numerical Analysis (Chapter 4)

Numerical Differentiation II R L Burden & J D Faires 12 / 21

slide-28
SLIDE 28

Numerical Example Higher Derivatives

Numerical Approximations to Higher Derivatives

f ′′(x0) = 1 h2 [f(x0 − h) − 2f(x0) + f(x0 + h)] − h2 24[f (4)(ξ1) + f (4)(ξ−1)]

Illustrative Method of Construction (Cont’d)

Suppose f (4) is continuous on [x0 − h, x0 + h]. Since

1 2[f (4)(ξ1) + f (4)(ξ−1)] is between f (4)(ξ1) and f (4)(ξ−1), the

Intermediate Value Theorem

Theorem implies that a number ξ exists

between ξ1 and ξ−1, and hence in (x0 − h, x0 + h), with f (4)(ξ) = 1 2

  • f (4)(ξ1) + f (4)(ξ−1)
  • This permits us to rewrite the formula in its final form:

Numerical Analysis (Chapter 4) Numerical Differentiation II R L Burden & J D Faires 12 / 21

slide-29
SLIDE 29

Numerical Example Higher Derivatives

Numerical Approximations to Higher Derivatives

f ′′(x0) = 1 h2 [f(x0 − h) − 2f(x0) + f(x0 + h)] − h2 24[f (4)(ξ1) + f (4)(ξ−1)]

Second Derivative Midpoint Formula

f ′′(x0) = 1 h2 [f(x0 − h) − 2f(x0) + f(x0 + h)] − h2 12f (4)(ξ) for some ξ, where x0 − h < ξ < x0 + h.

Numerical Analysis (Chapter 4) Numerical Differentiation II R L Burden & J D Faires 13 / 21

slide-30
SLIDE 30

Numerical Example Higher Derivatives

Numerical Approximations to Higher Derivatives

f ′′(x0) = 1 h2 [f(x0 − h) − 2f(x0) + f(x0 + h)] − h2 24[f (4)(ξ1) + f (4)(ξ−1)]

Second Derivative Midpoint Formula

f ′′(x0) = 1 h2 [f(x0 − h) − 2f(x0) + f(x0 + h)] − h2 12f (4)(ξ) for some ξ, where x0 − h < ξ < x0 + h. Note: If f (4) is continuous on [x0 − h, x0 + h], then it is also bounded, and the approximation is O(h2).

Numerical Analysis (Chapter 4) Numerical Differentiation II R L Burden & J D Faires 13 / 21

slide-31
SLIDE 31

Numerical Example Higher Derivatives

Numerical Approximations to Higher Derivatives

Example (Second Derivative Midpoint Formula)

Values for f(x) = xex are given in the following table: x 1.8 1.9 2.0 2.1 2.2 f(x) 10.889365 12.703199 14.778112 17.148957 19.855030 Use the second derivative midpoint formula

Formula approximate

f ′(2.0).

Numerical Analysis (Chapter 4) Numerical Differentiation II R L Burden & J D Faires 14 / 21

slide-32
SLIDE 32

Numerical Example Higher Derivatives

Numerical Approximations to Higher Derivatives

Example (Second Derivative Midpoint Formula): Cont’d

The data permits us to determine two approximations for f ′′(2.0).

Numerical Analysis (Chapter 4) Numerical Differentiation II R L Burden & J D Faires 15 / 21

slide-33
SLIDE 33

Numerical Example Higher Derivatives

Numerical Approximations to Higher Derivatives

Example (Second Derivative Midpoint Formula): Cont’d

The data permits us to determine two approximations for f ′′(2.0). Using the formula with h = 0.1 gives 1 0.01[f(1.9) − 2f(2.0) + f(2.1)]

Numerical Analysis (Chapter 4) Numerical Differentiation II R L Burden & J D Faires 15 / 21

slide-34
SLIDE 34

Numerical Example Higher Derivatives

Numerical Approximations to Higher Derivatives

Example (Second Derivative Midpoint Formula): Cont’d

The data permits us to determine two approximations for f ′′(2.0). Using the formula with h = 0.1 gives 1 0.01[f(1.9) − 2f(2.0) + f(2.1)] = 100[12.703199 − 2(14.778112) + 17.148957] = 29.593200

Numerical Analysis (Chapter 4) Numerical Differentiation II R L Burden & J D Faires 15 / 21

slide-35
SLIDE 35

Numerical Example Higher Derivatives

Numerical Approximations to Higher Derivatives

Example (Second Derivative Midpoint Formula): Cont’d

The data permits us to determine two approximations for f ′′(2.0). Using the formula with h = 0.1 gives 1 0.01[f(1.9) − 2f(2.0) + f(2.1)] = 100[12.703199 − 2(14.778112) + 17.148957] = 29.593200 and using the formula with h = 0.2 gives 1 0.04[f(1.8) − 2f(2.0) + f(2.2)]

Numerical Analysis (Chapter 4) Numerical Differentiation II R L Burden & J D Faires 15 / 21

slide-36
SLIDE 36

Numerical Example Higher Derivatives

Numerical Approximations to Higher Derivatives

Example (Second Derivative Midpoint Formula): Cont’d

The data permits us to determine two approximations for f ′′(2.0). Using the formula with h = 0.1 gives 1 0.01[f(1.9) − 2f(2.0) + f(2.1)] = 100[12.703199 − 2(14.778112) + 17.148957] = 29.593200 and using the formula with h = 0.2 gives 1 0.04[f(1.8) − 2f(2.0) + f(2.2)] = 25[10.889365 − 2(14.778112) + 19.855030] = 29.704275

Numerical Analysis (Chapter 4) Numerical Differentiation II R L Burden & J D Faires 15 / 21

slide-37
SLIDE 37

Numerical Example Higher Derivatives

Numerical Approximations to Higher Derivatives

Example (Second Derivative Midpoint Formula): Cont’d

The data permits us to determine two approximations for f ′′(2.0). Using the formula with h = 0.1 gives 1 0.01[f(1.9) − 2f(2.0) + f(2.1)] = 100[12.703199 − 2(14.778112) + 17.148957] = 29.593200 and using the formula with h = 0.2 gives 1 0.04[f(1.8) − 2f(2.0) + f(2.2)] = 25[10.889365 − 2(14.778112) + 19.855030] = 29.704275 The exact value is f ′′(2.0) = 29.556224. Hence the actual errors are −3.70 × 10−2 and −1.48 × 10−1, respectively.

Numerical Analysis (Chapter 4) Numerical Differentiation II R L Burden & J D Faires 15 / 21

slide-38
SLIDE 38

Questions?

slide-39
SLIDE 39

Reference Material

slide-40
SLIDE 40

Intermediate Value Theorem

If f ∈ C[a, b] and K is any number between f(a) and f(b), then there exists a number c ∈ (a, b) for which f(c) = K.

x y f(a) f(b) y 5 f (x) K (a, f(a)) (b, f(b)) a b c

(The diagram shows one of 3 possibilities for this function and interval.)

Return to Numerical Approximations to Higher Derivatives

slide-41
SLIDE 41

Numerical Differentiation Formulae

Three-Point Endpoint Formula

f ′(x0) = 1 2h[−3f(x0) + 4f(x0 + h) − f(x0 + 2h)] + h2 3 f (3)(ξ0) where ξ0 lies between x0 and x0 + 2h.

Three-Point Midpoint Formula

f ′(x0) = 1 2h[f(x0 + h) − f(x0 − h)] − h2 6 f (3)(ξ1) where ξ1 lies between x0 − h and x0 + h.

Return to 3-Point Calculations

slide-42
SLIDE 42

Numerical Differentiation Formulae

Five-Point Midpoint Formula

f ′(x0) = 1 12h[f(x0 − 2h) − 8f(x0 − h) + 8f(x0 + h) − f(x0 + 2h)] + h4 30f (5)(ξ) where ξ lies between x0 − 2h and x0 + 2h.

Five-Point Endpoint Formula

f ′(x0) = 1 12h[−25f(x0) + 48f(x0 + h) − 36f(x0 + 2h) + 16f(x0 + 3h) − 3f(x0 + 4h)] + h4 5 f (5)(ξ) where ξ lies between x0 and x0 + 4h.

Return to 5-Point Calculations

slide-43
SLIDE 43

Numerical Differentiation Formulae

Second Derivative Midpoint Formula

f ′′(x0) = 1 h2 [f(x0 − h) − 2f(x0) + f(x0 + h)] − h2 12f (4)(ξ) for some ξ, where x0 − h < ξ < x0 + h.

Return to Example on the Second Derivative Midpoint Formula