实用标准文案
例1、 已知函数表
x -1 -3 1 0 2 4 f(x) 求f(x)的Lagrange二次插值多项式和Newton二次插值多项式。 解:
(1) 由题可知
-xk 1 -yk 1 2 3
0 4 插值基函数分别为
l0(x)??x?x1??x?x2???x?1??x?2??1x?1x?2
?????x0?x1??x0?x2???1?1???1?2?6l1(x)??x?x0??x?x2??x?1??x?2?1????x?1??x?2?
x?xx?x1?11?22?10??12??????x?x0??x?x1??x?1??x?1?1???x?1??x?1?
?x2?x0??x2?x1??2?1??2?1?3l2(x)?故所求二次拉格朗日插值多项式为
精彩文档
实用标准文案
L2(x)??yklk?x?k?02111??x?1x?2?4??x?1??x?2??0???????x?1??x?1??2?63??
14???x?1??x?2???x?1??x?1?23537?x2?x?623??3?
(2)一阶均差、二阶均差分别为 f?x0,x1??f?x1,x2??f?x0??f?x1?x0?x1f?x1??f?x2?x1?x2???3?03??1?120?4?41?2
3f?x0,x1??f?x1,x2?2?45f?x0,x1,x2????x0?x2?1?26均差表为
xk 3/2 4 5/6 f(xk)一阶 二阶 -1 -3 1 2 0 4
故所求Newton二次插值多项式为
P2?x??f?x0??f?x0,x1??x?x0??f?x0,x1,x2??x?x0??x?x1?35?x?1???x?1??x?1?26537?x2?x?623??3?
精彩文档
实用标准文案
例2、 设f(x)?x 解:
2?3x?2,x?[0,1],试求f(x)在[0, 1]上关于?(x)?1,??span?1,x?的最佳平方逼近多项式。
若??span?1,x?,则?0(x)?1,?1(x)?x,且?(x)?1,这样,有
??0,?0???1dx?1,011??1,?1???x2dx?011311??0,?1????1,?0???xdx?,20?f,?0????x2?3x?2?dx?023 6?f,?1???x?x2?3x?2?dx?0194所以,法方程为
1?1??23??23??12??a0???6? 2??a0??6?,经过消元得???????????9?a11???0??a1??1??1???????12??3??3????4??11再回代解该方程,得到a1?4,a0?
611*故,所求最佳平方逼近多项式为S1(x)??4x
6??1??1??2例3、 设f(x)?e,x?[0,1],试求f(x)在[0, 1]上关于?(x)?1,??span?1,x?的最
x佳平方逼近多项式。 解:
若??span?1,x?,则?0(x)?1,?1(x)?x,这样,有
精彩文档