Numerical Integration

Size: px
Start display at page:

Download "Numerical Integration"

Transcription

1 Numerical Integration Sanzheng Qiao Department of Computing and Software McMaster University February, 2014

2 Outline 1 Introduction 2 Rectangle Rule 3 Trapezoid Rule 4 Error Estimates 5 Simpson s Rule 6 Richardson s Extrapolation 7 Adaptive Quadrature 8 2D Quadrature 9 Software Packages

3 Introduction Another (better) term: quadrature Problem: Given a function f(x) on x [a, b], calculate I(f) = b a f(x)dx.

4 Introduction (cont.) Partition a = x 1 < x 2 < < x n+1 = b, and denote h i = x i+1 x i. Then I(f) = I i I i = xi+1 x i f(x)dx Quadrature rule: Approximation of I i Composite quadrature rule: Approximation of I(f) as the sum of I i

5 Rectangle rule We use piecewise constant (degree zero polynomial) to approximate f(x) on each [x i, x i+1 ]. The function is evaluated at the midpoint y i = x i + x i+1, i = 1,..., n, 2 then the rectangle (quadrature) rule is: I i h i f(y i ) x i x i+1

6 Rectangle rule (cont.) The composite rectangle rule is: R(f) = h i f(y i ) A weighted sum of function values. Often the major computation is the evaluation of the function. Thus the complexity is measured by the number of function evaluations. In the rectangle rule Function evaluations: n. Evaluated at midpoints y i.

7 Trapezoid rule We use piecewise linear interpolation (degree one polynomial) to approximate f(x) on each [x i, x i+1 ]. The function is evaluated at the endpoints: I i h i f(x i )+f(x i+1 ) 2 xi xi+1

8 Trapezoid rule (cont.) Composite trapezoid rule: T(f) = h i f(x i )+f(x i+1 ) 2 = h 1 2 f(x 1)+ h 1 + h 2 f(x 2 ) A weighted sum of function values. + h n 1 + h n f(x n )+ h n f(x n+1) Function evaluations: n+1. Evaluated at endpoints x i

9 Error in rectangle rule Taylor expansion f(x) about the midpoint y i = (x i + x i+1 )/2: f(x) = f(y i )+ (x y i ) p f (p) (y i ). p! p=1 Integrate the both sides and note that xi+1 x i (x y i ) p dx = { h p+1 i (p+1)2 p even p 0 odd p

10 Error in rectangle rule (cont.) Then I i = xi+1 x i f(x)dx = h i f(y i ) h3 i f (y i ) h5 i f iv (y i )+ When h i is small, the error I(f) R(f) 1 hi 3 24 f (y i )+ 1 hi f iv (y i ) For equal spacing, h i = h, we have the error in the composite rectangle rule: I(f) R(f) h3 f (y i )+ h5 f iv (y i )

11 Error in trapezoid rule In order to make the error in the trapezoid rule comparable with that in the rectangle rule, we expand f(x) at the midpoint y i. Substituting x = x i and x = x i+1 in the Taylor expansion, we have Thus f(x i ) = f(y i )+ f(x i+1 ) = f(y i )+ ( 1) p hp i 2 p p! f(p) (y i ) p=1 p=1 h p i 2 p p! f(p) (y i ) f(x i )+f(x i+1 ) 2 = f(y i )+ 1 8 h2 i f (y i ) h4 i f iv (y i )+

12 Error in trapezoid rule (cont.) Recall that in the case of rectangle rule, we had I i = xi+1 x i f(x)dx = h i f(y i ) h3 i f (y i ) h5 i f iv (y i )+ Combining the above two equations, we have I i = xi+1 x i f(x)dx = h i f(x i )+f(x i+1 ) h3 i f (y i ) h5 i f iv (y i )+ Then the error in the composite trapezoid rule is I(f) T(f) 1 hi 3 12 f (y i ) 1 hi f iv (y i )+

13 Remarks Compare and I(f) R(f) h3 24 I(f) T(f) 1 12 f (y i )+ h h 3 i f (y i ) f iv (y i ) hi 5 f iv (y i )+ Usually rectangle rule (degree zero approximation) is more accurate than trapezoid rule (degree one approximation). Surprised?

14 Remarks Observe and I(f) R(f) h3 24 I(f) T(f) 1 12 f (y i )+ h h 3 i f (y i ) f iv (y i ) hi 5 f iv (y i )+ Using I(f) R(f) 1 3 (T(f) R(f)), we can estimate the error in R(f) using T(f) and R(f). Similarly, I(f) T(f) 2 3 (R(f) T(f)) can be used to estimate the error in T(f). (But they are approximations, it is possible that R(f) T(f) = 0 whereas I(f) R(f) 0).

15 Remarks Observe I(f) R(f) h3 24 f (y i )+ h f iv (y i ) When each h i is cut in half, I(f) R 1(f) 1 4 (I(f) R(f)). 2 (Why?) Similarly for the trapezoid rule. Doubling the number of panels in either the rectangle rule or the trapezoid rule, it can be expected to roughly quadruple the accuracy. This can be used to estimate the error as well as improving the accuracy. (How?)

16 Example Compute using the trapezoid rule. π 2 0 sin(x)dx m QCTrap(sin, 0.000, 1.571, m) error e e e e-4 where m is the number of points, that is, m 1 is the number of intervals.

17 Simpson s rule Recall the rectangle rule R(f) = I(f) 1 hi 3 24 f (y i ) and the trapezoid rule T(f) = I(f) h 3 i f (y i ) hi 5 f iv (y i )+ hi 5 f iv (y i )+ Combining the above two equations (canceling the O(h 3 i ) term), we get a more accurate method (Simpson s rule): S(f) = 2 3 R(f)+ 1 3 T(f) = I(f) hi 5 f iv (y i )+

18 Simpson s rule (cont.) Simpson s rule: I i = 2 3 h if( x i + x i+1 ) h f(x i )+f(x i+1 ) i 2 Composite Simpson s rule: S(f) = Function evaluations: 2n + 1 Error I(f) S(f) = [ 1 6 h i f(x i )+4f( x ] i + x i+1 )+f(x i+1 ) 2 hi 5 f iv (y i )+

19 Remarks Simpson s rule can also be derived by using piecewise quadratic (degree two) approximation. Actually, Simpson s rule is exact for cubic function (one extra order of accuracy), since the error term involves the fourth derivatives. Doubling the number of panels in Simpson s rule can be expected to reduce the error by roughly the factor of 1/16.

20 A general technique: Richardson s extrapolation Idea: Combining two approximations (e.g., R(f) and T(f)) which have similar error terms to achieve a more accurate approximation (e.g., S(f)). Example. Combining S(f) and S 1(f) to obtain an 2 approximation which has error of order hi 7. This gives the Romberg quadrature. Question What are the weights? Answer: S 1 2(f) 1 15 S(f)

21 What is adaptive quadrature? Given a predetermined tolerance ǫ, the algorithm automatically determines the panel sizes so that the computed approximation Q satisfies b Q f(x)dx < ǫ a Software interface: quad(fname, a, b, tol) Why adaptive? The algorithm uses large panel sizes for smooth parts and small panel sizes for the parts where the function changes rapidly. Thus the prescribed accuracy is attained at as small a cost in computing time. (Measured by the number of function evaluations.)

22 Basic idea Compute two approximations (Simpson s rule): one-panel formula P i = h [ i f(x 6 i )+4f(x i + h ] i 2 )+f(x i + h i ) two-panel formula Q i = h i 12 [ f(x i )+4f(x i + h i 4 )+2f(x i + h i 2 ) + 4f(x i + 3h i 4 )+f(x i + h i ) ]

23 Basic idea (cont.) Note From P i to Q i, we need only two function evaluations f(x i + h i 4 ) and f(x i + 3h i 4 ) Q i is the sum of two P s from two subintervals of length h i /2 Compare P i and Q i to obtain an estimate of their accuracy. I i P i = c hi 5 f iv (x i + h i 2 )+ ( ) 5 [ hi I i Q i = c f iv (x 2 i + h i 4 )+f iv (x i + 3h ] i 4 ) +

24 Error estimation Using the approximation we have f iv (x i + h i 4 )+f iv (x i + 3h i 4 ) 2f iv (x i + h i 2 ), I i Q i 2c ( ) 5 hi f iv (x i + h i 2 2 )+ Thus we have a relation between the errors in Q i and P i : Reformulate the above I i Q i 1 2 4(I i P i )+ I i Q i (Q i P i )+ Now the accuracy of Q i is expressed in terms of Q i P i

25 Scheme Bisect each subinterval until Q i P i h i b a ǫ Then b a f(x)dx Q i ǫ b a Q i P i h i = ǫ

26 function [I, err] = AdaptQuad(fname,a,b,tol,maxLev) if maxlev==0 too many levels of recursion, quit; compute one-panel quadrature R1; compute two-panel quadrature R2; use R1 and R2 to estimate error in R2; if the estimated error < tol return R2 and estimated error; else [I1, err1] = AdaptQuad(fname,a,mid,tol/2,maxLev-1); [I2, err2] = AdaptQuad(fname,mid,b,tol/2,maxLev-1); I = I1 + I2; err = err1 + err2;

27 Example Compute π 1 4 = x 2 dx using the adaptive rectangle rule. AdaptQRec( datan,0,1,0.0001,10): estimated error: actual error: Show Adaptive, tol =

28 2D quadrature Consider a 2D integral and let I = b d a g(x) = c d c f(x, y)dydx f(x, y)dy. Applying the composite trapezoid rule to b we get the numerical integration m 1 a g(x)dx g(x i )+g(x i+1 ) h x. 2

29 2D quadrature (cont.) Written in vector form: h x w T x g(x 1 ). g(x m ) where w T x = [1/2, 1,..., 1, 1/2].

30 2D quadrature (cont.) Again, applying the composite trapezoid rule to each g(x i ), we get g(x i ) = In vector form d c f(x i, y)dy n 1 j=1 f(x i, y j )+f(x i, y j+1 ) h y. 2 g(x i ) h y [f(x i, y 1 ),..., f(x i, y n )]w y where w y = [1/2, 1,..., 1, 1/2] T.

31 2D quadrature (cont.) Finally, we have the numerical integration, in matrix-vector form: Q = h x h y w T x Fw y where F = f(x 1, y 1 ) f(x 1, y n ).. f(x m, y 1 ) f(x m, y n ).

32 Example m = n e (x2 +2y 2 )/4 dydx Relative Subintervals Integral Time

33 Software packages IMSL qdag, qdags, twodq, qand MATLAB quad, quad1, dblquad NAG d01ajf, d01daf, d01fcf Octave quad, quadl, trapz

34 Summary Composite quadrature rules: Rectangle rule, trapezoid rule, Simpson s rule Richardson s extrapolation technique: Combining two quadrature rules with similar error terms to achieve a more accurate quadrature rule by canceling the leading error term; Combining one-panel and two-panel results to estimate errors Adaptive quadrature: By using error estimates, determine the panel sizes so that the computed approximation satisfies a predetermined tolerance 2D quadrature: Formulation of the problem

35 References [1 ] George E. Forsyth and Michael A. Malcolm and Cleve B. Moler. Computer Methods for Mathematical Computations. Prentice-Hall, Inc., Ch 5.

Solving Ordinary Differential Equations

Solving Ordinary Differential Equations Solving Ordinary Differential Equations Sanzheng Qiao Department of Computing and Software McMaster University March, 2014 Outline 1 Initial Value Problem Euler s Method Runge-Kutta Methods Multistep Methods

More information

Intro Polynomial Piecewise Cubic Spline Software Summary. Interpolation. Sanzheng Qiao. Department of Computing and Software McMaster University

Intro Polynomial Piecewise Cubic Spline Software Summary. Interpolation. Sanzheng Qiao. Department of Computing and Software McMaster University Interpolation Sanzheng Qiao Department of Computing and Software McMaster University July, 2012 Outline 1 Introduction 2 Polynomial Interpolation 3 Piecewise Polynomial Interpolation 4 Natural Cubic Spline

More information

Intro Polynomial Piecewise Cubic Spline Software Summary. Interpolation. Sanzheng Qiao. Department of Computing and Software McMaster University

Intro Polynomial Piecewise Cubic Spline Software Summary. Interpolation. Sanzheng Qiao. Department of Computing and Software McMaster University Interpolation Sanzheng Qiao Department of Computing and Software McMaster University January, 2014 Outline 1 Introduction 2 Polynomial Interpolation 3 Piecewise Polynomial Interpolation 4 Natural Cubic

More information

Nonlinear Equations and Continuous Optimization

Nonlinear Equations and Continuous Optimization Nonlinear Equations and Continuous Optimization Sanzheng Qiao Department of Computing and Software McMaster University March, 2014 Outline 1 Introduction 2 Bisection Method 3 Newton s Method 4 Systems

More information

Scientific Computing: Numerical Integration

Scientific Computing: Numerical Integration Scientific Computing: Numerical Integration Aleksandar Donev Courant Institute, NYU 1 donev@courant.nyu.edu 1 Course MATH-GA.2043 or CSCI-GA.2112, Fall 2015 Nov 5th, 2015 A. Donev (Courant Institute) Lecture

More information

Numerical Integration of Functions

Numerical Integration of Functions Numerical Integration of Functions Berlin Chen Department of Computer Science & Information Engineering National Taiwan Normal University Reference: 1. Applied Numerical Methods with MATLAB for Engineers,

More information

Bindel, Spring 2012 Intro to Scientific Computing (CS 3220) Week 12: Monday, Apr 16. f(x) dx,

Bindel, Spring 2012 Intro to Scientific Computing (CS 3220) Week 12: Monday, Apr 16. f(x) dx, Panel integration Week 12: Monday, Apr 16 Suppose we want to compute the integral b a f(x) dx In estimating a derivative, it makes sense to use a locally accurate approximation to the function around the

More information

8.3 Numerical Quadrature, Continued

8.3 Numerical Quadrature, Continued 8.3 Numerical Quadrature, Continued Ulrich Hoensch Friday, October 31, 008 Newton-Cotes Quadrature General Idea: to approximate the integral I (f ) of a function f : [a, b] R, use equally spaced nodes

More information

CS 450 Numerical Analysis. Chapter 8: Numerical Integration and Differentiation

CS 450 Numerical Analysis. Chapter 8: Numerical Integration and Differentiation Lecture slides based on the textbook Scientific Computing: An Introductory Survey by Michael T. Heath, copyright c 2018 by the Society for Industrial and Applied Mathematics. http://www.siam.org/books/cl80

More information

Extrapolation in Numerical Integration. Romberg Integration

Extrapolation in Numerical Integration. Romberg Integration Extrapolation in Numerical Integration Romberg Integration Matthew Battaglia Joshua Berge Sara Case Yoobin Ji Jimu Ryoo Noah Wichrowski Introduction Extrapolation: the process of estimating beyond the

More information

5 Numerical Integration & Dierentiation

5 Numerical Integration & Dierentiation 5 Numerical Integration & Dierentiation Department of Mathematics & Statistics ASU Outline of Chapter 5 1 The Trapezoidal and Simpson Rules 2 Error Formulas 3 Gaussian Numerical Integration 4 Numerical

More information

Elements of Floating-point Arithmetic

Elements of Floating-point Arithmetic Elements of Floating-point Arithmetic Sanzheng Qiao Department of Computing and Software McMaster University July, 2012 Outline 1 Floating-point Numbers Representations IEEE Floating-point Standards Underflow

More information

Romberg Integration and Gaussian Quadrature

Romberg Integration and Gaussian Quadrature Romberg Integration and Gaussian Quadrature P. Sam Johnson October 17, 014 P. Sam Johnson (NITK) Romberg Integration and Gaussian Quadrature October 17, 014 1 / 19 Overview We discuss two methods for integration.

More information

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

Simpson s 1/3 Rule Simpson s 1/3 rule assumes 3 equispaced data/interpolation/integration points CE 05 - Lecture 5 LECTURE 5 UMERICAL ITEGRATIO COTIUED Simpson s / Rule Simpson s / rule assumes equispaced data/interpolation/integration points Te integration rule is based on approximating fx using

More information

Jim Lambers MAT 460/560 Fall Semester Practice Final Exam

Jim Lambers MAT 460/560 Fall Semester Practice Final Exam Jim Lambers MAT 460/560 Fall Semester 2009-10 Practice Final Exam 1. Let f(x) = sin 2x + cos 2x. (a) Write down the 2nd Taylor polynomial P 2 (x) of f(x) centered around x 0 = 0. (b) Write down the corresponding

More information

COURSE Numerical integration of functions (continuation) 3.3. The Romberg s iterative generation method

COURSE Numerical integration of functions (continuation) 3.3. The Romberg s iterative generation method COURSE 7 3. Numerical integration of functions (continuation) 3.3. The Romberg s iterative generation method The presence of derivatives in the remainder difficulties in applicability to practical problems

More information

Practice Exam 2 (Solutions)

Practice Exam 2 (Solutions) Math 5, Fall 7 Practice Exam (Solutions). Using the points f(x), f(x h) and f(x + h) we want to derive an approximation f (x) a f(x) + a f(x h) + a f(x + h). (a) Write the linear system that you must solve

More information

APPM/MATH Problem Set 6 Solutions

APPM/MATH Problem Set 6 Solutions APPM/MATH 460 Problem Set 6 Solutions This assignment is due by 4pm on Wednesday, November 6th You may either turn it in to me in class or in the box outside my office door (ECOT ) Minimal credit will

More information

LECTURE 14 NUMERICAL INTEGRATION. Find

LECTURE 14 NUMERICAL INTEGRATION. Find 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

More information

Ch. 03 Numerical Quadrature. Andrea Mignone Physics Department, University of Torino AA

Ch. 03 Numerical Quadrature. Andrea Mignone Physics Department, University of Torino AA Ch. 03 Numerical Quadrature Andrea Mignone Physics Department, University of Torino AA 2017-2018 Numerical Quadrature In numerical analysis quadrature refers to the computation of definite integrals. y

More information

Romberg Integration. MATH 375 Numerical Analysis. J. Robert Buchanan. Spring Department of Mathematics

Romberg Integration. MATH 375 Numerical Analysis. J. Robert Buchanan. Spring Department of Mathematics Romberg Integration MATH 375 Numerical Analysis J. Robert Buchanan Department of Mathematics Spring 019 Objectives and Background In this lesson we will learn to obtain high accuracy approximations to

More information

Elements of Floating-point Arithmetic

Elements of Floating-point Arithmetic Elements of Floating-point Arithmetic Sanzheng Qiao Department of Computing and Software McMaster University July, 2012 Outline 1 Floating-point Numbers Representations IEEE Floating-point Standards Underflow

More information

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

Integration, differentiation, and root finding. Phys 420/580 Lecture 7 Integration, differentiation, and root finding Phys 420/580 Lecture 7 Numerical integration Compute an approximation to the definite integral I = b Find area under the curve in the interval Trapezoid Rule:

More information

NUMERICAL METHODS. x n+1 = 2x n x 2 n. In particular: which of them gives faster convergence, and why? [Work to four decimal places.

NUMERICAL METHODS. x n+1 = 2x n x 2 n. In particular: which of them gives faster convergence, and why? [Work to four decimal places. NUMERICAL METHODS 1. Rearranging the equation x 3 =.5 gives the iterative formula x n+1 = g(x n ), where g(x) = (2x 2 ) 1. (a) Starting with x = 1, compute the x n up to n = 6, and describe what is happening.

More information

Chapter 5 - Quadrature

Chapter 5 - Quadrature Chapter 5 - Quadrature The Goal: Adaptive Quadrature Historically in mathematics, quadrature refers to the act of trying to find a square with the same area of a given circle. In mathematical computing,

More information

(f(x) P 3 (x)) dx. (a) The Lagrange formula for the error is given by

(f(x) P 3 (x)) dx. (a) The Lagrange formula for the error is given by 1. QUESTION (a) Given a nth degree Taylor polynomial P n (x) of a function f(x), expanded about x = x 0, write down the Lagrange formula for the truncation error, carefully defining all its elements. How

More information

Numerical integration and differentiation. Unit IV. Numerical Integration and Differentiation. Plan of attack. Numerical integration.

Numerical integration and differentiation. Unit IV. Numerical Integration and Differentiation. Plan of attack. Numerical integration. Unit IV Numerical Integration and Differentiation Numerical integration and differentiation quadrature classical formulas for equally spaced nodes improper integrals Gaussian quadrature and orthogonal

More information

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

LECTURE 16 GAUSS QUADRATURE In general for Newton-Cotes (equispaced interpolation points/ data points/ integration points/ nodes). CE 025 - Lecture 6 LECTURE 6 GAUSS QUADRATURE In general for ewton-cotes (equispaced interpolation points/ data points/ integration points/ nodes). x E x S fx dx hw' o f o + w' f + + w' f + E 84 f 0 f

More information

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University Part 5 Chapter 17 Numerical Integration Formulas PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright The McGraw-Hill Companies, Inc. Permission required for reproduction

More information

Outline. 1 Numerical Integration. 2 Numerical Differentiation. 3 Richardson Extrapolation

Outline. 1 Numerical Integration. 2 Numerical Differentiation. 3 Richardson Extrapolation Outline Numerical Integration Numerical Differentiation Numerical Integration Numerical Differentiation 3 Michael T. Heath Scientific Computing / 6 Main Ideas Quadrature based on polynomial interpolation:

More information

Numerical Integra/on

Numerical Integra/on Numerical Integra/on The Trapezoidal Rule is a technique to approximate the definite integral where For 1 st order: f(a) f(b) a b Error Es/mate of Trapezoidal Rule Truncation error: From Newton-Gregory

More information

Chap. 19: Numerical Differentiation

Chap. 19: Numerical Differentiation Chap. 19: Numerical Differentiation Differentiation Definition of difference: y x f x x i x f x i As x is approaching zero, the difference becomes a derivative: dy dx lim x 0 f x i x f x i x 2 High-Accuracy

More information

Principles of Scientific Computing Local Analysis

Principles of Scientific Computing Local Analysis Principles of Scientific Computing Local Analysis David Bindel and Jonathan Goodman last revised January 2009, printed February 25, 2009 1 Among the most common computational tasks are differentiation,

More information

Numerical integration - I. M. Peressi - UniTS - Laurea Magistrale in Physics Laboratory of Computational Physics - Unit V

Numerical integration - I. M. Peressi - UniTS - Laurea Magistrale in Physics Laboratory of Computational Physics - Unit V Numerical integration - I M. Peressi - UniTS - Laurea Magistrale in Physics Laboratory of Computational Physics - Unit V deterministic methods in 1D equispaced points (trapezoidal, Simpson...), others...

More information

Scientific Computing

Scientific Computing 2301678 Scientific Computing Chapter 2 Interpolation and Approximation Paisan Nakmahachalasint Paisan.N@chula.ac.th Chapter 2 Interpolation and Approximation p. 1/66 Contents 1. Polynomial interpolation

More information

Introductory Numerical Analysis

Introductory Numerical Analysis Introductory Numerical Analysis Lecture Notes December 16, 017 Contents 1 Introduction to 1 11 Floating Point Numbers 1 1 Computational Errors 13 Algorithm 3 14 Calculus Review 3 Root Finding 5 1 Bisection

More information

Numerical Methods. King Saud University

Numerical Methods. King Saud University Numerical Methods King Saud University Aims In this lecture, we will... find the approximate solutions of derivative (first- and second-order) and antiderivative (definite integral only). Numerical Differentiation

More information

Romberg Rule of Integration

Romberg Rule of Integration Romberg Rule of ntegration Major: All Engineering Majors Authors: Autar Kaw, Charlie Barker Transforming Numerical Methods Education for STEM Undergraduates 1/10/2010 1 Romberg Rule of ntegration Basis

More information

Numerical Programming I (for CSE)

Numerical Programming I (for CSE) Technische Universität München WT / Fakultät für Mathematik Prof. Dr. M. Mehl B. Gatzhammer February 7, Numerical Programming I (for CSE) Repetition ) Floating Point Numbers and Rounding a) Let f : R R

More information

Numerical Methods for Engineers. and Scientists. Applications using MATLAB. An Introduction with. Vish- Subramaniam. Third Edition. Amos Gilat.

Numerical Methods for Engineers. and Scientists. Applications using MATLAB. An Introduction with. Vish- Subramaniam. Third Edition. Amos Gilat. Numerical Methods for Engineers An Introduction with and Scientists Applications using MATLAB Third Edition Amos Gilat Vish- Subramaniam Department of Mechanical Engineering The Ohio State University Wiley

More information

Week 10 TENTATIVE SCHEDULE NUMERICAL APPROXIMATION LECTURE # 10

Week 10 TENTATIVE SCHEDULE NUMERICAL APPROXIMATION LECTURE # 10 TENTATIVE SCHEDULE INTRODUCTION TO SCIENTIFIC & ENG. COMPUTING BIL 108E, CRN 44448 Week.9_ Polynomials Examples Week.10_ Application of curve fitting : Approximation & Inregration Dr. Feyzi HAZNEDAROĞLU

More information

Stat 451 Lecture Notes Numerical Integration

Stat 451 Lecture Notes Numerical Integration Stat 451 Lecture Notes 03 12 Numerical Integration Ryan Martin UIC www.math.uic.edu/~rgmartin 1 Based on Chapter 5 in Givens & Hoeting, and Chapters 4 & 18 of Lange 2 Updated: February 11, 2016 1 / 29

More information

Homework set #7 solutions, Math 128A J. Xia

Homework set #7 solutions, Math 128A J. Xia Homework set #7 solutions, Math 18A J. Xia Sec 4.4: 1a, a, 3a, 7abc, 17 1a. Compute by hand or use a program. Matlab code for the Composite Trapezoidal rule: function integral = cmptrap(a,b,n,f) h = (b-a)/n;

More information

Numerical Differentiation & Integration. Numerical Differentiation II

Numerical Differentiation & Integration. Numerical Differentiation II 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

More information

CS 257: Numerical Methods

CS 257: Numerical Methods CS 57: Numerical Methods Final Exam Study Guide Version 1.00 Created by Charles Feng http://www.fenguin.net CS 57: Numerical Methods Final Exam Study Guide 1 Contents 1 Introductory Matter 3 1.1 Calculus

More information

(x x 0 )(x x 1 )... (x x n ) (x x 0 ) + y 0.

(x x 0 )(x x 1 )... (x x n ) (x x 0 ) + y 0. > 5. Numerical Integration Review of Interpolation Find p n (x) with p n (x j ) = y j, j = 0, 1,,..., n. Solution: p n (x) = y 0 l 0 (x) + y 1 l 1 (x) +... + y n l n (x), l k (x) = n j=1,j k Theorem Let

More information

Calculus for the Life Sciences

Calculus for the Life Sciences Calculus for the Life Sciences Integration Joseph M. Mahaffy, jmahaffy@mail.sdsu.edu Department of Mathematics and Statistics Dynamical Systems Group Computational Sciences Research Center San Diego State

More information

Numerical Analysis Exam with Solutions

Numerical Analysis Exam with Solutions Numerical Analysis Exam with Solutions Richard T. Bumby Fall 000 June 13, 001 You are expected to have books, notes and calculators available, but computers of telephones are not to be used during the

More information

Differentiation and Integration

Differentiation and Integration Differentiation and Integration (Lectures on Numerical Analysis for Economists II) Jesús Fernández-Villaverde 1 and Pablo Guerrón 2 February 12, 2018 1 University of Pennsylvania 2 Boston College Motivation

More information

Physics 115/242 Romberg Integration

Physics 115/242 Romberg Integration Physics 5/242 Romberg Integration Peter Young In this handout we will see how, starting from the trapezium rule, we can obtain much more accurate values for the integral by repeatedly eliminating the leading

More information

Curve Fitting and Interpolation

Curve Fitting and Interpolation Chapter 5 Curve Fitting and Interpolation 5.1 Basic Concepts Consider a set of (x, y) data pairs (points) collected during an experiment, Curve fitting: is a procedure to develop or evaluate mathematical

More information

MA2501 Numerical Methods Spring 2015

MA2501 Numerical Methods Spring 2015 Norwegian University of Science and Technology Department of Mathematics MA5 Numerical Methods Spring 5 Solutions to exercise set 9 Find approximate values of the following integrals using the adaptive

More information

GENG2140, S2, 2012 Week 7: Curve fitting

GENG2140, S2, 2012 Week 7: Curve fitting GENG2140, S2, 2012 Week 7: Curve fitting Curve fitting is the process of constructing a curve, or mathematical function, f(x) that has the best fit to a series of data points Involves fitting lines and

More information

6 Lecture 6b: the Euler Maclaurin formula

6 Lecture 6b: the Euler Maclaurin formula Queens College, CUNY, Department of Computer Science Numerical Methods CSCI 361 / 761 Fall 217 Instructor: Dr. Sateesh Mane c Sateesh R. Mane 217 March 26, 218 6 Lecture 6b: the Euler Maclaurin formula

More information

Numerical Integra/on

Numerical Integra/on Numerical Integra/on Applica/ons The Trapezoidal Rule is a technique to approximate the definite integral where For 1 st order: f(a) f(b) a b Error Es/mate of Trapezoidal Rule Truncation error: From Newton-Gregory

More information

Chapter 5: Numerical Integration and Differentiation

Chapter 5: Numerical Integration and Differentiation Chapter 5: Numerical Integration and Differentiation PART I: Numerical Integration Newton-Cotes Integration Formulas The idea of Newton-Cotes formulas is to replace a complicated function or tabulated

More information

MA 3021: Numerical Analysis I Numerical Differentiation and Integration

MA 3021: Numerical Analysis I Numerical Differentiation and Integration MA 3021: Numerical Analysis I Numerical Differentiation and Integration Suh-Yuh Yang ( 楊肅煜 ) Department of Mathematics, National Central University Jhongli District, Taoyuan City 32001, Taiwan syyang@math.ncu.edu.tw

More information

12.0 Properties of orthogonal polynomials

12.0 Properties of orthogonal polynomials 12.0 Properties of orthogonal polynomials In this section we study orthogonal polynomials to use them for the construction of quadrature formulas investigate projections on polynomial spaces and their

More information

Lösning: Tenta Numerical Analysis för D, L. FMN011,

Lösning: Tenta Numerical Analysis för D, L. FMN011, Lösning: Tenta Numerical Analysis för D, L. FMN011, 090527 This exam starts at 8:00 and ends at 12:00. To get a passing grade for the course you need 35 points in this exam and an accumulated total (this

More information

Midterm Review. Igor Yanovsky (Math 151A TA)

Midterm Review. Igor Yanovsky (Math 151A TA) Midterm Review Igor Yanovsky (Math 5A TA) Root-Finding Methods Rootfinding methods are designed to find a zero of a function f, that is, to find a value of x such that f(x) =0 Bisection Method To apply

More information

you expect to encounter difficulties when trying to solve A x = b? 4. A composite quadrature rule has error associated with it in the following form

you expect to encounter difficulties when trying to solve A x = b? 4. A composite quadrature rule has error associated with it in the following form Qualifying exam for numerical analysis (Spring 2017) Show your work for full credit. If you are unable to solve some part, attempt the subsequent parts. 1. Consider the following finite difference: f (0)

More information

Romberg Integration: A Symbolic Approach with Mathematica

Romberg Integration: A Symbolic Approach with Mathematica Romberg Integration: A Symbolic Approach with Mathematica Ali Yazıcı, Tanıl Ergenç, and Irfan Altas 3 Computer Engineering Department, Atilim University, Ankara Turkey aliyazici@atilim.edu.tr Mathematics

More information

Review. Numerical Methods Lecture 22. Prof. Jinbo Bi CSE, UConn

Review. Numerical Methods Lecture 22. Prof. Jinbo Bi CSE, UConn Review Taylor Series and Error Analysis Roots of Equations Linear Algebraic Equations Optimization Numerical Differentiation and Integration Ordinary Differential Equations Partial Differential Equations

More information

X. Numerical Methods

X. Numerical Methods X. Numerical Methods. Taylor Approximation Suppose that f is a function defined in a neighborhood of a point c, and suppose that f has derivatives of all orders near c. In section 5 of chapter 9 we introduced

More information

To find an approximate value of the integral, the idea is to replace, on each subinterval

To find an approximate value of the integral, the idea is to replace, on each subinterval Module 6 : Definition of Integral Lecture 18 : Approximating Integral : Trapezoidal Rule [Section 181] Objectives In this section you will learn the following : Mid point and the Trapezoidal methods for

More information

Let f(x) be a real-valued function of a real variable, defined on a finite interval a x b. We seek to compute the value of the integral,

Let f(x) be a real-valued function of a real variable, defined on a finite interval a x b. We seek to compute the value of the integral, Chapter 6 Quadrature The term numerical integration covers several different tasks, including numerical evaluation of integrals and numerical solution of ordinary differential equations. So, we use the

More information

2D1240 Numerical Methods II / André Jaun, NADA, KTH NADA

2D1240 Numerical Methods II / André Jaun, NADA, KTH NADA A NADA D4 Numerical Methods II / André Jaun, NADA, KTH 8. PRECISION INTEGRATION, NON-LINEAR EQUATIONS 8.. Remember: what we saw during the last lesson Numerical error propagation, convergence and Richardson

More information

Integration. Topic: Trapezoidal Rule. Major: General Engineering. Author: Autar Kaw, Charlie Barker.

Integration. Topic: Trapezoidal Rule. Major: General Engineering. Author: Autar Kaw, Charlie Barker. Integration Topic: Trapezoidal Rule Major: General Engineering Author: Autar Kaw, Charlie Barker 1 What is Integration Integration: The process of measuring the area under a function plotted on a graph.

More information

Department of Applied Mathematics and Theoretical Physics. AMA 204 Numerical analysis. Exam Winter 2004

Department of Applied Mathematics and Theoretical Physics. AMA 204 Numerical analysis. Exam Winter 2004 Department of Applied Mathematics and Theoretical Physics AMA 204 Numerical analysis Exam Winter 2004 The best six answers will be credited All questions carry equal marks Answer all parts of each question

More information

4.9 APPROXIMATING DEFINITE INTEGRALS

4.9 APPROXIMATING DEFINITE INTEGRALS 4.9 Approximating Definite Integrals Contemporary Calculus 4.9 APPROXIMATING DEFINITE INTEGRALS The Fundamental Theorem of Calculus tells how to calculate the exact value of a definite integral IF the

More information

Numerical techniques to solve equations

Numerical techniques to solve equations Programming for Applications in Geomatics, Physical Geography and Ecosystem Science (NGEN13) Numerical techniques to solve equations vaughan.phillips@nateko.lu.se Vaughan Phillips Associate Professor,

More information

Lecture 28 The Main Sources of Error

Lecture 28 The Main Sources of Error Lecture 28 The Main Sources of Error Truncation Error Truncation error is defined as the error caused directly by an approximation method For instance, all numerical integration methods are approximations

More information

SPLINE INTERPOLATION

SPLINE INTERPOLATION Spline Background SPLINE INTERPOLATION Problem: high degree interpolating polynomials often have extra oscillations. Example: Runge function f(x = 1 1+4x 2, x [ 1, 1]. 1 1/(1+4x 2 and P 8 (x and P 16 (x

More information

Numerical Integration (Quadrature) Another application for our interpolation tools!

Numerical Integration (Quadrature) Another application for our interpolation tools! Numerical Integration (Quadrature) Another application for our interpolation tools! Integration: Area under a curve Curve = data or function Integrating data Finite number of data points spacing specified

More information

Questions from Larson Chapter 4 Topics. 5. Evaluate

Questions from Larson Chapter 4 Topics. 5. Evaluate Math. Questions from Larson Chapter 4 Topics I. Antiderivatives. Evaluate the following integrals. (a) x dx (4x 7) dx (x )(x + x ) dx x. A projectile is launched vertically with an initial velocity of

More information

INTRODUCTION, FOUNDATIONS

INTRODUCTION, FOUNDATIONS 1 INTRODUCTION, FOUNDATIONS ELM1222 Numerical Analysis Some of the contents are adopted from Laurene V. Fausett, Applied Numerical Analysis using MATLAB. Prentice Hall Inc., 1999 2 Today s lecture Information

More information

Lectures 9-10: Polynomial and piecewise polynomial interpolation

Lectures 9-10: Polynomial and piecewise polynomial interpolation Lectures 9-1: Polynomial and piecewise polynomial interpolation Let f be a function, which is only known at the nodes x 1, x,, x n, ie, all we know about the function f are its values y j = f(x j ), j

More information

n 1 f n 1 c 1 n+1 = c 1 n $ c 1 n 1. After taking logs, this becomes

n 1 f n 1 c 1 n+1 = c 1 n $ c 1 n 1. After taking logs, this becomes Root finding: 1 a The points {x n+1, }, {x n, f n }, {x n 1, f n 1 } should be co-linear Say they lie on the line x + y = This gives the relations x n+1 + = x n +f n = x n 1 +f n 1 = Eliminating α and

More information

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.

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. Capter 2 Integrals as sums and derivatives as differences We now switc to te simplest metods for integrating or differentiating a function from its function samples. A careful study of Taylor expansions

More information

2tdt 1 y = t2 + C y = which implies C = 1 and the solution is y = 1

2tdt 1 y = t2 + C y = which implies C = 1 and the solution is y = 1 Lectures - Week 11 General First Order ODEs & Numerical Methods for IVPs In general, nonlinear problems are much more difficult to solve than linear ones. Unfortunately many phenomena exhibit nonlinear

More information

4.1 Classical Formulas for Equally Spaced Abscissas. 124 Chapter 4. Integration of Functions

4.1 Classical Formulas for Equally Spaced Abscissas. 124 Chapter 4. Integration of Functions 24 Chapter 4. Integration of Functions of various orders, with higher order sometimes, but not always, giving higher accuracy. Romberg integration, which is discussed in 4.3, is a general formalism for

More information

Numerical Integration

Numerical Integration Chapter 1 Numerical Integration In this chapter we examine a few basic numerical techniques to approximate a definite integral. You may recall some of this from Calculus I where we discussed the left,

More information

19.4 Spline Interpolation

19.4 Spline Interpolation c9-b.qxd 9/6/5 6:4 PM Page 8 8 CHAP. 9 Numerics in General 9.4 Spline Interpolation Given data (function values, points in the xy-plane) (x, ƒ ), (x, ƒ ),, (x n, ƒ n ) can be interpolated by a polynomial

More information

ECE5340/6340: Homework 4 ANSWER KEY

ECE5340/6340: Homework 4 ANSWER KEY ECE5340/6340: Homework 4 ANSWER KEY Department of Electrical and Computer Engineering University of Utah, Salt Lake City, Utah February 8, 01 1. Re-derive the error bound for the midpoint rule and show

More information

Fixed point iteration and root finding

Fixed point iteration and root finding Fixed point iteration and root finding The sign function is defined as x > 0 sign(x) = 0 x = 0 x < 0. It can be evaluated via an iteration which is useful for some problems. One such iteration is given

More information

Some notes on Chapter 8: Polynomial and Piecewise-polynomial Interpolation

Some notes on Chapter 8: Polynomial and Piecewise-polynomial Interpolation Some notes on Chapter 8: Polynomial and Piecewise-polynomial Interpolation See your notes. 1. Lagrange Interpolation (8.2) 1 2. Newton Interpolation (8.3) different form of the same polynomial as Lagrange

More information

Riemann Integrable Functions

Riemann Integrable Functions Riemann Integrable Functions MATH 464/506, Real Analysis J. Robert Buchanan Department of Mathematics Summer 2007 Cauchy Criterion Theorem (Cauchy Criterion) A function f : [a, b] R belongs to R[a, b]

More information

Chapter 3: Root Finding. September 26, 2005

Chapter 3: Root Finding. September 26, 2005 Chapter 3: Root Finding September 26, 2005 Outline 1 Root Finding 2 3.1 The Bisection Method 3 3.2 Newton s Method: Derivation and Examples 4 3.3 How To Stop Newton s Method 5 3.4 Application: Division

More information

Physics 411: Homework 3

Physics 411: Homework 3 Physics 411: Homework 3 Because of the cancellation of class on January 28, this homework is a double-length homework covering two week s material, and you have two weeks to do it. It is due in class onthursday,

More information

Numerical Methods School of Mechanical Engineering Chung-Ang University

Numerical Methods School of Mechanical Engineering Chung-Ang University Part 5 Chapter 19 Numerical Differentiation Prof. Hae-Jin Choi hjchoi@cau.ac.kr 1 Chapter Objectives l Understanding the application of high-accuracy numerical differentiation formulas for equispaced data.

More information

Monte Carlo Methods for Statistical Inference: Variance Reduction Techniques

Monte Carlo Methods for Statistical Inference: Variance Reduction Techniques Monte Carlo Methods for Statistical Inference: Variance Reduction Techniques Hung Chen hchen@math.ntu.edu.tw Department of Mathematics National Taiwan University 3rd March 2004 Meet at NS 104 On Wednesday

More information

NUMERICAL MATHEMATICS AND COMPUTING

NUMERICAL MATHEMATICS AND COMPUTING NUMERICAL MATHEMATICS AND COMPUTING Fourth Edition Ward Cheney David Kincaid The University of Texas at Austin 9 Brooks/Cole Publishing Company I(T)P An International Thomson Publishing Company Pacific

More information

Topic 6a Numerical Integration

Topic 6a Numerical Integration Course Instructor Dr. Raymond C. Rumpf Office: A 337 Phone: (915) 747 6958 E Mail: rcrumpf@utep.edu Topic 6a umerical Integration EE 4386/5301 Computational Methods in EE Outline Introduction Discrete

More information

Continuous Optimization

Continuous Optimization Continuous Optimization Sanzheng Qiao Department of Computing and Software McMaster University March, 2009 Outline 1 Introduction 2 Golden Section Search 3 Multivariate Functions Steepest Descent Method

More information

1.8. Integration using Tables and CAS

1.8. Integration using Tables and CAS 1.. INTEGRATION USING TABLES AND CAS 39 1.. Integration using Tables and CAS The use of tables of integrals and Computer Algebra Systems allow us to find integrals very quickly without having to perform

More information

MATH 1242 FINAL EXAM Spring,

MATH 1242 FINAL EXAM Spring, MATH 242 FINAL EXAM Spring, 200 Part I (MULTIPLE CHOICE, NO CALCULATORS).. Find 2 4x3 dx. (a) 28 (b) 5 (c) 0 (d) 36 (e) 7 2. Find 2 cos t dt. (a) 2 sin t + C (b) 2 sin t + C (c) 2 cos t + C (d) 2 cos t

More information

Numerical Methods. Aaron Naiman Jerusalem College of Technology naiman

Numerical Methods. Aaron Naiman Jerusalem College of Technology  naiman Numerical Methods Aaron Naiman Jerusalem College of Technology naiman@jct.ac.il http://jct.ac.il/ naiman based on: Numerical Mathematics and Computing by Cheney & Kincaid, c 1994 Brooks/Cole Publishing

More information

Research Computing with Python, Lecture 7, Numerical Integration and Solving Ordinary Differential Equations

Research Computing with Python, Lecture 7, Numerical Integration and Solving Ordinary Differential Equations Research Computing with Python, Lecture 7, Numerical Integration and Solving Ordinary Differential Equations Ramses van Zon SciNet HPC Consortium November 25, 2014 Ramses van Zon (SciNet HPC Consortium)Research

More information

Outline. Math Numerical Analysis. Intermediate Value Theorem. Lecture Notes Zeros and Roots. Joseph M. Mahaffy,

Outline. Math Numerical Analysis. Intermediate Value Theorem. Lecture Notes Zeros and Roots. Joseph M. Mahaffy, Outline Math 541 - Numerical Analysis Lecture Notes Zeros and Roots Joseph M. Mahaffy, jmahaffy@mail.sdsu.edu Department of Mathematics and Statistics Dynamical Systems Group Computational Sciences Research

More information

Math Numerical Analysis

Math Numerical Analysis Math 541 - Numerical Analysis Lecture Notes Zeros and Roots Joseph M. Mahaffy, jmahaffy@mail.sdsu.edu Department of Mathematics and Statistics Dynamical Systems Group Computational Sciences Research Center

More information