interpolation & polynomial approximation [0.125in]3.625in0 ...mamu/courses/231/slides/...a good...

81
Interpolation & Polynomial Approximation Lagrange Interpolating Polynomials I 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

Upload: others

Post on 05-Mar-2021

15 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Interpolation & Polynomial Approximation

Lagrange Interpolating Polynomials I

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

Beamer Presentation Slidesprepared byJohn Carroll

Dublin City University

c© 2011 Brooks/Cole, Cengage Learning

Page 2: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

Outline

1 Weierstrass Approximation Theorem

2 Inaccuracy of Taylor Polynomials

3 Constructing the Lagrange Polynomial

4 Example: Second-Degree Lagrange Interpolating Polynomial

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 2 / 33

Page 3: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

Outline

1 Weierstrass Approximation Theorem

2 Inaccuracy of Taylor Polynomials

3 Constructing the Lagrange Polynomial

4 Example: Second-Degree Lagrange Interpolating Polynomial

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 2 / 33

Page 4: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

Outline

1 Weierstrass Approximation Theorem

2 Inaccuracy of Taylor Polynomials

3 Constructing the Lagrange Polynomial

4 Example: Second-Degree Lagrange Interpolating Polynomial

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 2 / 33

Page 5: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

Outline

1 Weierstrass Approximation Theorem

2 Inaccuracy of Taylor Polynomials

3 Constructing the Lagrange Polynomial

4 Example: Second-Degree Lagrange Interpolating Polynomial

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 2 / 33

Page 6: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

Outline

1 Weierstrass Approximation Theorem

2 Inaccuracy of Taylor Polynomials

3 Constructing the Lagrange Polynomial

4 Example: Second-Degree Lagrange Interpolating Polynomial

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 3 / 33

Page 7: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

Weierstrass Approximation Theorem

Algebraic Polynomials

One of the most useful and well-known classes of functions mappingthe set of real numbers into itself is the algebraic polynomials, the setof functions of the form

Pn(x) = anxn + an−1xn−1 + · · ·+ a1x + a0

where n is a nonnegative integer and a0, . . . , an are real constants.

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 4 / 33

Page 8: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

Weierstrass Approximation Theorem

Algebraic PolynomialsOne of the most useful and well-known classes of functions mappingthe set of real numbers into itself is the algebraic polynomials, the setof functions of the form

Pn(x) = anxn + an−1xn−1 + · · ·+ a1x + a0

where n is a nonnegative integer and a0, . . . , an are real constants.

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 4 / 33

Page 9: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

Weierstrass Approximation Theorem

Pn(x) = anxn + an−1xn−1 + · · ·+ a1x + a0,

Algebraic Polynomials (Cont’d)

One reason for their importance is that they uniformly approximatecontinuous functions.By this we mean that given any function, defined and continuouson a closed and bounded interval, there exists a polynomial that isas “close” to the given function as desired.This result is expressed precisely in the WeierstrassApproximation Theorem.

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 5 / 33

Page 10: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

Weierstrass Approximation Theorem

Pn(x) = anxn + an−1xn−1 + · · ·+ a1x + a0,

Algebraic Polynomials (Cont’d)One reason for their importance is that they uniformly approximatecontinuous functions.

By this we mean that given any function, defined and continuouson a closed and bounded interval, there exists a polynomial that isas “close” to the given function as desired.This result is expressed precisely in the WeierstrassApproximation Theorem.

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 5 / 33

Page 11: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

Weierstrass Approximation Theorem

Pn(x) = anxn + an−1xn−1 + · · ·+ a1x + a0,

Algebraic Polynomials (Cont’d)One reason for their importance is that they uniformly approximatecontinuous functions.By this we mean that given any function, defined and continuouson a closed and bounded interval, there exists a polynomial that isas “close” to the given function as desired.

This result is expressed precisely in the WeierstrassApproximation Theorem.

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 5 / 33

Page 12: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

Weierstrass Approximation Theorem

Pn(x) = anxn + an−1xn−1 + · · ·+ a1x + a0,

Algebraic Polynomials (Cont’d)One reason for their importance is that they uniformly approximatecontinuous functions.By this we mean that given any function, defined and continuouson a closed and bounded interval, there exists a polynomial that isas “close” to the given function as desired.This result is expressed precisely in the WeierstrassApproximation Theorem.

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 5 / 33

Page 13: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

y

xa b

y 5 f (x)

y 5 f (x) 1 e

y 5 f (x) 2 e

y 5 P (x)

Weierstrass Approximation TheoremSuppose that f is defined and continuous on [a, b]. For each ε > 0,there exists a polynomial P(x), with the property that

|f (x)− P(x)| < ε, for all x in [a, b].

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 6 / 33

Page 14: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

Benefits of Algebraic Polynomials

