Interpolation and the Lagrange Polynomial

Similar documents
Computer Arithmetic. MATH 375 Numerical Analysis. J. Robert Buchanan. Fall Department of Mathematics. J. Robert Buchanan Computer Arithmetic

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

3.1 Interpolation and the Lagrange Polynomial

Cubic Splines MATH 375. J. Robert Buchanan. Fall Department of Mathematics. J. Robert Buchanan Cubic Splines

Review of Power Series

INTERPOLATION. and y i = cos x i, i = 0, 1, 2 This gives us the three points. Now find a quadratic polynomial. p(x) = a 0 + a 1 x + a 2 x 2.

Neville s Method. MATH 375 Numerical Analysis. J. Robert Buchanan. Fall Department of Mathematics. J. Robert Buchanan Neville s Method

Linear Independence. MATH 322, Linear Algebra I. J. Robert Buchanan. Spring Department of Mathematics

Series Solutions Near a Regular Singular Point

Exponential Functions

Accelerating Convergence

Mean Value Theorem. MATH 161 Calculus I. J. Robert Buchanan. Summer Department of Mathematics

Mean Value Theorem. MATH 161 Calculus I. J. Robert Buchanan. Summer Department of Mathematics

Continuity. MATH 161 Calculus I. J. Robert Buchanan. Fall Department of Mathematics

Jim Lambers MAT 460/560 Fall Semester Practice Final Exam

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.

Advanced Math Quiz Review Name: Dec Use Synthetic Division to divide the first polynomial by the second polynomial.

Section 8.7. Taylor and MacLaurin Series. (1) Definitions, (2) Common Maclaurin Series, (3) Taylor Polynomials, (4) Applications.

Diagonalization. MATH 322, Linear Algebra I. J. Robert Buchanan. Spring Department of Mathematics

Midterm Review. Igor Yanovsky (Math 151A TA)

Approximation theory

INTERPOLATION Background Polynomial Approximation Problem:

Limit Theorems. MATH 464/506, Real Analysis. J. Robert Buchanan. Summer Department of Mathematics. J. Robert Buchanan Limit Theorems

Extrema and the First-Derivative Test

A first order divided difference

Interpolation Theory

Taylor and Maclaurin Series. Approximating functions using Polynomials.

Row Space, Column Space, and Nullspace

MAT137 Calculus! Lecture 45

Chapter 3 Interpolation and Polynomial Approximation

Infinite Series. MATH 211, Calculus II. J. Robert Buchanan. Spring Department of Mathematics

3 Interpolation and Polynomial Approximation

Taylor and Maclaurin Series. Approximating functions using Polynomials.

Lecture Note 3: Interpolation and Polynomial Approximation. Xiaoqun Zhang Shanghai Jiao Tong University

1 Solutions to selected problems

1) The line has a slope of ) The line passes through (2, 11) and. 6) r(x) = x + 4. From memory match each equation with its graph.

Fixed-Point Iteration

6.2 Deeper Properties of Continuous Functions

The Normal Equations. For A R m n with m > n, A T A is singular if and only if A is rank-deficient. 1 Proof:

Bessel s Equation. MATH 365 Ordinary Differential Equations. J. Robert Buchanan. Fall Department of Mathematics

The answer in each case is the error in evaluating the taylor series for ln(1 x) for x = which is 6.9.

MA 3021: Numerical Analysis I Numerical Differentiation and Integration

Taylor and Maclaurin Series

Series Solutions Near an Ordinary Point

Introduction Linear system Nonlinear equation Interpolation

Interpolating Accuracy without underlying f (x)

5.5 Deeper Properties of Continuous Functions

Mathematics 206 Solutions for HWK 23 Section 6.3 p358

Downloaded from

Functions: Polynomial, Rational, Exponential

Review all the activities leading to Midterm 3. Review all the problems in the previous online homework sets (8+9+10).

Interpolation and Approximation

2.3 Some Properties of Continuous Functions

1 Solutions to selected problems

MATH 1014 Tutorial Notes 8

Calculus and Parametric Equations

Math 601 Solutions to Homework 3

Math 334 A1 Homework 3 (Due Nov. 5 5pm)

Numerical Methods of Approximation

