3-1. Lagrange Interpolating Polynomials

공부하자·2022년 9월 19일
0

수치해석

목록 보기
5/9

함수의 근사
데이터가 주어져 있을 때, 데이터가 어떤 함수로부터 나왔을까?

Weierstrass Approximation Theorem

Algebraic Polynomials

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

Pn(x)=anxn+an1xn1++a1x+a0P_n(x)=a_n x^n+a_{n-1} x^{n-1}+\cdots+a_1 x+a_0

where nn is a nonnegative integer and a0,,ana_0, \ldots, a_n are real constants.

Algebraic Polynomials (Cont'd)

Pn(x)=anxn+an1xn1++a1x+a0P_n(x)=a_n x^n+a_{n-1} x^{n-1}+\cdots+a_1 x+a_0
  • One reason for their importance is that they uniformly approximate continuous functions.
  • By this we mean that given any function, defined and continuous on a closed and bounded interval, there exists a polynomial that is as "close" to the given function as desired.
  • This result is expressed precisely in the Weierstrass Approximation Theorem.

Weierstrass Approximation Theorem

Suppose that ff is defined and continuous on [a,b][a, b]. For each ϵ>0\epsilon>0, there exists a polynomial P(x)P(x), with the property that

f(x)P(x)<ϵ, for all x in [a,b]|f(x)-P(x)|<\epsilon, \quad \text { for all } x \text { in }[a, b] \text {. }

Benefits of Algebraic Polynomials

  • Another important reason for considering the class of polynomials in the approximation of functions is that the derivative and indefinite integral of a polynomial are easy to determine and are also polynomials.
  • For these reasons, polynomials are often used for approximating continuous functions.

Inaccuracy of Taylor Polynomials

The Lagrange Polynomial: Taylor Polynomials

Interpolating with Taylor Polynomials

  • The Taylor polynomials are described as one of the fundamental building blocks of numerical analysis.
  • Given this prominence, you might expect that polynomial interpolation would make heavy use of these functions.
  • However this is not the case.
  • The Taylor polynomials agree as closely as possible with a given function at a specific point, but they concentrate their accuracy near that point.
  • A good interpolation polynomial needs to provide a relatively accurate approximation over an entire interval, and Taylor polynomials do not generally do this.

Footnotes

  • For the Taylor polynomials, all the information used in the approximation is concentrated at the single number x0x_0, so these polynomials will generally give inaccurate approximations as we move away from x0x_0.
  • This limits Taylor polynomial approximation to the situation in which approximations are needed only at numbers close to x0x_0.
  • For ordinary computational purposes, it is more efficient to use methods that include information at various points.
  • The primary use of Taylor polynomials in numerical analysis is not for approximation purposes, but for the derivation of numerical techniques and error estimation.

Example

Constructing the Lagrange Polynomial

The Lagrange Polynomial: The Linear Case

Polynomial Interpolation

  • The problem of determining a polynomial of degree one that passes through the distinct points
    (x0,y0) and (x1,y1)\left(x_0, y_0\right) \text { and }\left(x_1, y_1\right)
    is the same as approximating a function ff for which
    f(x0)=y0 and f(x1)=y1f\left(x_0\right)=y_0 \quad \text { and } f\left(x_1\right)=y_1
    by means of a first-degree polynomial interpolating, or agreeing with, the values of ff at the given points.
  • Using this polynomial for approximation within the interval given by the endpoints is called polynomial interpolation.

Define the functions

L0(x)=xx1x0x1 and L1(x)=xx0x1x0.L_0(x)=\frac{x-x_1}{x_0-x_1} \text { and } L_1(x)=\frac{x-x_0}{x_1-x_0} .

Definition

The linear Lagrange interpolating polynomial though (x0,y0)\left(x_0, y_0\right) and (x1,y1)\left(x_1, y_1\right) is

P(x)=L0(x)f(x0)+L1(x)f(x1)=xx1x0x1f(x0)+xx0x1x0f(x1).P(x)=L_0(x) f\left(x_0\right)+L_1(x) f\left(x_1\right)=\frac{x-x_1}{x_0-x_1} f\left(x_0\right)+\frac{x-x_0}{x_1-x_0} f\left(x_1\right) .
P(x)=L0(x)f(x0)+L1(x)f(x1)=xx1x0x1f(x0)+xx0x1x0f(x1)P(x)=L_0(x) f\left(x_0\right)+L_1(x) f\left(x_1\right)=\frac{x-x_1}{x_0-x_1} f\left(x_0\right)+\frac{x-x_0}{x_1-x_0} f\left(x_1\right)

Note that

L0(x0)=1,L0(x1)=0,L1(x0)=0, and L1(x1)=1,L_0\left(x_0\right)=1, \quad L_0\left(x_1\right)=0, \quad L_1\left(x_0\right)=0, \quad \text { and } \quad L_1\left(x_1\right)=1,

which implies that

P(x0)=1f(x0)+0f(x1)=f(x0)=y0P\left(x_0\right)=1 \cdot f\left(x_0\right)+0 \cdot f\left(x_1\right)=f\left(x_0\right)=y_0

and

P(x1)=0f(x0)+1f(x1)=f(x1)=y1.P\left(x_1\right)=0 \cdot f\left(x_0\right)+1 \cdot f\left(x_1\right)=f\left(x_1\right)=y_1 .

So PP is the unique polynomial of degree at most 1 that passes through (x0,y0)\left(x_0, y_0\right) and (x1,y1)\left(x_1, y_1\right)

Example


The Lagrange Polynomial: Degree nn Construction

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

(x0,f(x0)),(x1,f(x1)),,(xn,f(xn))\left(x_0, f\left(x_0\right)\right),\left(x_1, f\left(x_1\right)\right), \ldots,\left(x_n, f\left(x_n\right)\right)

The Lagrange Polynomial: The General Case

Constructing the Degree nn Polynomial

  • We first construct, for each k=0,1,,nk=0,1, \ldots, n, a function Ln,k(x)L_{n, k}(x) with the property that Ln,k(xi)=0L_{n, k}\left(x_i\right)=0 when iki \neq k and Ln,k(xk)=1L_{n, k}\left(x_k\right)=1.
  • To satisfy Ln,k(xi)=0L_{n, k}\left(x_i\right)=0 for each iki \neq k requires that the numerator of Ln,k(x)L_{n, k}(x) contain the term
    (xx0)(xx1)(xxk1)(xxk+1)(xxn).\left(x-x_0\right)\left(x-x_1\right) \cdots\left(x-x_{k-1}\right)\left(x-x_{k+1}\right) \cdots\left(x-x_n\right) .
  • To satisfy Ln,k(xk)=1L_{n, k}\left(x_k\right)=1, the denominator of Ln,k(x)L_{n, k}(x) must be this same term but evaluated at x=xkx=x_k.
  • Thus
    Ln,k(x)=(xx0)(xxk1)(xxk+1)(xxn)(xkx0)(xkxk1)(xkxk+1)(xkxn)L_{n, k}(x)=\frac{\left(x-x_0\right) \cdots\left(x-x_{k-1}\right)\left(x-x_{k+1}\right) \cdots\left(x-x_n\right)}{\left(x_k-x_0\right) \cdots\left(x_k-x_{k-1}\right)\left(x_k-x_{k+1}\right) \cdots\left(x_k-x_n\right)} \text {. }

Theorem: n\boldsymbol{n}-th Lagrange interpolating polynomial

If x0,x1,,xnx_0, x_1, \ldots, x_n are n+1n+1 distinct numbers and ff is a function whose values are given at these numbers, then a unique polynomial P(x)P(x) of degree at most nn exists with

f(xk)=P(xk), for each k=0,1,,n.f\left(x_k\right)=P\left(x_k\right), \quad \text { for each } k=0,1, \ldots, n .

This polynomial is given by

P(x)=f(x0)Ln,0(x)++f(xn)Ln,n(x)=k=0nf(xk)Ln,k(x)P(x)=f\left(x_0\right) L_{n, 0}(x)+\cdots+f\left(x_n\right) L_{n, n}(x)=\sum_{k=0}^n f\left(x_k\right) L_{n, k}(x)

where, for each k=0,1,,n,Ln,k(x)k=0,1, \ldots, n, L_{n, k}(x) is defined as follows:

P(x)=f(x0)Ln,0(x)++f(xn)Ln,n(x)=k=0nf(xk)Ln,k(x)P(x)=f\left(x_0\right) L_{n, 0}(x)+\cdots+f\left(x_n\right) L_{n, n}(x)=\sum_{k=0}^n f\left(x_k\right) L_{n, k}(x)

Definition of Ln,k(x)L_{n, k}(x)

Ln,k(x)=(xx0)(xx1)(xxk1)(xxk+1)(xxn)(xkx0)(xkx1)(xkxk1)(xkxk+1)(xkxn)=i=0ikn(xxi)(xkxi)\begin{aligned} L_{n, k}(x) &=\frac{\left(x-x_0\right)\left(x-x_1\right) \cdots\left(x-x_{k-1}\right)\left(x-x_{k+1}\right) \cdots\left(x-x_n\right)}{\left(x_k-x_0\right)\left(x_k-x_1\right) \cdots\left(x_k-x_{k-1}\right)\left(x_k-x_{k+1}\right) \cdots\left(x_k-x_n\right)} \\ &=\prod_{\substack{i=0 \\ i \neq k}}^n \frac{\left(x-x_i\right)}{\left(x_k-x_i\right)} \end{aligned}

We will write Ln,k(x)L_{n, k}(x) simply as Lk(x)L_k(x) when there is no confusion as to its degree.

Example: Second-Degree Lagrange Interpolating Polynomial

Interpolating Polynomial Error Bound

The Lagrange Polynomial: Theoretical Error Bound

Theorem

Suppose x0,x1,,xnx_0, x_1, \ldots, x_n are distinct numbers in the interval [a,b][a, b] and fCn+1[a,b]f \in C^{n+1}[a, b]. Then, for each xx in [a,b][a, b], a number ξ(x)\xi(x) (generally unknown) between x0,x1,,xnx_0, x_1, \ldots, x_n, and hence in (a,b)(a, b), exists with

f(x)=P(x)+f(n+1)(ξ(x))(n+1)!(xx0)(xx1)(xxn)f(x)=P(x)+\frac{f^{(n+1)}(\xi(x))}{(n+1) !}\left(x-x_0\right)\left(x-x_1\right) \cdots\left(x-x_n\right)

where P(x)P(x) is the interpolating polynomial given by

P(x)=f(x0)Ln,0(x)++f(xn)Ln,n(x)=k=0nf(xk)Ln,k(x)P(x)=f\left(x_0\right) L_{n, 0}(x)+\cdots+f\left(x_n\right) L_{n, n}(x)=\sum_{k=0}^n f\left(x_k\right) L_{n, k}(x)

Error Bound: Proof (skip)

Generalized Rolle's Theorem

Suppose fC[a,b]f \in C[a, b] is nn times differentiable on (a,b)(a, b). If

f(x)=0f(x)=0

at the n+1n+1 distinct numbers ax0<x1<<xnba \leq x_0<x_1<\ldots<x_n \leq b, then a number cc in (x0,xn)\left(x_0, x_n\right), and hence in (a,b)(a, b), exists with

f(n)(c)=0f^{(n)}(c)=0

Example: 2nd Lagrange Interpolating Polynomial Error Bound


Example: Interpolaing Polynomial Error for Tabulated Data

profile
아주대학교 수업 기록

0개의 댓글