Another important reason for considering the class of polynomialsin the approximation of functions is that the derivative andindefinite integral of a polynomial are easy to determine and arealso polynomials.For these reasons, polynomials are often used for approximatingcontinuous functions.

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 7 / 33

Page 15: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

Benefits of Algebraic PolynomialsAnother important reason for considering the class of polynomialsin the approximation of functions is that the derivative andindefinite integral of a polynomial are easy to determine and arealso polynomials.

For these reasons, polynomials are often used for approximatingcontinuous functions.

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 7 / 33

Page 16: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

Benefits of Algebraic PolynomialsAnother important reason for considering the class of polynomialsin the approximation of functions is that the derivative andindefinite integral of a polynomial are easy to determine and arealso polynomials.For these reasons, polynomials are often used for approximatingcontinuous functions.

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 7 / 33

Page 17: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

Outline

1 Weierstrass Approximation Theorem

2 Inaccuracy of Taylor Polynomials

3 Constructing the Lagrange Polynomial

4 Example: Second-Degree Lagrange Interpolating Polynomial

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 8 / 33

Page 18: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: Taylor Polynomials

Interpolating with Taylor Polynomials

The Taylor polynomials are described as one of the fundamentalbuilding blocks of numerical analysis.Given this prominence, you might expect that polynomialinterpolation would make heavy use of these functions.However this is not the case.The Taylor polynomials agree as closely as possible with a givenfunction at a specific point, but they concentrate their accuracynear that point.A good interpolation polynomial needs to provide a relativelyaccurate approximation over an entire interval, and Taylorpolynomials do not generally do this.

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 9 / 33

Page 19: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: Taylor Polynomials

Interpolating with Taylor PolynomialsThe Taylor polynomials are described as one of the fundamentalbuilding blocks of numerical analysis.

Given this prominence, you might expect that polynomialinterpolation would make heavy use of these functions.However this is not the case.The Taylor polynomials agree as closely as possible with a givenfunction at a specific point, but they concentrate their accuracynear that point.A good interpolation polynomial needs to provide a relativelyaccurate approximation over an entire interval, and Taylorpolynomials do not generally do this.

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 9 / 33

Page 20: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: Taylor Polynomials

Interpolating with Taylor PolynomialsThe Taylor polynomials are described as one of the fundamentalbuilding blocks of numerical analysis.Given this prominence, you might expect that polynomialinterpolation would make heavy use of these functions.

However this is not the case.The Taylor polynomials agree as closely as possible with a givenfunction at a specific point, but they concentrate their accuracynear that point.A good interpolation polynomial needs to provide a relativelyaccurate approximation over an entire interval, and Taylorpolynomials do not generally do this.

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 9 / 33

Page 21: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: Taylor Polynomials

Interpolating with Taylor PolynomialsThe Taylor polynomials are described as one of the fundamentalbuilding blocks of numerical analysis.Given this prominence, you might expect that polynomialinterpolation would make heavy use of these functions.However this is not the case.

The Taylor polynomials agree as closely as possible with a givenfunction at a specific point, but they concentrate their accuracynear that point.A good interpolation polynomial needs to provide a relativelyaccurate approximation over an entire interval, and Taylorpolynomials do not generally do this.

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 9 / 33

Page 22: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: Taylor Polynomials

Interpolating with Taylor PolynomialsThe Taylor polynomials are described as one of the fundamentalbuilding blocks of numerical analysis.Given this prominence, you might expect that polynomialinterpolation would make heavy use of these functions.However this is not the case.The Taylor polynomials agree as closely as possible with a givenfunction at a specific point, but they concentrate their accuracynear that point.

A good interpolation polynomial needs to provide a relativelyaccurate approximation over an entire interval, and Taylorpolynomials do not generally do this.

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 9 / 33

Page 23: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: Taylor Polynomials

Interpolating with Taylor PolynomialsThe Taylor polynomials are described as one of the fundamentalbuilding blocks of numerical analysis.Given this prominence, you might expect that polynomialinterpolation would make heavy use of these functions.However this is not the case.The Taylor polynomials agree as closely as possible with a givenfunction at a specific point, but they concentrate their accuracynear that point.A good interpolation polynomial needs to provide a relativelyaccurate approximation over an entire interval, and Taylorpolynomials do not generally do this.

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 9 / 33

Page 24: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: Taylor Polynomials

Example: f (x) = ex

We will calculate the first six Taylor polynomials about x0 = 0 forf (x) = ex .

NoteSince the derivatives of f (x) are all ex , which evaluated at x0 = 0 gives1.

The Taylor polynomials are as follows:

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 10 / 33

Page 25: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: Taylor Polynomials

Example: f (x) = ex

We will calculate the first six Taylor polynomials about x0 = 0 forf (x) = ex .

NoteSince the derivatives of f (x) are all ex , which evaluated at x0 = 0 gives1.

The Taylor polynomials are as follows:

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 10 / 33

Page 26: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: Taylor Polynomials

Example: f (x) = ex

We will calculate the first six Taylor polynomials about x0 = 0 forf (x) = ex .

NoteSince the derivatives of f (x) are all ex , which evaluated at x0 = 0 gives1.

The Taylor polynomials are as follows:

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 10 / 33

Page 27: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

Taylor Polynomials for f (x) = ex about x0 = 0P0(x) = 1

P1(x) = 1 + x

P2(x) = 1 + x +x2

2

P3(x) = 1 + x +x2

2+

x3

6

P4(x) = 1 + x +x2

2+

x3

6+

x4

24

P5(x) = 1 + x +x2

2+

x3

6+

x4

24+

x5

120

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 11 / 33

Page 28: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

Taylor Polynomials for f (x) = ex about x0 = 0

y

x

5

10

15

20

121 2 3

y 5 P2(x)

y 5 P3(x)

y 5 P4(x)

y 5 P5(x)

y 5 P1(x)

y 5 P0(x)

y 5 ex

Notice that even for the higher-degree polynomials, the error becomesprogressively worse as we move away from zero.

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 12 / 33

Page 29: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

Taylor Polynomials for f (x) = 1x about x0 = 1

Example: A more extreme case

Although better approximations are obtained for f (x) = ex ifhigher-degree Taylor polynomials are used, this is not true for allfunctions.Consider, as an extreme example, using Taylor polynomials ofvarious degrees for f (x) = 1

x expanded about x0 = 1 toapproximate f (3) = 1

3 .

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 13 / 33

Page 30: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

Taylor Polynomials for f (x) = 1x about x0 = 1

Example: A more extreme caseAlthough better approximations are obtained for f (x) = ex ifhigher-degree Taylor polynomials are used, this is not true for allfunctions.

Consider, as an extreme example, using Taylor polynomials ofvarious degrees for f (x) = 1

x expanded about x0 = 1 toapproximate f (3) = 1

3 .

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 13 / 33

Page 31: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

Taylor Polynomials for f (x) = 1x about x0 = 1

Example: A more extreme caseAlthough better approximations are obtained for f (x) = ex ifhigher-degree Taylor polynomials are used, this is not true for allfunctions.Consider, as an extreme example, using Taylor polynomials ofvarious degrees for f (x) = 1

x expanded about x0 = 1 toapproximate f (3) = 1

3 .

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 13 / 33

Page 32: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

Taylor Polynomials for f (x) = 1x about x0 = 1

Calculations

Sincef (x) = x−1, f ′(x) = −x−2, f ′′(x) = (−1)22 · x−3,

and, in general,f (k)(x) = (−1)kk !x−k−1,

the Taylor polynomials are

Pn(x) =n∑

k=0

f (k)(1)

k !(x − 1)k =

n∑k=0

(−1)k (x − 1)k .

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 14 / 33

Page 33: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

Taylor Polynomials for f (x) = 1x about x0 = 1

CalculationsSince

f (x) = x−1, f ′(x) = −x−2, f ′′(x) = (−1)22 · x−3,

and, in general,f (k)(x) = (−1)kk !x−k−1,

the Taylor polynomials are

Pn(x) =n∑

k=0

f (k)(1)

k !(x − 1)k =

n∑k=0

(−1)k (x − 1)k .

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 14 / 33

Page 34: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

Taylor Polynomials for f (x) = 1x about x0 = 1

CalculationsSince

f (x) = x−1, f ′(x) = −x−2, f ′′(x) = (−1)22 · x−3,

and, in general,f (k)(x) = (−1)kk !x−k−1,

the Taylor polynomials are

Pn(x) =n∑

k=0

f (k)(1)

k !(x − 1)k =

n∑k=0

(−1)k (x − 1)k .

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 14 / 33

Page 35: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

Taylor Polynomials for f (x) = 1x about x0 = 1

CalculationsSince

f (x) = x−1, f ′(x) = −x−2, f ′′(x) = (−1)22 · x−3,

and, in general,f (k)(x) = (−1)kk !x−k−1,

the Taylor polynomials are

Pn(x) =n∑

k=0

f (k)(1)

k !(x − 1)k =

n∑k=0

(−1)k (x − 1)k .

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 14 / 33

Page 36: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

Taylor Polynomials for f (x) = 1x about x0 = 1

To Approximate f (3) = 13 by Pn(3)

To approximate f (3) = 13 by Pn(3) for increasing values of n, we

obtain the values shown below — rather a dramatic failure!When we approximate f (3) = 1

3 by Pn(3) for larger values of n, theapproximations become increasingly inaccurate.

n 0 1 2 3 4 5 6 7

Pn(3) 1 −1 3 −5 11 −21 43 −85

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 15 / 33

Page 37: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

Taylor Polynomials for f (x) = 1x about x0 = 1

To Approximate f (3) = 13 by Pn(3)

To approximate f (3) = 13 by Pn(3) for increasing values of n, we

obtain the values shown below — rather a dramatic failure!

When we approximate f (3) = 13 by Pn(3) for larger values of n, the

approximations become increasingly inaccurate.

n 0 1 2 3 4 5 6 7

Pn(3) 1 −1 3 −5 11 −21 43 −85

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 15 / 33

Page 38: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

Taylor Polynomials for f (x) = 1x about x0 = 1

To Approximate f (3) = 13 by Pn(3)

To approximate f (3) = 13 by Pn(3) for increasing values of n, we

obtain the values shown below — rather a dramatic failure!When we approximate f (3) = 1

3 by Pn(3) for larger values of n, theapproximations become increasingly inaccurate.

n 0 1 2 3 4 5 6 7

Pn(3) 1 −1 3 −5 11 −21 43 −85

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 15 / 33

Page 39: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

Taylor Polynomials for f (x) = 1x about x0 = 1

To Approximate f (3) = 13 by Pn(3)

To approximate f (3) = 13 by Pn(3) for increasing values of n, we

obtain the values shown below — rather a dramatic failure!When we approximate f (3) = 1

3 by Pn(3) for larger values of n, theapproximations become increasingly inaccurate.

n 0 1 2 3 4 5 6 7

Pn(3) 1 −1 3 −5 11 −21 43 −85

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 15 / 33

Page 40: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: Taylor Polynomials

Footnotes

For the Taylor polynomials, all the information used in theapproximation is concentrated at the single number x0, so thesepolynomials will generally give inaccurate approximations as wemove away from x0.This limits Taylor polynomial approximation to the situation inwhich approximations are needed only at numbers close to x0.For ordinary computational purposes, it is more efficient to usemethods that include information at various points.The primary use of Taylor polynomials in numerical analysis is notfor approximation purposes, but for the derivation of numericaltechniques and error estimation.

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 16 / 33

Page 41: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: Taylor Polynomials

FootnotesFor the Taylor polynomials, all the information used in theapproximation is concentrated at the single number x0, so thesepolynomials will generally give inaccurate approximations as wemove away from x0.

This limits Taylor polynomial approximation to the situation inwhich approximations are needed only at numbers close to x0.For ordinary computational purposes, it is more efficient to usemethods that include information at various points.The primary use of Taylor polynomials in numerical analysis is notfor approximation purposes, but for the derivation of numericaltechniques and error estimation.

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 16 / 33

Page 42: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: Taylor Polynomials

FootnotesFor the Taylor polynomials, all the information used in theapproximation is concentrated at the single number x0, so thesepolynomials will generally give inaccurate approximations as wemove away from x0.This limits Taylor polynomial approximation to the situation inwhich approximations are needed only at numbers close to x0.

For ordinary computational purposes, it is more efficient to usemethods that include information at various points.The primary use of Taylor polynomials in numerical analysis is notfor approximation purposes, but for the derivation of numericaltechniques and error estimation.

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 16 / 33

Page 43: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: Taylor Polynomials

FootnotesFor the Taylor polynomials, all the information used in theapproximation is concentrated at the single number x0, so thesepolynomials will generally give inaccurate approximations as wemove away from x0.This limits Taylor polynomial approximation to the situation inwhich approximations are needed only at numbers close to x0.For ordinary computational purposes, it is more efficient to usemethods that include information at various points.

The primary use of Taylor polynomials in numerical analysis is notfor approximation purposes, but for the derivation of numericaltechniques and error estimation.

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 16 / 33

Page 44: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: Taylor Polynomials

FootnotesFor the Taylor polynomials, all the information used in theapproximation is concentrated at the single number x0, so thesepolynomials will generally give inaccurate approximations as wemove away from x0.This limits Taylor polynomial approximation to the situation inwhich approximations are needed only at numbers close to x0.For ordinary computational purposes, it is more efficient to usemethods that include information at various points.The primary use of Taylor polynomials in numerical analysis is notfor approximation purposes, but for the derivation of numericaltechniques and error estimation.

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 16 / 33

Page 45: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

Outline

1 Weierstrass Approximation Theorem

2 Inaccuracy of Taylor Polynomials

3 Constructing the Lagrange Polynomial

4 Example: Second-Degree Lagrange Interpolating Polynomial

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 17 / 33

Page 46: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: The Linear Case

Polynomial Interpolation

The problem of determining a polynomial of degree one thatpasses through the distinct points

(x0, y0) and (x1, y1)

is the same as approximating a function f for which

f (x0) = y0 and f (x1) = y1