Homework #6 Solutions

Extrema of Functions of Several Variables

MEMORIAL UNIVERSITY OF NEWFOUNDLAND

8.2 Discrete Least Squares Approximation

1 Lecture 8: Interpolating polynomials.

Lagrange s polynomial

Numerical Methods. King Saud University

Inverses. Stephen Boyd. EE103 Stanford University. October 28, 2017

Fundamental Theorem of Calculus

Secondary Math 3 Honors - Polynomial and Polynomial Functions Test Review

Chapter 4: Interpolation and Approximation. October 28, 2005

LIMITS AT INFINITY MR. VELAZQUEZ AP CALCULUS

' Liberty and Umou Ono and Inseparablo "

Chain Rule. MATH 311, Calculus III. J. Robert Buchanan. Spring Department of Mathematics

Completion Date: Monday February 11, 2008

Evaluating Determinants by Row Reduction

Lecture Note 3: Polynomial Interpolation. Xiaoqun Zhang Shanghai Jiao Tong University

Skills Practice Skills Practice for Lesson 10.1

Two hours. To be provided by Examinations Office: Mathematical Formula Tables. THE UNIVERSITY OF MANCHESTER. 29 May :45 11:45

MATH ASSIGNMENT 07 SOLUTIONS. 8.1 Following is census data showing the population of the US between 1900 and 2000:

MA2501 Numerical Methods Spring 2015

PRACTICE PROBLEM SET

BSM510 Numerical Analysis

Section 10.7 Taylor series

AP Calculus (BC) Chapter 9 Test No Calculator Section Name: Date: Period:

Numerical Mathematics & Computing, 7 Ed. 4.1 Interpolation

CHAPTER 2 POLYNOMIALS KEY POINTS

Solutions 2. January 23, x x

Lagrange s polynomial

Exam 2. Average: 85.6 Median: 87.0 Maximum: Minimum: 55.0 Standard Deviation: Numerical Methods Fall 2011 Lecture 20

Review 1 Math 321: Linear Algebra Spring 2010

Properties of Linear Transformations from R n to R m

We consider the problem of finding a polynomial that interpolates a given set of values:

Vectors in the Plane

Lecture 10 Polynomial interpolation

Limits and Continuity

6.1 Polynomial Functions

. Get closed expressions for the following subsequences and decide if they converge. (1) a n+1 = (2) a 2n = (3) a 2n+1 = (4) a n 2 = (5) b n+1 =

Question 1: The graphs of y = p(x) are given in following figure, for some Polynomials p(x). Find the number of zeroes of p(x), in each case.

AP Calculus Testbank (Chapter 9) (Mr. Surowski)

a. Do you think the function is linear or non-linear? Explain using what you know about powers of variables.

Transcription:

Interpolation and the Lagrange Polynomial MATH 375 J. Robert Buchanan Department of Mathematics Fall 2013

Introduction We often choose polynomials to approximate other classes of functions. Theorem (Weierstrass Approximation Theorem) If f C[a, b] and ɛ > 0 then there exists a polynomial P such that f (x) P(x) < ɛ, for all x [a, b].

Introduction We often choose polynomials to approximate other classes of functions. Theorem (Weierstrass Approximation Theorem) If f C[a, b] and ɛ > 0 then there exists a polynomial P such that f (x) P(x) < ɛ, for all x [a, b]. We have used Taylor polynomials to approximate functions. n f (k) (x 0 ) P(x) = (x x 0 ) k k! k=0 Away from x 0 the approximation may be very poor.

Linear Approximation (1 of 2) y 1 f x 1 y 0 f x 0 x 1 x Using the two-point formula for a line we determine the equation of the line to be ( ) f (x1 ) f (x 0 ) y = f (x 0 ) + (x x 0 ). x 1 x 0

Linear Approximation (2 of 2) We can take another approach to finding the linear approximation. Define L 0 (x) = x x 1 x 0 x 1, L 1 (x) = x x 0 x 1 x 0,

Linear Approximation (2 of 2) We can take another approach to finding the linear approximation. Define L 0 (x) = x x 1 x 0 x 1, then L 0 (x 0 ) = 1 and L 0 (x 1 ) = 0. L 1 (x) = x x 0 x 1 x 0,

