LECTURE 14 NUMERICAL INTEGRATION. Find

Similar documents
Simpson s 1/3 Rule Simpson s 1/3 rule assumes 3 equispaced data/interpolation/integration points

Numerical Differentiation

Order of Accuracy. ũ h u Ch p, (1)

The total error in numerical differentiation

Consider a function f we ll specify which assumptions we need to make about it in a minute. Let us reformulate the integral. 1 f(x) dx.

Section 3.1: Derivatives of Polynomials and Exponential Functions

lecture 26: Richardson extrapolation

The Derivative as a Function

Higher Derivatives. Differentiable Functions

NUMERICAL DIFFERENTIATION

AMS 147 Computational Methods and Applications Lecture 09 Copyright by Hongyun Wang, UCSC. Exact value. Effect of round-off error.

Chapter 8. Numerical Solution of Ordinary Differential Equations. Module No. 2. Predictor-Corrector Methods

How to Find the Derivative of a Function: Calculus 1

Click here to see an animation of the derivative

Polynomial Interpolation

Chapter 5 FINITE DIFFERENCE METHOD (FDM)

Continuity. Example 1

Numerical Analysis MTH603. dy dt = = (0) , y n+1. We obtain yn. Therefore. and. Copyright Virtual University of Pakistan 1

1 Lecture 13: The derivative as a function.

3.4 Worksheet: Proof of the Chain Rule NAME

Polynomial Interpolation

2.3 Product and Quotient Rules

5.1 introduction problem : Given a function f(x), find a polynomial approximation p n (x).

LIMITATIONS OF EULER S METHOD FOR NUMERICAL INTEGRATION

Applied Linear Statistical Models. Simultaneous Inference Topics. Simultaneous Estimation of β 0 and β 1 Issues. Simultaneous Inference. Dr.

Mathematics 5 Worksheet 11 Geometry, Tangency, and the Derivative

2.8 The Derivative as a Function

232 Calculus and Structures

The Verlet Algorithm for Molecular Dynamics Simulations

Math 102 TEST CHAPTERS 3 & 4 Solutions & Comments Fall 2006

Math Spring 2013 Solutions to Assignment # 3 Completion Date: Wednesday May 15, (1/z) 2 (1/z 1) 2 = lim

Lecture XVII. Abstract We introduce the concept of directional derivative of a scalar function and discuss its relation with the gradient operator.

Section 15.6 Directional Derivatives and the Gradient Vector

Continuity and Differentiability Worksheet

4. The slope of the line 2x 7y = 8 is (a) 2/7 (b) 7/2 (c) 2 (d) 2/7 (e) None of these.

Lecture 15. Interpolation II. 2 Piecewise polynomial interpolation Hermite splines

Math 1241 Calculus Test 1

Derivatives. if such a limit exists. In this case when such a limit exists, we say that the function f is differentiable.

Math 242: Principles of Analysis Fall 2016 Homework 7 Part B Solutions

DELFT UNIVERSITY OF TECHNOLOGY Faculty of Electrical Engineering, Mathematics and Computer Science

Calculus I - Spring 2014

1. Consider the trigonometric function f(t) whose graph is shown below. Write down a possible formula for f(t).

Chapter 1D - Rational Expressions

Math 212-Lecture 9. For a single-variable function z = f(x), the derivative is f (x) = lim h 0

Lecture 21. Numerical differentiation. f ( x+h) f ( x) h h

Name: Answer Key No calculators. Show your work! 1. (21 points) All answers should either be,, a (finite) real number, or DNE ( does not exist ).

Precalculus Test 2 Practice Questions Page 1. Note: You can expect other types of questions on the test than the ones presented here!

2.3 More Differentiation Patterns

, meant to remind us of the definition of f (x) as the limit of difference quotients: = lim

Taylor Series and the Mean Value Theorem of Derivatives

Kernel Density Estimation