by means of a first-degree polynomial interpolating, or agreeingwith, the values of f at the given points.Using this polynomial for approximation within the interval given bythe endpoints is called polynomial interpolation.

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 18 / 33

Page 47: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: The Linear Case

Polynomial InterpolationThe problem of determining a polynomial of degree one thatpasses through the distinct points

(x0, y0) and (x1, y1)

is the same as approximating a function f for which

f (x0) = y0 and f (x1) = y1

by means of a first-degree polynomial interpolating, or agreeingwith, the values of f at the given points.

Using this polynomial for approximation within the interval given bythe endpoints is called polynomial interpolation.

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 18 / 33

Page 48: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: The Linear Case

Polynomial InterpolationThe problem of determining a polynomial of degree one thatpasses through the distinct points

(x0, y0) and (x1, y1)

is the same as approximating a function f for which

f (x0) = y0 and f (x1) = y1

by means of a first-degree polynomial interpolating, or agreeingwith, the values of f at the given points.Using this polynomial for approximation within the interval given bythe endpoints is called polynomial interpolation.

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 18 / 33

Page 49: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: The Linear Case

Define the functions

L0(x) =x − x1

x0 − x1and L1(x) =

x − x0

x1 − x0.

DefinitionThe linear Lagrange interpolating polynomial though (x0, y0) and(x1, y1) is

P(x) = L0(x)f (x0) + L1(x)f (x1) =x − x1

x0 − x1f (x0) +

x − x0

x1 − x0f (x1).

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 19 / 33

Page 50: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: The Linear Case

Define the functions

L0(x) =x − x1

x0 − x1and L1(x) =

x − x0

x1 − x0.

DefinitionThe linear Lagrange interpolating polynomial though (x0, y0) and(x1, y1) is

P(x) = L0(x)f (x0) + L1(x)f (x1) =x − x1

x0 − x1f (x0) +

x − x0

x1 − x0f (x1).

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 19 / 33

Page 51: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: The Linear Case

P(x) = L0(x)f (x0) + L1(x)f (x1) =x − x1

x0 − x1f (x0) +

x − x0

x1 − x0f (x1).

Note that

L0(x0) = 1, L0(x1) = 0, L1(x0) = 0, and L1(x1) = 1,

which implies that

P(x0) = 1 · f (x0) + 0 · f (x1) = f (x0) = y0

andP(x1) = 0 · f (x0) + 1 · f (x1) = f (x1) = y1.

So P is the unique polynomial of degree at most 1 that passes through(x0, y0) and (x1, y1).

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 20 / 33

Page 52: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: The Linear Case

P(x) = L0(x)f (x0) + L1(x)f (x1) =x − x1

x0 − x1f (x0) +

x − x0

x1 − x0f (x1).

Note that

L0(x0) = 1, L0(x1) = 0, L1(x0) = 0, and L1(x1) = 1,

which implies that

P(x0) = 1 · f (x0) + 0 · f (x1) = f (x0) = y0

andP(x1) = 0 · f (x0) + 1 · f (x1) = f (x1) = y1.

So P is the unique polynomial of degree at most 1 that passes through(x0, y0) and (x1, y1).

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 20 / 33

Page 53: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: The Linear Case

P(x) = L0(x)f (x0) + L1(x)f (x1) =x − x1

x0 − x1f (x0) +

x − x0

x1 − x0f (x1).

Note that

L0(x0) = 1, L0(x1) = 0, L1(x0) = 0, and L1(x1) = 1,

which implies that

P(x0) = 1 · f (x0) + 0 · f (x1) = f (x0) = y0

andP(x1) = 0 · f (x0) + 1 · f (x1) = f (x1) = y1.

So P is the unique polynomial of degree at most 1 that passes through(x0, y0) and (x1, y1).

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 20 / 33

Page 54: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: The Linear Case

Example: Linear InterpolationDetermine the linear Lagrange interpolating polynomial that passesthrough the points (2, 4) and (5, 1).

SolutionIn this case we have

L0(x) =x − 52− 5

= −13(x − 5) and L1(x) =

x − 25− 2

=13(x − 2),

so

P(x) = −13(x − 5) · 4 +

13(x − 2) · 1 = −4

3x +

203

+13

x − 23

= −x + 6.

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 21 / 33

Page 55: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: The Linear Case

Example: Linear InterpolationDetermine the linear Lagrange interpolating polynomial that passesthrough the points (2, 4) and (5, 1).

SolutionIn this case we have

L0(x) =x − 52− 5

= −13(x − 5) and L1(x) =

x − 25− 2

=13(x − 2),

so

P(x) = −13(x − 5) · 4 +

13(x − 2) · 1 = −4

3x +

203

+13

x − 23

= −x + 6.

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 21 / 33

Page 56: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: The Linear Case

Example: Linear InterpolationDetermine the linear Lagrange interpolating polynomial that passesthrough the points (2, 4) and (5, 1).

SolutionIn this case we have

L0(x) =x − 52− 5

= −13(x − 5) and L1(x) =

x − 25− 2

=13(x − 2),

so

P(x) = −13(x − 5) · 4 +

13(x − 2) · 1 = −4

3x +

203

+13

x − 23

= −x + 6.

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 21 / 33

Page 57: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: The Linear Case

x

y

y 5 P(x) = 2x 1 6

1

1

2

3

4

2 3 4 5

(2,4)

(5,1)

The linear Lagrange interpolating polynomial that passes through thepoints (2, 4) and (5, 1).

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 22 / 33

Page 58: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: Degree n Construction

y

xx0 x1 x2 xn

y 5 P(x)

y 5 f (x)

To generalize the concept of linear interpolation, consider theconstruction of a polynomial of degree at most n that passes throughthe n + 1 points

(x0, f (x0)), (x1, f (x1)), . . . , (xn, f (xn)).

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 23 / 33

Page 59: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: The General Case

Constructing the Degree n Polynomial

We first construct, for each k = 0, 1, . . . , n, a function Ln,k (x) withthe property that Ln,k (xi) = 0 when i 6= k and Ln,k (xk ) = 1.To satisfy Ln,k (xi) = 0 for each i 6= k requires that the numerator ofLn,k (x) contain the term

(x − x0)(x − x1) · · · (x − xk−1)(x − xk+1) · · · (x − xn).

To satisfy Ln,k (xk ) = 1, the denominator of Ln,k (x) must be thissame term but evaluated at x = xk .Thus

Ln,k (x) =(x − x0) · · · (x − xk−1)(x − xk+1) · · · (x − xn)

(xk − x0) · · · (xk − xk−1)(xk − xk+1) · · · (xk − xn).

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 24 / 33

Page 60: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: The General Case

Constructing the Degree n PolynomialWe first construct, for each k = 0, 1, . . . , n, a function Ln,k (x) withthe property that Ln,k (xi) = 0 when i 6= k and Ln,k (xk ) = 1.

To satisfy Ln,k (xi) = 0 for each i 6= k requires that the numerator ofLn,k (x) contain the term

(x − x0)(x − x1) · · · (x − xk−1)(x − xk+1) · · · (x − xn).

To satisfy Ln,k (xk ) = 1, the denominator of Ln,k (x) must be thissame term but evaluated at x = xk .Thus

Ln,k (x) =(x − x0) · · · (x − xk−1)(x − xk+1) · · · (x − xn)

(xk − x0) · · · (xk − xk−1)(xk − xk+1) · · · (xk − xn).

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 24 / 33

Page 61: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: The General Case

Constructing the Degree n PolynomialWe first construct, for each k = 0, 1, . . . , n, a function Ln,k (x) withthe property that Ln,k (xi) = 0 when i 6= k and Ln,k (xk ) = 1.To satisfy Ln,k (xi) = 0 for each i 6= k requires that the numerator ofLn,k (x) contain the term

(x − x0)(x − x1) · · · (x − xk−1)(x − xk+1) · · · (x − xn).

To satisfy Ln,k (xk ) = 1, the denominator of Ln,k (x) must be thissame term but evaluated at x = xk .Thus

Ln,k (x) =(x − x0) · · · (x − xk−1)(x − xk+1) · · · (x − xn)

(xk − x0) · · · (xk − xk−1)(xk − xk+1) · · · (xk − xn).

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 24 / 33

Page 62: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: The General Case

Constructing the Degree n PolynomialWe first construct, for each k = 0, 1, . . . , n, a function Ln,k (x) withthe property that Ln,k (xi) = 0 when i 6= k and Ln,k (xk ) = 1.To satisfy Ln,k (xi) = 0 for each i 6= k requires that the numerator ofLn,k (x) contain the term

(x − x0)(x − x1) · · · (x − xk−1)(x − xk+1) · · · (x − xn).

To satisfy Ln,k (xk ) = 1, the denominator of Ln,k (x) must be thissame term but evaluated at x = xk .

Thus

Ln,k (x) =(x − x0) · · · (x − xk−1)(x − xk+1) · · · (x − xn)

(xk − x0) · · · (xk − xk−1)(xk − xk+1) · · · (xk − xn).

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 24 / 33

Page 63: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: The General Case

Constructing the Degree n PolynomialWe first construct, for each k = 0, 1, . . . , n, a function Ln,k (x) withthe property that Ln,k (xi) = 0 when i 6= k and Ln,k (xk ) = 1.To satisfy Ln,k (xi) = 0 for each i 6= k requires that the numerator ofLn,k (x) contain the term

(x − x0)(x − x1) · · · (x − xk−1)(x − xk+1) · · · (x − xn).

To satisfy Ln,k (xk ) = 1, the denominator of Ln,k (x) must be thissame term but evaluated at x = xk .Thus

Ln,k (x) =(x − x0) · · · (x − xk−1)(x − xk+1) · · · (x − xn)

(xk − x0) · · · (xk − xk−1)(xk − xk+1) · · · (xk − xn).

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 24 / 33

Page 64: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: The General Case

Ln,k (x) =(x − x0) · · · (x − xk−1)(x − xk+1) · · · (x − xn)

(xk − x0) · · · (xk − xk−1)(xk − xk+1) · · · (xk − xn).

xx0 x1 xk21 xk xk11 xn21 xn

Ln,k(x)

1

. . .. . .

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 25 / 33

Page 65: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: The General Case

Theorem: n-th Lagrange interpolating polynomial

If x0, x1, . . . , xn are n + 1 distinct numbers and f is a function whosevalues are given at these numbers, then a unique polynomial P(x) ofdegree at most n exists with

f (xk ) = P(xk ), for each k = 0, 1, . . . , n.

This polynomial is given by

P(x) = f (x0)Ln,0(x) + · · ·+ f (xn)Ln,n(x) =n∑

k=0

f (xk )Ln,k (x)

where, for each k = 0, 1, . . . , n, Ln,k (x) is defined as follows:

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 26 / 33

Page 66: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: The General Case

Theorem: n-th Lagrange interpolating polynomialIf x0, x1, . . . , xn are n + 1 distinct numbers and f is a function whosevalues are given at these numbers,

then a unique polynomial P(x) ofdegree at most n exists with

f (xk ) = P(xk ), for each k = 0, 1, . . . , n.

This polynomial is given by

P(x) = f (x0)Ln,0(x) + · · ·+ f (xn)Ln,n(x) =n∑

k=0

f (xk )Ln,k (x)

where, for each k = 0, 1, . . . , n, Ln,k (x) is defined as follows:

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 26 / 33

Page 67: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: The General Case

Theorem: n-th Lagrange interpolating polynomialIf x0, x1, . . . , xn are n + 1 distinct numbers and f is a function whosevalues are given at these numbers, then a unique polynomial P(x) ofdegree at most n exists with

f (xk ) = P(xk ), for each k = 0, 1, . . . , n.

This polynomial is given by

P(x) = f (x0)Ln,0(x) + · · ·+ f (xn)Ln,n(x) =n∑

k=0

f (xk )Ln,k (x)

where, for each k = 0, 1, . . . , n, Ln,k (x) is defined as follows:

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 26 / 33

Page 68: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: The General Case

Theorem: n-th Lagrange interpolating polynomialIf x0, x1, . . . , xn are n + 1 distinct numbers and f is a function whosevalues are given at these numbers, then a unique polynomial P(x) ofdegree at most n exists with

f (xk ) = P(xk ), for each k = 0, 1, . . . , n.

This polynomial is given by

P(x) = f (x0)Ln,0(x) + · · ·+ f (xn)Ln,n(x) =n∑

k=0

f (xk )Ln,k (x)

where, for each k = 0, 1, . . . , n, Ln,k (x) is defined as follows:

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 26 / 33

Page 69: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: The General Case

P(x) = f (x0)Ln,0(x) + · · ·+ f (xn)Ln,n(x) =n∑

k=0

f (xk )Ln,k (x)

Definition of Ln,k(x)

Ln,k (x) =(x − x0)(x − x1) · · · (x − xk−1)(x − xk+1) · · · (x − xn)

(xk − x0)(xk − x1) · · · (xk − xk−1)(xk − xk+1) · · · (xk − xn)

=n∏

i=0i 6=k

(x − xi)

(xk − xi)

We will write Ln,k (x) simply as Lk (x) when there is no confusion as toits degree.

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 27 / 33

Page 70: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

Outline

1 Weierstrass Approximation Theorem

2 Inaccuracy of Taylor Polynomials

3 Constructing the Lagrange Polynomial

4 Example: Second-Degree Lagrange Interpolating Polynomial

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 28 / 33

Page 71: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: 2nd Degree Polynomial

Example: f (x) = 1x

(a) Use the numbers (called nodes) x0 = 2, x1 = 2.75 and x2 = 4 tofind the second Lagrange interpolating polynomial for f (x) = 1

x .

(b) Use this polynomial to approximate f (3) = 13 .

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 29 / 33

Page 72: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: 2nd Degree Polynomial

Example: f (x) = 1x

(a) Use the numbers (called nodes) x0 = 2, x1 = 2.75 and x2 = 4 tofind the second Lagrange interpolating polynomial for f (x) = 1

x .

(b) Use this polynomial to approximate f (3) = 13 .

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 29 / 33

Page 73: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: 2nd Degree Polynomial

Example: f (x) = 1x

(a) Use the numbers (called nodes) x0 = 2, x1 = 2.75 and x2 = 4 tofind the second Lagrange interpolating polynomial for f (x) = 1

x .

(b) Use this polynomial to approximate f (3) = 13 .

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 29 / 33

Page 74: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: 2nd Degree Polynomial

Part (a): Solution

We first determine the coefficient polynomials L0(x), L1(x), and L2(x):

L0(x) =(x − 2.75)(x − 4)

(2− 2.5)(2− 4)=

23(x − 2.75)(x − 4)

L1(x) =(x − 2)(x − 4)

(2.75− 2)(2.75− 4)= −16

15(x − 2)(x − 4)

L2(x) =(x − 2)(x − 2.75)

(4− 2)(4− 2.5)=

25(x − 2)(x − 2.75)

Also, since f (x) = 1x :

f (x0) = f (2) = 1/2, f (x1) = f (2.75) = 4/11, f (x2) = f (4) = 1/4

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 30 / 33

Page 75: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: 2nd Degree Polynomial

Part (a): SolutionWe first determine the coefficient polynomials L0(x), L1(x), and L2(x):

L0(x) =(x − 2.75)(x − 4)

(2− 2.5)(2− 4)=

23(x − 2.75)(x − 4)

L1(x) =(x − 2)(x − 4)

(2.75− 2)(2.75− 4)= −16

15(x − 2)(x − 4)

L2(x) =(x − 2)(x − 2.75)

(4− 2)(4− 2.5)=

25(x − 2)(x − 2.75)

Also, since f (x) = 1x :

f (x0) = f (2) = 1/2, f (x1) = f (2.75) = 4/11, f (x2) = f (4) = 1/4

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 30 / 33

Page 76: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: 2nd Degree Polynomial

Part (a): SolutionWe first determine the coefficient polynomials L0(x), L1(x), and L2(x):

L0(x) =(x − 2.75)(x − 4)

(2− 2.5)(2− 4)=

23(x − 2.75)(x − 4)

L1(x) =(x − 2)(x − 4)

(2.75− 2)(2.75− 4)= −16

15(x − 2)(x − 4)

L2(x) =(x − 2)(x − 2.75)

(4− 2)(4− 2.5)=

25(x − 2)(x − 2.75)

Also, since f (x) = 1x :

f (x0) = f (2) = 1/2, f (x1) = f (2.75) = 4/11, f (x2) = f (4) = 1/4

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 30 / 33

Page 77: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: 2nd Degree Polynomial

Part (a): Solution (Cont’d)Therefore, we obtain

P(x) =2∑

k=0

f (xk )Lk (x)

=13(x − 2.75)(x − 4)− 64

165(x − 2)(x − 4) +

110

(x − 2)(x − 2.75)

=122

x2 − 3588

x +4944

.

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 31 / 33

Page 78: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: 2nd Degree Polynomial

P(x) =1

22x2 − 35

88x +

4944

(b) Use this polynomial to approximate f (3) = 13 .

Part (b): Solution

An approximation to f (3) = 13 is

f (3) ≈ P(3) =9

22− 105

88+

4944

=2988

≈ 0.32955.

Earlier, we we found that no Taylor polynomial expanded about x0 = 1could be used to reasonably approximate f (x) = 1/x at x = 3.

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 32 / 33

Page 79: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: 2nd Degree Polynomial

P(x) =1

22x2 − 35

88x +

4944

(b) Use this polynomial to approximate f (3) = 13 .

Part (b): Solution

An approximation to f (3) = 13 is

f (3) ≈ P(3) =9

22− 105

88+

4944

=2988

≈ 0.32955.

Earlier, we we found that no Taylor polynomial expanded about x0 = 1could be used to reasonably approximate f (x) = 1/x at x = 3.

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 32 / 33

Page 80: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

The Lagrange Polynomial: 2nd Degree Polynomial

P(x) =1

22x2 − 35

88x +

4944

(b) Use this polynomial to approximate f (3) = 13 .

Part (b): Solution

An approximation to f (3) = 13 is

f (3) ≈ P(3) =9

22− 105

88+

4944

=2988

≈ 0.32955.

Earlier, we we found that no Taylor polynomial expanded about x0 = 1could be used to reasonably approximate f (x) = 1/x at x = 3.

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 32 / 33

Page 81: Interpolation & Polynomial Approximation [0.125in]3.625in0 ...mamu/courses/231/Slides/...A good interpolation polynomial needs to provide a relatively accurate approximation over an

Weierstrass Taylor Polynomials Lagrange Polynomial Example

Second Lagrange interpolating polynomial for f (x) = 1x

x

y

1

2

3

4

51 2 3 4

y 5 f (x)

y 5 P(x)

Numerical Analysis (Chapter 3) Lagrange Interpolating Polynomials I R L Burden & J D Faires 33 / 33