Linear Approximation (2 of 2) We can take another approach to finding the linear approximation. Define L 0 (x) = x x 1 x 0 x 1, then L 0 (x 0 ) = 1 and L 0 (x 1 ) = 0. L 1 (x) = x x 0 x 1 x 0, then L 1 (x 0 ) = 0 and L 1 (x 1 ) = 1.

Linear Approximation (2 of 2) We can take another approach to finding the linear approximation. Define L 0 (x) = x x 1 x 0 x 1, then L 0 (x 0 ) = 1 and L 0 (x 1 ) = 0. L 1 (x) = x x 0 x 1 x 0, then L 1 (x 0 ) = 0 and L 1 (x 1 ) = 1. If f (x) is any function then P(x) = f (x 0 ) L 0 (x) + f (x 1 ) L 1 (x) is a linear function which matches f (x) at x = x 0 and x = x 1.

Linear Approximation (2 of 2) We can take another approach to finding the linear approximation. Define L 0 (x) = x x 1 x 0 x 1, then L 0 (x 0 ) = 1 and L 0 (x 1 ) = 0. L 1 (x) = x x 0 x 1 x 0, then L 1 (x 0 ) = 0 and L 1 (x 1 ) = 1. If f (x) is any function then P(x) = f (x 0 ) L 0 (x) + f (x 1 ) L 1 (x) is a linear function which matches f (x) at x = x 0 and x = x 1. We want to extend this idea to higher order polynomials.

Construction of Polynomials Challenge: given a function f (x), construct a polynomial P(x) of degree at most n which matches f (x) at n + 1 distinct points. {(x 0, f (x 0 )), (x 1, f (x 1 )),..., (x n, f (x n ))}