MATH745 Fall MATH745 Fall

Numerical Integra/on

A = h w (1) Error Analysis Physics 141

Section 2.7 Derivatives and Rates of Change Part II Section 2.8 The Derivative as a Function. at the point a, to be. = at time t = a is

Differentiation in higher dimensions

1. Questions (a) through (e) refer to the graph of the function f given below. (A) 0 (B) 1 (C) 2 (D) 4 (E) does not exist

SECTION 3.2: DERIVATIVE FUNCTIONS and DIFFERENTIABILITY

The Derivative The rate of change

Pre-Calculus Review Preemptive Strike

Fall 2014 MAT 375 Numerical Methods. Numerical Differentiation (Chapter 9)

We name Functions f (x) or g(x) etc.

Tangent Lines-1. Tangent Lines

Exercises for numerical differentiation. Øyvind Ryan

5 Ordinary Differential Equations: Finite Difference Methods for Boundary Problems

Copyright c 2008 Kevin Long

5.1 We will begin this section with the definition of a rational expression. We

Derivatives of Exponentials

(4.2) -Richardson Extrapolation

Analytic Functions. Differentiable Functions of a Complex Variable

NUMERICAL DIFFERENTIATION. James T. Smith San Francisco State University. In calculus classes, you compute derivatives algebraically: for example,

These error are made from replacing an infinite process by finite one.

Chapter Seven The Quantum Mechanical Simple Harmonic Oscillator

Recall from our discussion of continuity in lecture a function is continuous at a point x = a if and only if

University Mathematics 2

Calculus I Practice Exam 1A

Chapter 4: Numerical Methods for Common Mathematical Problems

Department of Mathematics, K.T.H.M. College, Nashik F.Y.B.Sc. Calculus Practical (Academic Year )

Integration, differentiation, and root finding. Phys 420/580 Lecture 7

The Laplace equation, cylindrically or spherically symmetric case

LECTURE 16 GAUSS QUADRATURE In general for Newton-Cotes (equispaced interpolation points/ data points/ integration points/ nodes).

Poisson Equation in Sobolev Spaces

MATH1131/1141 Calculus Test S1 v8a

Practice Problem Solutions: Exam 1

