Docsity

Numerical Differentiation, Numerical Integration - Notes | MATH 441, Study notes of Mathematical Methods for Numerical Analysis and Optimization

Toggle sidebar
bg1
MATH 441/541 - Numerical Analysis
Ninth Meeting: Interpolation
Thursday, October 25th, 2007
Numerical Differentiation
•Section 4.1: Numerical Differentiation (the Calculus Way!) Approximating f0(x0):
– Finding a Bound for the Error:
1. Using the Taylor Polynomial:
2. Using Lagrange Polynomials:
3. A Problem to Be Aware Of When Reducing Size of Error:
4. Forward-Difference vs. Backward-Difference Formula:
– Higher Order Methods: (n+ 1)-Point Formulas
1. Derivation:
2. Three and Five-Point Formulas, Examples:
Problem # 9(b)
x f(x)f0(x)
-3.0 9.367879
-2.8 8.233241
-2.6 7.180350
-2.4 6.209329
-2.2 5.320305
-2.0 4.513417
– Higher Order Derivatives
– Comparing Roundoff Error to Truncation Error:
– When Do We Really Want to Approximate the Derivative Numerically?
An Example: Consider the following boundary value problem:
(x+ 1)y00 +xy0+ 3y=g(x),0≤x≤1
subject to y(0) = 3, y (1) = 7
Numerical Integration
•Section 4.3: Basic Numerical Quadrature Methods
– What is Numerical Quadrature?
– Integrating the Lagrange Interpolating Polynomial
– Useful Theorems and Definitions:
∗Weighted Mean Value Theorem for Integrals: Suppose f∈C[a, b], the Riemann
integral of gexists on [a, b] and g(x) does not change sign on [a, b]. Then there exists a
number cin (a, b) with
Zb
a
f(x)g(x)dx =f(c)Zb
a
g(x)dx
∗Degree of Accuracy: The degree of accuracy, or precision, of a quadrature formula
is the largest positive integer nsuch that the formula is exact for f(x) = xk, for each
k= 0,1,· · · , n. (So, look at the error term. If it has derivatives of f(n), then all polynomials
of degree n−1 will vanish by the nth derivative, f(n).)
1
pf3

Partial preview of the text

Download Numerical Differentiation, Numerical Integration - Notes | MATH 441 and more Study notes Mathematical Methods for Numerical Analysis and Optimization in PDF only on Docsity!

MATH 441/541 - Numerical Analysis Ninth Meeting: Interpolation Thursday, October 25 th, 2007

Numerical Differentiation

  • Section 4.1: Numerical Differentiation (the Calculus Way!) Approximating f ′(x 0 ):
    • Finding a Bound for the Error:
      1. Using the Taylor Polynomial:
      2. Using Lagrange Polynomials:
      3. A Problem to Be Aware Of When Reducing Size of Error:
      4. Forward-Difference vs. Backward-Difference Formula:
    • Higher Order Methods: (n + 1)-Point Formulas
      1. Derivation:
      2. Three and Five-Point Formulas, Examples: Problem # 9(b) x f (x) f ′(x) -3.0 9. -2.8 8. -2.6 7. -2.4 6. -2.2 5. -2.0 4.
    • Higher Order Derivatives
    • Comparing Roundoff Error to Truncation Error:
    • When Do We Really Want to Approximate the Derivative Numerically?

An Example: Consider the following boundary value problem: (x + 1)y′′^ + xy′^ + 3y = g(x), 0 ≤ x ≤ 1 subject to y(0) = 3, y(1) = 7

Numerical Integration

  • Section 4.3: Basic Numerical Quadrature Methods
    • What is Numerical Quadrature?
    • Integrating the Lagrange Interpolating Polynomial
    • Useful Theorems and Definitions: ∗ Weighted Mean Value Theorem for Integrals: Suppose f ∈ C[a, b], the Riemann integral of g exists on [a, b] and g(x) does not change sign on [a, b]. Then there exists a number c in (a, b) with (^) ∫ b a

f (x)g(x) dx = f (c)

∫ (^) b

a

g(x) dx

∗ Degree of Accuracy: The degree of accuracy, or precision, of a quadrature formula is the largest positive integer n such that the formula is exact for f (x) = xk, for each k = 0, 1 , · · · , n. (So, look at the error term. If it has derivatives of f (n), then all polynomials of degree n − 1 will vanish by the nth^ derivative, f (n).)

  • Basic Quadrature Rules:
    1. Trapezoid Rule: Integrating the first order Lagrange Polynomial:
    2. Simpson’s Rule: Integrating the third order Taylor polynomial about x 1 over [x 0 , x 2 ]:
    3. (n + 1)-Point Open and Closed Newton-Cotes Formulas (a) The (n + 1)-point closed Newton-Cotes formula uses nodes xi = x 0 + ih for i = 0 , 1 , · · · , n where x 0 = a, xn = b and h = b−n a, approximating ∫ (^) b

a

f (x) dx =

∫ (^) xn

x 0

f (x) dx ≈

∑^ n

i=

aif (xi)

where ai =

∫ (^) xn x 0 Li(x). (b) The (n + 1)-point open Newton-Cotes formula uses nodes xi = x 0 + ih for i = 0 , 1 , · · · , n where x 0 = a + h, xn = b − h and h = bn−+2a , approximating

∫ (^) b

a

f (x) dx =

∫ (^) xn+

x− 1

f (x) dx ≈

∑^ n

i=

aif (xi)

with the same ai definition as above.

  1. Associated Error Values:

(a) For (n+1)-point closed Newton-Cotes formula Suppose that

∑n i=0 aif^ (xi) denotes the (n + 1)-point closed Newton-Cotes formula with x 0 = a, xn = b and h = (b − a)/n. There exists ξ ∈ (a, b) for which ∫ (^) b

a

f (x) dx =

∑^ n

i=

aif (xi) +

hn+3f (n+2)(ξ) (n + 2)!

∫ (^) n

0

t^2 (t − 1) · · · (t − n) dt

if n is even and f ∈ Cn+2[a, b], and ∫ (^) b

a

f (x) dx =

∑^ n

i=

aif (xi) +

hn+2f (n+1)(ξ) (n + 1)!

∫ (^) n

0

t(t − 1) · · · (t − n) dt

if n is odd and f ∈ Cn+1[a, b]. (b) For (n + 1)-point open Newton-Cotes formula Suppose that

∑n i=0 aif^ (xi) denotes the (n + 1)-point open Newton-Cotes formula with x 0 = a + h, xn = b − h and h = (b − a)/(n + 2). There exists ξ ∈ (a, b) for which ∫ (^) b

a

f (x) dx =

∑^ n

i=

aif (xi) +

hn+3f (n+2)(ξ) (n + 2)!

∫ (^) n+

− 1

t^2 (t − 1) · · · (t − n) dt

if n is even and f ∈ Cn+2[a, b], and ∫ (^) b

a

f (x) dx =

∑^ n

i=

aif (xi) +

hn+2f (n+1)(ξ) (n + 1)!

∫ (^) n+

− 1

t(t − 1) · · · (t − n) dt

if n is odd and f ∈ Cn+1[a, b].

  • Section 4.4: Composite Numerical Integration
    • The concept:
    • Composite Trapezoid’s Rule: