Chapter 3.Interpolation and Polynomial Approximation 华南师范大学数学科学学院谢珊玲
Chapter 3. Interpolation and Polynomial Approximation 华南师范大学数学科学学院 谢骊玲
What is Interpolation Given (xovo),(x),......(x),find the value ofy'at a value of‘x'that is not given. The theory of polynomial approximation is →) suitable for a first course in numerical analysis although the state-of-the-art methods use rational functions. 了气片 ,必 Polynomials are the most common choice of interpolants because they are easy to:evaluate, differentiate,and integrate. 低如%) x 华南师范大学数学科学学院谢绷玲
What is Interpolation ? Given (x0 ,y0 ), (x1 ,y1 ), …… (xn ,yn ), find the value of ‘y’ at a value of ‘x’ that is not given. The theory of polynomial approximation is suitable for a first course in numerical analysis although the state-of-the-art methods use rational functions. 华南师范大学数学科学学院 谢骊玲 Polynomials are the most common choice of interpolants because they are easy to: evaluate, differentiate, and integrate
Introduction to Interpolation If there is a significant amount of error in the tabulated values, then the methods of curve fitting should be considered.On the other hand,if the points(are known to a high degree of accuracy,then the polynomial curve y=P(x)that passes through them can be considered. When xoxxN,the approximation P(x)is called an interpolated value.If either x<xo or x<x,then P(x)is called an extrapolated value
Introduction to Interpolation ◼ If there is a significant amount of error in the tabulated values, then the methods of curve fitting should be considered. On the other hand, if the points (xk , yk ) are known to a high degree of accuracy, then the polynomial curve y=P(x) that passes through them can be considered. ◼ When x0<x<xN , the approximation P(x) is called an interpolated value. If either x<x0 or xN<x, then P(x) is called an extrapolated value
Taylor Series and Calculation of Functions Thm.3.1(Taylor Polynomial Approximation).Assume that f∈C+'[a,b]andx∈[a,b]is a fixed value..Ifx∈[a,b],then x)=PMx)+EM(x),where PMx)is a polynomial that can be used to approximate f(x): A finite sum can be used to 8m-20:- obtain a good approximation to an infinite sum. k! The error term E(x)has the form It is used to determine a bound for E,=f且x-y the accuracy of the approximation (N+1) for some value c=c(x)that lies between x and xo 华南师范大学数学科学学院谢珊玲
Taylor Series and Calculation of Functions ◼ Thm. 3.1(Taylor Polynomial Approximation). Assume that f∈CN+1[a, b] and x0∈[a, b] is a fixed value. If x∈[a, b], then f(x)=PN (x)+EN (x), where PN (x) is a polynomial that can be used to approximate f(x): The error term EN (x) has the form for some value c=c(x) that lies between x and x0 . 华南师范大学数学科学学院 谢骊玲 ( ) 0 0 0 ( ) ( ) ( ) ( ) ! N k k N k f x f x P x x x = k = − ( 1) 1 0 ( ) ( ) ( ) ( 1)! N N N f E x x x N + + = − + A finite sum can be used to obtain a good approximation to an infinite sum. It is used to determine a bound for the accuracy of the approximation
Taylor Series Expansions for Some Common Functions 3 sinx=x- 引+517刀 十 for all x cosx=1- 十 for all x 2!4!61 e=1+x+ ,x3 x4 for allx 21314! In(1+x)=x- 十 -1≤xs1 .x35x arctanx=x- 十 -1≤xs1 35 7 ((-D(p-D(p-2 2 3 for <1 华南师范大学数学科学学院谢珊玲
Taylor Series Expansions for Some Common Functions 华南师范大学数学科学学院 谢骊玲 3 5 7 2 4 6 234 2 3 4 3 5 7 2 3 sin 3! 5! 7! cos 1 2! 4! 6! 1 2! 3! 4! ln(1 ) 2 3 4 arctan 3 5 7 ( 1) ( 1)( 2) (1 ) 1 2! 3! x p x x x x x x x x x x x x e x x x x x x x x x x x p p p p p x px x x = − + − + = − + − + = + + + + + + = − + − + = − + − + − − − + = + + + + for all x for all x for all x -1≤x≤1 -1≤x≤1 for |x|<1
Taylor polynomial The graphs of the approximation PM(x)and the function fx) a both pass through the center xo and they have the same slopes (N=1)and curvature (N=2)at it. The approximation is good near the center xo and that the distance between the curves grows as x moves away from xo. The accuracy of a Taylor polynomial is increased when we choose N large. Cor.3.1.If P(x)is the Taylor polynomial of degree N given in Theorem 3.1,then P(o)=f(xo) for k=0,1,....N. 华南师范大学数学科学学院谢删玲
Taylor polynomial ◼ The graphs of the approximation PN (x) and the function f(x) both pass through the center x0 and they have the same slopes (N=1) and curvature (N=2) at it. ◼ The approximation is good near the center x0 and that the distance between the curves grows as x moves away from x0 . ◼ The accuracy of a Taylor polynomial is increased when we choose N large. Cor. 3.1. If PN (x) is the Taylor polynomial of degree N given in Theorem 3.1, then 华南师范大学数学科学学院 谢骊玲 ( ) ( ) 0 0 ( ) ( ) k k P x f x N = for k=0,1,…,N
23/9/8 6 Example for Taylor Approximation(1) y=P(x)=1+x 十干干干干++++十+千4+++++++◆+++++++++◆++++十+++++++++++ .2 2 =P2x) =1+x+x2/2 华南师范大学数学科学学院谢细玲
华南师范大学数学科学学院 谢骊玲 2023/9/8 y=P1 (x)=1+x y=e x y=e x y=P2 (x) =1+x+x2 /2 Example for Taylor Approximation (1)
23/9/8 Example for Taylor Approximation(2) =P4x) MRN+ Error EN(x) y=P:(x) (N+1)川 y=P2(x) ++++++++++++H Example 3.2 3.3 华南师范大学数学科学学院谢蜘玲
华南师范大学数学科学学院 谢骊玲 2023/9/8 y=e x y=P4 (x) y=P3 (x) y=P2 (x) Example for Taylor Approximation (2) 1 | | | ( ) | ( 1)! N N MR E x N + = + Error Example 3.2 & 3.3
The graph of the error y=E(x)=ex-P(x) Example 3.3 y-E(x) 华南师范大学数学科学学院谢骊玲
华南师范大学数学科学学院 谢骊玲 Example 3.3 y=E9 (x) The graph of the error y=E9 (x)=e x -P9 (x)
Methods for Evaluating a Polynomial Nested Multiplication: (i)Algorithm to Evaluate P(x) (ii)Algorithm to Evaluate P(x) (iii)Algorithm to Evaluate I(x) B(N):=A(N) D(N-1):=N*A(N) IN+1)=AN)/N+1) FOR K-N-1 DOWNTO 0 DO FOR K-N-1 DOWNTO 1 DO FOR K-N DOWNTO 1 DO B(K):=A(K)+B(K+1)*X D(K-1):=K*A(K)+D(K)*X I(K)=A(K-1)/K+HK+1)*X PRNT“The value P(xis”,B(O) PRINT"The value P'(x)is",D(0) I(0)=C+H(1)*X PRNT“The value I(x)is”,IO) 华南师范大学数学科学学院谢删玲
Methods for Evaluating a Polynomial ◼ Nested Multiplication: 华南师范大学数学科学学院 谢骊玲 (i) Algorithm to Evaluate P(x) (ii) Algorithm to Evaluate P’(x) (iii) Algorithm to Evaluate I(x) B(N):=A(N) FOR K=N-1 DOWNTO 0 DO B(K):=A(K)+B(K+1)*X PRINT “The value P(x) is”, B(0) D(N-1):=N*A(N) FOR K=N-1 DOWNTO 1 DO D(K-1):=K*A(K)+D(K)*X PRINT “The value P’(x) is”, D(0) I(N+1):=A(N) /(N+1) FOR K=N DOWNTO 1 DO I(K):=A(K-1)/K+I(K+1)*X I(0):=C+I(1)*X PRINT “The value I(x) is”, I(0)