Key Concepts. Important Techniques. 1. Average rate of change slope of a secant line. You will need two points ( a, the formula: to find value

1 Introduction to Optimization

MATH1151 Calculus Test S1 v2a

Rules of Differentiation

1 + t5 dt with respect to x. du = 2. dg du = f(u). du dx. dg dx = dg. du du. dg du. dx = 4x3. - page 1 -

0.1 Differentiation Rules

1. Which one of the following expressions is not equal to all the others? 1 C. 1 D. 25x. 2. Simplify this expression as much as possible.

MVT and Rolle s Theorem

(a) At what number x = a does f have a removable discontinuity? What value f(a) should be assigned to f at x = a in order to make f continuous at a?

Lesson 6: The Derivative

Exam 1 Review Solutions

Chapters 19 & 20 Heat and the First Law of Thermodynamics

1 1. Rationalize the denominator and fully simplify the radical expression 3 3. Solution: = 1 = 3 3 = 2

Finding and Using Derivative The shortcuts

Definition of the Derivative

= 0 and states ''hence there is a stationary point'' All aspects of the proof dx must be correct (c)

Transcription:

LECTURE 14 NUMERCAL NTEGRATON Find b a fxdx or b a vx ux fx ydy dx Often integration is required. However te form of fx may be suc tat analytical integration would be very difficult or impossible. Use numerical integration tecniques. Finite element (FE) metods are based on integrating errors over a domain. Typically we use numerical integrators. Numerical integration metods are developed by integrating interpolating polynomials. p. 14.1

Trapezoidal Rule Trapezoidal rule uses a first degree Lagrange approximating polynomial ( N 1, N + 1 nodes, linear interpolation). 76 f 0 f(x) g(x) f 1 x 0 Define te linear interpolating function gx f x o --------------- x + f 1 --------------- Establis te integration rule by computing fxdx gx + ex dx p. 14.

gxdx + E f x o --------------- x f 1 --------------- + dx + E x x ---- f o ------------------ x ---- x o x + f 1 ------------------ + E x 1 x 1 ------ f o -------------------- + x 1 f 1 ------ x 1 ----------------------- ---- f o --------------------- x o f 1 ---- x o --------------- x o + E Trapezoidal Rule ---------------- fo + f 1 + E p. 14.3

Trapezoidal Rule integrates te area of te trapezoid between te two data or interpolation points. Evaluating te error for trapezoidal rule. Te error E is dependent on te integral of te difference ex fx gx. However integrating te dependent error approximation for te interpolating function does not work out in general since is a function of x! We must express ex in terms of a series of terms expanded about in order to evaluate E exdx correctly. An alternative strategy is to evaluate E fxdx --------------- fo + f 1 by developing Taylor series expansions for fx, f o and f 1. We do note tat as E p. 14.4

Evaluation of te Error for Trapezoidal Rule Evaluation of te error by integrating e(x) We note tat x N xn x N E gxdx E fxdx gxdx However x N x N x N ex fx gx ex dx fx dx gxdx Tus x N E exdx Recall tat ex for Lagrange interpolation was expressed as: ex --------------------------------------------------------------- x x x x N N + 1! f N + 1 p. 14.5

Notes Procedure applies to iger order integration rules as well. n general is a function of x Neglecting te dependence of x, can lead to incorrect results. e.g. for Simpson s 1 -- rule you will integrate out te dependent term and te result would be E 0! 3 A way you can apply E exdx is to take ex as a series of terms! Ten we will always get te correct answer! Evaluation of te error for Trapezoidal Rule by Taylor Series expansion E --------------- fo + f 1 E fxdx --------------- fo + f 1 p. 14.6

Let s now develop Taylor series expansions for fx, f o and f 1 about x 77 x x 0 x n general Taylor series expansion about x: + --------------- fx fx x xf 1 x x + x+ ----------------- f! x + Ox x 3 Now evaluate f o fx o using te Taylor series f o fx xf 1 x + x + --------------------f x + Ox o x 3 However since x -- f o fx -- f 1 x + ---- f 8 x + O 3 p. 14.7

Similarly f 1 fx + -- f 1 x + ---- f 8 x + O 3 Let s substitute in for fx, f o and f 1 into te expression for E E fx x xf 1 x x + x + ----------------- f! x+ Ox x 3 dx x 0 --------------- fx --f 1 x+ ---- f 8 x+ O 3 fx -- f 1 + + x+ ---- f 8 x + O 3 E fxx x x ----------------- f 1 x x + x+ ----------------- 3 f 6 x + Ox x 4 -------------------- fx + ---- f 4 x + O 3 p. 14.8

E fx x --------------------f 1 x + x --------------------f 1 x x 3 + --------------------f 6 x x 3 --------------------f 6 x+ Ox 1 x 4 + Ox o x 4 E x fx -------------------- 8 f 1 x+ --------------------O 3 ----f 8 1 x ---- f 8 1 x -----f 3 48 x -----f 3 48 x O 4 + + + ---- 3 f 8 x + O 4 Notes E 3 Higer order terms ave been truncated in tis error expression. Tis integration will be exact only for ----- f 1 x linear. However it is tird order accurate in Error evaluation procedure using T.S. applies to iger order metods as well fx p. 14.9

Extended Trapezoidal Rule Apply trapezoidal rule to multiple sub-intervals 78 f 0 f 1 f f i f N f(x) a x 0 x x i b x N x ntegrate eac sub-interval wit trapezoidal rule and sum Split ab into N equispaced sub-intervals wit Compute as: b a ----------- N b + f x dx fx dx a N 1 i 0 x i 1 x i p. 14.10

--------------- fo + f x --------------- 1 f1 + f x N x N 1 + + + ----------------------- fn 1 + f N + E ab -- f 0 + f 1 + f + + f N 1 + f E N + ab were f o fa f 1 fa + f fa +... f i fa + i Tus extended trapezoidal rule can be expressed as: N 1 -- fa + fb + fa + i were N i 1 b a ----------- p. 14.11

Error is simply te sum of te individual errors: were te average x witin eac sub-interval Defining te average of te second derivatives Tus x i E a b Error is nd order over te interval - ----- 1 3 f 1 E a b i 1 Tus te error over te interval decreases as. Te slope of error vs. on a log-log plot is. N x i 1 ----- b a 1 1 --- f N f 1 E a b N --- f N i 1 x i 1 ----- b a 1 f a b N i 1 x i p. 14.1

Romberg ntegration Uses extended trapezoidal rule wit two or more different integration point to integration point spacings (in tis case equal to te sub-interval spacing),, in conjunction wit te general form of te error in order to compute one or more terms in te series wic represents te error. Tis will ten result in a iger order estimate of te integrand. More importantly, it will allow us to easily derive an error estimate for te numerical integrations based on te results using te different grid spacings. Consider were te exact integrand, Ĩ + E ab Ĩ te approximate integral wit integration point to integration point spacing E ab te associated error. Ĩ -- fa b a ----------- 1 + fb + fa + i i 1 p. 14.13

n general te form of te error term if we ad worked out more terms in te error series. E ab C + D 4 + E 6 + O 8 Notes Te coefficient C ----- 1 b af 1 n general, C, D, E etc. are functions of te average of te various derivatives of over te interval of interest. f Tese coefficients are not dependent on te spacing. Also we do not worry about te exact form of tese coefficients. As far as we are concerned, tey are unknown constant coefficients over te interval a b. p. 14.14

Tus te integral Ĩ + C + D 4 + E 6 + O 8 Unknowns: te exact integral; CDE te coefficients of te error term. Knowns: Ĩ te approximation to te integral; te integration point spacing. We must generate equations to solve for some of te unknowns Solve for and C. Tis will improve te accuracy of to O 4! Two unknowns must ave two equations use two different integration point to integration point spacings. Ĩ 1 + C 1 + D 4 1 + E 6 1 + O 1 8 Ĩ + C + D 4 + E 6 + O 8 p. 14.15

We now ave two equations and can terefore solve for unknowns. te exact integral is unknown: C te leading coefficient of te error term is unknown. We can solve for and C. We can not solve for equations! D, E,... and te oter coefficients since we do not ave enoug We must select 1 and suc tat a b is divided into an integer number of sub-intervals. Let 1 base interval We compute te approximation to te integral twice. Ĩ Ĩ p. 14.16

Tus Ĩ + 4C + 16D 4 + 64E 6 + Ĩ + C + D 4 + E 6 + Two equations and unknowns. Tus we can solve for bot and C. O 8 O 8 Ĩ 4C 16D 4 64E 6 + O 8 4 4Ĩ + 4C + 4D 4 + 4E 6 + O 8 4Ĩ Ĩ ------------------------ 4 D 3 4 0E 6 + O 8 Terefore if you ave second order accurate approximations to Ĩ using Ĩ using You can extrapolate a 4t order accurate approximation using te above formula. p. 14.17

More importantly, we can estimate te errors for bot te coarse and te fine integration point solutions simply by solving for C using te simultaneous equations C Ĩ Ĩ -------------------- 5D + O 4 3 Tus te estimated error associated wit te coarse integration point spacing solution, using te coarse and fine integration point spacing solutions is, E ab 4 -- Ĩ 3 Ĩ + O 4 Te estimated error associated wit te fine integration point spacing solution, using te coarse and fine integration point spacing solutions is, E ab 1 -- Ĩ 3 Ĩ + O 4 p. 14.18

Example Consider: 8 0 5x ------- 4 4 x 8 3 + x + 1 dx ntegrating exactly 7 Let s integrate numerically fx 5x ------- 4 4 x 8 3 + x + 1 a 0 b 8 Apply extended trapezoidal rule using: 8 (using one interval of 8) 4 (using two intervals of 4) Apply te Romberg integration rule we derived wen two integral estimates were obtained using intervals and to obtain a fourt order estimate for te integral Estimate te errors associated wit te extended trapezoidal rule results p. 14.19

Applying 8 (using one interval of 8) 8 0 ----------- 1 Ĩ -------- fa + fb + f0 + i i 1 Ĩ 4 f0+ f8 + f0 + i Since te index i runs from 1 to 0, we do not evaluate te summation term. Tus 0 i 1 Ĩ 41 + 59 Ĩ 10 p. 14.0

Applying 4 (using two intervals of 4) 8 0 ----------- 1 Ĩ ---- fa + fb + fa + i i 1 Ĩ f0+ f8+ f0 + 4i 1 i 1 Ĩ f0 + f8+ f4 Ĩ 1 + 59+ 87 Ĩ 71 p. 14.1

We can obtain an O 4 accurate answer using te O trapezoidal rule results, Ĩ and Ĩ 4Ĩ Ĩ ----------------------- + O 3 4 4 71 10 ----------------------------------- + O 3 4 4.6667 + O 4 We can also estimate te error associated wit te two O trapezoidal rule results, Ĩ and Ĩ Let s estimate te error for te trapezoidal rule result wit 8 E ab estimated 4 -- Ĩ 3 Ĩ + O 4 4 -- 71 10 1877.33 3 Note tat te actual error for te trapezoidal rule results wit 8 p. 14.

E ab actual Ĩ 7 10 048. Let s estimate te error for te trapezoidal rule results wit 4 E ab estimated 1 -- Ĩ 3 Ĩ + O 4 1 -- 71 10 469.33 3 Note tat te actual error for te trapezoidal rule results wit 4 equals E ab actual Ĩ 7 71 640. Romberg ntegration Using 3 Estimates of te ntegral Let s consider using tree estimates on Ĩ 1 + C 1 + D 4 1 + E 6 1 + O 1 8 Ĩ + C + D 4 + E 6 + O 8 p. 14.3

Ĩ 3 + C 3 + D 4 3 + E 6 3 + O 3 8 Tree equations we can solve for tree unknowns: Solve for exact integral and and D coefficients of te first two terms in te error series! C Terefore we can now derive an O 6 accurate approximation to Apply integration point spacings:, and 1 3 ----. Estimates of te integral are related to te exact integral,, as: Ĩ + 4C + 16D 4 + 64E 6 + O 8 Ĩ + C + D 4 + E 6 + O 8 C Ĩ --- D 4 ----- 4 E + + 16 + ----- 6 64 + O 8 We can solve for te unknowns, C and D! ---- p. 14.4

1 ----- 64Ĩ 45 ---- 0Ĩ + Ĩ E + 6 + O 8 SUMMARY OF LECTURE 14 Trapezoidal rule is simply applying linear interpolation between two points and integrating te approximating polynomial. Error for Trapezoidal Rule Te error can be determined by computing ex dx if ex is expressed in series form. Te error can also be determined by Taylor series expansions of te integration formula and te exact integral. Extended trapezoidal rule applies piecewise linear approximations and sums up individual integrals. Error for extended trapezoidal rule is obtained simply by adding errors over all subintervals p. 14.5

Romberg ntegration Uses trapezoidal rule wit different intervals. Extrapolates a better answer by estimating te error. Tis can be a muc more efficient process tan increasing te number of intervals. Romberg ntegration can be applied to any of te integration metods we will develop p. 14.6