其他分享
首页 > 其他分享> > 拉格朗日插值

拉格朗日插值

作者:互联网

这篇文章存在极其严重的伪证现象,请就情况往下翻。

在平面直角坐标系中,给出$n+1$个函数在不同的坐标的点,求其解析式

即设$n+1$个点坐标分别为$:(x_0,y_0),(x_1,y_1),......,(x_n,y_n)$

有$:\sum\limits_{i=0}^ny_i\frac{\prod\limits_{j=0}^n(x-x_j)(i\ne j)}{\prod\limits_{j=0}^n(x_i-x_j)(i\ne j)}$

引理$:$

设$n+1$个点得出的解析式可表达为$L_n(x)$

$L_n(x)=a_0+a_1(x-x_0)\ldots a_n(x-x_0)(x-x_1)\ldots(x-x_{n-1})$

有$:a$有唯一解且一定有解,并且$L_n(x_j)=y_j$

可得以下方程$:$

$$ \left\{
\begin{aligned}
y_0 & = & a_0
\\
y_1 & = & a_0 & + a_1(x_1-x_0)
\\
\vdots
\\
y_n & = & a_0 & + a_1(x_1-x_0) + \ldots + a_n(x_n-x_0)(x_n-x_1)\ldots (x_n-x_{n-1})\end{aligned}
\right.
$$

我们首先证明一下一个定理$:$克拉默法则

即$:$

$$ \left\{
\begin{aligned}
a_{11}x_1+a_{12}x_2+\ldots+a_{1n}x_n & = b_1
\\
a_{21}x_1+a_{22}x_2+\ldots+a_{2n}x_n & = b_2
\\
\vdots
\\
a_{n1}x_1+a_{n2}x_2+\ldots+a_{nn}x_n & = b_n
\end{aligned}
\right.
$$

令$:$

$$
D=\left |\begin{array}{cccc}
a_{11} &a_{12} & \ldots & a_{1n}
\\
a_{21} &a_{22} & \ldots &a_{2n}
\\
\vdots & \vdots & \ddots &\vdots
\\
a_{n1} & a_{n2} & \ldots &a_{nn}
\\
\end{array}\right|
$$

称$D$为方程组的系数行列式

有$:x_1=\frac{D_1}{D},x_2=\frac{D_2}{D},\ldots,x_n=\frac{D_n}{D}$

其中$D_j(j=1,2,\ldots,n)$是把西施行列式$D$中的第$j$列元素用方程组右端的常数项代替所得到的$n$阶行列式,即

$$
D_j=\left |\begin{array}{cccc}
a_{11} &a_{12} & \ldots & a_{1,j-1} & b_1 & a_{1,j+1} & \ldots & a_{1n}
\\
a_{21} &a_{22} & \ldots & a_{2,j-1} & b_2 & a_{2,j+1} & \ldots & a_{2n}
\\
\vdots & \vdots & & \vdots & \vdots &\vdots & & \vdots
\\
a_{n1} &a_{n2} & \ldots & a_{n,j-1} & b_n & a_{n,j+1} & \ldots & a_{nn}
\\
\end{array}\right|
$$

$Proof:$ 我们分2步证明

$(1):$把方程写成

$$\sum\limits_{j=1}^na_{ij}x_j=b_i(i=1,2,\ldots,n)$$

把$x_1=\frac{D_1}{D},x_2=\frac{D_2}{D},\ldots,x_n=\frac{D_n}{D}$带入式子$:$

$$\sum\limits_{j=1}^na_{ij}\frac{D_j}{D}=\frac{1}{D}\sum\limits_{j=1}^na_{ij}D_j$$

因为$:D_j=b_1A_{1j}+b_2A_{2j}+\ldots+b_nA_{nj}=\sum\limits_{s=1}^nb_sA_{sj}($其中$A_{sj}$为元素$a_{sj}$的代数余子式$)$

$$ \sum\limits_{j=1}^na_{ij}A_{sj}=\left\{
\begin{aligned}
D,s=i
\\
0,s\ne i
\end{aligned}
\right.
$$

所以

$$\frac{1}{D}\sum\limits_{j=1}^na_{ij}D_j=\frac{1}{D}\sum\limits_{j=1}^na_{ij}\sum\limits_{s=1}^nb_sA_{sj}=\frac{1}{D}\sum\limits_{j=1}^n\sum\limits_{s=1}^na_{ij}A_{sj}b_s$$

$$=\frac{1}{D}\sum\limits_{s=1}^n\sum\limits_{j=1}^na_{ij}A_{sj}b_s=\frac{1}{D}\sum\limits_{s=1}^n(\sum\limits_{j=1}^na_{ij}A_{sj})b_s$$

$$=\frac{1}{D}Db_i=b_i$$

这相当于此式确为方程组的解

$(2):$用$D$中第$j$列的代数余子式$A_{1j},A_{2j},\ldots,A_{nj}$依次乘方程组的$n$个方程,再把它们相加,得$:$

$$(\sum\limits_{k=1}^na_{k1}A_{kj})x_1+\ldots+(\sum\limits_{k=1}^na_{kj}A_{kj})x_j+(\sum\limits_{k=1}^na_{kn}A_{kj})x_n=\sum\limits_{k=1}^nb_kA_{kj}$$

于是有

$$Dx_j=D_j(j=1,2,3,\ldots,n)$$

当$D\ne 0$时,得解一定满足式子,综上所述,方程组有唯一解.

我们回到之前的式子$:$

其系数行列式

$$
D=\left |\begin{array}{cccc}
1 &0 & \ldots & 0
\\
1 &(x_1-x_0) & \ldots &0
\\
\vdots & \vdots & \ddots &\vdots
\\
1 & (x_n-x_0) & \ldots & (x_n-x_0)(x_n-x_1)\ldots(x_n-x_{n-1})
\\
\end{array}\right|
$$

$\because x_i\ne x_j(i \ne j)$

$\therefore D \ne 0$

$\therefore a $一定有解,且有唯一解。

引理得证

接下来我们可以用数学归纳法证明等式成立

当$n=2$时

即$:L_2(x)=a_0+a_1(x-x_0)$

$$ \left\{
\begin{aligned}
y_0=L_n(x_0)=a_0
\\
y_1=L_n(x_1)=a_0& + a_1(x_1-x_0)\end{aligned}
\right.
$$

$\therefore a_0=y_0,a_1=\frac{y_1-y_0}{x_1-x_0}$

即$:$

$$L_n(x)=y_0+\frac{y_1-y_0}{x_1-x_0}(x-x_0)$$
$$=y_0+y_1\frac{x-x_0}{x_1-x_0}-y_0\frac{x-x_0}{x_1-x_0}$$
$$=y_0(1-\frac{x-x_0}{x_1-x_0})+y_1\frac{x-x_0}{x_1-x_0}$$
$$=y_0\frac{x-x_1}{x_0-x_1}+y_1\frac{x-x_0}{x_1-x_0}$$

证毕

即,当$n=2$等式成立

设$n=p-1$等式成立

证$:n=p$,等式成立

$\because L_p(x)=a_0+a_1(x-x_0)\ldots a_p(x-x_0)(x-x_1)\ldots(x-x_{p-1})$

易得$:$

$$a_p=\frac{L_p(x_p)-L_p(x_{p})}{(x_p-x_0)(x_p-x_1)\ldots(x_p-x_{p-1})}$$

将本式代入原式

$$L_p(x)=L_{p-1}(x)+\frac{y_p-L_{p-1}(x_p)}{(x_p-x_0)(x_p-x_1)\ldots(x_p-x_{p-1})}(x-x_0)(x-x_1)\ldots(x-x_{p-1})$$

$$\small
=\sum\limits_{k=0}^{p-1}y_k\frac{(x-x_0)\ldots(x-x_{k-1})(x-x_{k+1})\ldots(x-x_{p-1})}{(x_k-x_0)\ldots(x_k-x_{k-1})(x_k-x_{k+1})\ldots(x_k-x_{p-1})}+\big[y_p-\sum\limits_{k=0}^{p-1}y_k\frac{(x_p-x_0)\ldots(x_p-x_{k-1})(x_p-x_{k+1})\ldots(x_p-x_{p-1})}{(x_k-x_0)\ldots(x_k-x_{k-1})(x_k-x_{k+1})\ldots(x_k-x_{p-1})}\big]\frac{(x-x_0)\ldots(x-x_{p-1})}{(x_p-x_0)\ldots(x_p-x_{p-1})}$$

$$\small
=\sum\limits_{k=0}^{p-1}y_k\frac{(x-x_0)\ldots(x-x_{k-1})(x-x_{k+1})\ldots(x-x_{p-1})}{(x_k-x_0)\ldots(x_k-x_{k-1})(x_k-x_{k+1})\ldots(x_k-x_{p-1})}-\sum\limits_{k=0}^{p-1}y_k\frac{(x-x_0)\ldots(x-x_{k-1})(x-x_{k+1})\ldots(x-x_{p-1})}{(x_k-x_0)\ldots(x_k-x_{k-1})(x_k-x_{k+1})\ldots(x_k-x_{p-1})}\cdot\frac{x-x_k}{x_p-x_k}+y_p\frac{(x-x_0)\ldots(x-x_{p-1})}{(x_p-x_0)\ldots(x_p-x_{p-1})}$$

$$
=\sum\limits_{k=0}^{p-1}y_k\frac{(x-x_0)\ldots(x-x_{k-1})(x-x_{k+1})\ldots(x-x_{p-1})}{(x_k-x_0)\ldots(x_k-x_{k-1})(x_k-x_{k+1})\ldots(x_k-x_{p-1})}\cdot(1-\frac{x-x_k}{x_p-x_k})+y_p\frac{(x-x_0)\ldots(x-x_{p-1})}{(x_p-x_0)\ldots(x_p-x_{p-1})}$$

$\because 1-\frac{x-x_k}{x_p-x_k}=\frac{x_p-x_k-x+x_k}{x_p-x_k}=\frac{x-x_p}{x_k-x_p}$

$$\therefore L_p(x)=\sum\limits_{k=0}^{p-1}y_k\frac{(x-x_0)\ldots(x-x_{k-1})(x-x_{k+1})\ldots(x-x_{p})}{(x_k-x_0)\ldots(x_k-x_{k-1})(x_k-x_{k+1})\ldots(x_k-x_{p})}+y_p\frac{(x-x_0)\ldots(x-x_{p-1})}{(x_p-x_0)\ldots(x_p-x_{p-1})}$$

$$\therefore L_p(x)=\sum\limits_{i=0}^ny_i\frac{\prod\limits_{j=0}^n(x-x_j)(i\ne j)}{\prod\limits_{j=0}^n(x_i-x_j)(i\ne j)}$$

标签:拉格朗,frac,limits,插值,na,sum,ldots,vdots
来源: https://www.cnblogs.com/Vidoliga/p/16365777.html