Construction of Polynomials Challenge: given a function f (x), construct a polynomial P(x) of degree at most n which matches f (x) at n + 1 distinct points. {(x 0, f (x 0 )), (x 1, f (x 1 )),..., (x n, f (x n ))} Strategy: construct n + 1 polynomials L n,k (x) of degree n with the property that { 0 if k i, L n,k (x i ) = 1 if k = i for k = 0, 1, 2,..., n.

Lagrange Basis Polynomials Definition Suppose {x 0, x 1,..., x n } is a set of n + 1 distinct points. A Lagrange Basis Polynomial is a polynomial of degree n having the form L n,k (x) = n i=0, i k x x i x k x i.

Lagrange Basis Polynomials Definition Suppose {x 0, x 1,..., x n } is a set of n + 1 distinct points. A Lagrange Basis Polynomial is a polynomial of degree n having the form Remarks: L n,k (x) = We will let k = 0, 1, 2,..., n. L n,k (x i ) = 1 for i = k. L n,k (x i ) = 0 for i k. n i=0, i k x x i x k x i.

Example If x i = i for i = 0, 1, 2 then we can create three different Lagrange Basis Polynomials. L 2,0 (x) = L 2,1 (x) = L 2,2 (x) =

Example If x i = i for i = 0, 1, 2 then we can create three different Lagrange Basis Polynomials. L 2,0 (x) = x 1 0 1 x 2 0 2 = 1 (x 1)(x 2) 2 L 2,1 (x) = L 2,2 (x) =

Example If x i = i for i = 0, 1, 2 then we can create three different Lagrange Basis Polynomials. L 2,0 (x) = x 1 0 1 x 2 0 2 = 1 (x 1)(x 2) 2 L 2,1 (x) = x 0 1 0 x 2 = x(2 x) 1 2 L 2,2 (x) =

Example If x i = i for i = 0, 1, 2 then we can create three different Lagrange Basis Polynomials. L 2,0 (x) = x 1 0 1 x 2 0 2 = 1 (x 1)(x 2) 2 L 2,1 (x) = x 0 1 0 x 2 = x(2 x) 1 2 L 2,2 (x) = x 0 2 0 x 1 2 1 = 1 x(x 1) 2

Graph L 2,0 (x) = 1 (x 1)(x 2) 2 L 2,1 (x) = x(2 x) 3 2 1 L 2,2 (x) = 1 2 x(x 1) 1 1 2 3 x 1

Lagrange Interpolating Polynomials Definition Let {x 0, x 1,..., x n } be a set of n + 1 distinct points at which the function f (x) is defined. The (unique) Lagrange Interpolating Polynomial of f (x) of degree n is the polynomial having the form n P(x) = f (x k )L n,k (x). Properties: L n,k (x i ) = 0 for all i k. L n,k (x k ) = 1. k=0 P(x k ) = f (x k ) for k = 0, 1,..., n.

Example If n = 9 and the nodes are {0, 1,..., 9} then L 9,4 (x) has a graph resembling the following. 4 2 2 4 6 8 10 x 2 4

Example (1 of 3) Let f (x) = sin x, n = 3, and x k = kπ/3 for k = 0, 1, 2, 3. The four Lagrange Basis Polynomials are listed below. L 3,0 (x) = x π 3 0 π 3 x 2π 3 0 2π 3 x π 0 π = 1 (π 3x)(2π 3x)(π x) 2π3 L 3,1 (x) = 9 x(2π 3x)(π x) 2π3 L 3,2 (x) = 9 x(π 3x)(π x) 2π3 L 3,3 (x) = 1 x(π 3x)(2π 3x) 2π3

Example (2 of 3) The Lagrange Interpolating Polynomial of degree 3 for f (x) = sin x and x k = kπ/3 for k = 0, 1, 2, 3 is ( P(x) = (sin 0) L 3,0 (x) + sin π ) ( L 3,1 (x) + sin 2π ) L 3,2 (x) 3 3 = + (sin π) L 3,3 (x) 3 2 = 9 3 x(π x) 4π2 9 x(2π 3x)(π x) 2π3 3 2 9 x(π 3x)(π x) 2π3

Example (3 of 3) The graphs of P(x), f (x), and the absolute error are shown below. 1.0 Abs. Err. 0.8 0.04 0.6 0.03 0.4 0.02 0.2 0.01 0 Π x x

Lagrange Polynomial with Error Term Theorem Suppose x 0, x 1,..., x n are distinct numbers in the interval [a, b] and suppose f C n+1 [a, b]. Then for each x [a, b] there exists a number z(x) (a, b) for which f (x) = P(x) + f (n+1) (z(x)) (x x 0 )(x x 1 ) (x x n ), (n + 1)! where P(x) is the Lagrange Interpolating Polynomial.

Comments Compare the error terms of the Lagrange polynomial and the Taylor polynomial. Taylor: f (n+1) (z(x)) (x x 0 ) n+1 (n + 1)! f (n+1) (z(x)) Lagrange: (x x 0 )(x x 1 ) (x x n ) (n + 1)! Lagrange polynomials form the basis of many numerical approximations to derivatives and integrals, and thus the error term is important to understanding the errors present in those approximations.

Application Example Suppose we are preparing a table of values for cos x on [0, π]. The entries in the table will have eight accurate decimal places and we will linearly interpolate between adjacent entries to determine intermediate values. What should the spacing between adjacent x-values be to preserve the eight-decimal-place accuracy in the interpolation?

Solution cos x P(x) = cos z 2 x x j x x j+1 for some 0 z π 1 2 max 0 z π cos z max x x j x x j+1 x j x x j+1 = 1 2 = h2 8 max (x jh)(x (j + 1)h jh x (j+1)h Thus if h 2 /8 < 10 8 then h < 2 2 10 4 0.000282.

Error in sin x Earlier we found the Lagrange interpolating polynomial of degree 3 for f (x) = sin x using nodes x k = kπ/3 for k = 0, 1, 2, 3 was P(x) = 9 3 x(π x). 4π2 What is an error bound for this approximation?

Error in sin x Earlier we found the Lagrange interpolating polynomial of degree 3 for f (x) = sin x using nodes x k = kπ/3 for k = 0, 1, 2, 3 was P(x) = 9 3 x(π x). 4π2 What is an error bound for this approximation? R(x) = sin z ( (x 0) x π ) ( x 2π 4! 3 3 ) (x π) 0.050108

Error Bound vs. Actual Error 0.05 0.04 0.03 0.02 0.01 0 Π x

Homework Read Section 3.1 Exercises: 1, 3, 5a, 7a, 13, 17