当前位置: 代码迷 >> 综合 >> 计算方法(四):插值与拟合
  详细解决方案

计算方法(四):插值与拟合

热度:60   发布时间:2023-11-25 01:12:25.0

文章目录

  • 插值与拟合
    • 插值概念与基础理论
      • 插值问题的提法
      • 插值多项式的存在唯一性
      • 插值余项
    • 插值多项式的求法
      • 拉格朗日(Lagrange)型插值多项式
      • 差商与牛顿基本插值多项式
      • 差分与等距结点下的牛顿公式
    • 埃尔米特(Hermite)插值
    • 分段低次插值
      • 分段线性插值与分段二次插值
      • 三次样条插值
        • 三斜率(三转角)方程组
        • 三弯矩方程组(M关系式)
    • 曲线拟合的最小二乘法
      • 最小二乘解的求法
        • 线性最小二乘问题的求法
        • 多项式拟合最小二乘法
      • 加权技巧的应用

插值与拟合

插值概念与基础理论

插值问题的提法

给定函数 f ( x ) f(x) f(x) 在区间 [ a , b ] [a,b] [a,b] 上的 n + 1 n+1 n+1 个函数值:
x x 0 x 1 ? x n f ( x ) f ( x 0 ) f ( x 1 ) ? f ( x n ) \begin{array}{c|ccccc}x & x_0 & x_1 & \cdots & x_n\\ \hline f(x) & f(x_0) & f(x_1) & \cdots & f(x_n)\end{array} xf(x)?x0?f(x0?)?x1?f(x1?)????xn?f(xn?)??
x 0 , x 1 , ? , x n x_0,x_1,\cdots,x_n x0?,x1?,?,xn? 互不相同。 Φ \Phi Φ 为给定的某一个函数类。若 Φ \Phi Φ 上有函数 φ ( x ) \varphi(x) φ(x),满足
φ ( x i ) = f ( x i ) , i = 0 , 1 , 2 , ? , n \varphi(x_i)=f(x_i),i=0,1,2,\cdots,n φ(xi?)=f(xi?),i=0,1,2,?,n
则称 φ ( x ) \varphi(x) φ(x) f ( x ) f(x) f(x) 关于结点 x 0 , x 1 , ? , x n x_0,x_1,\cdots,x_n x0?,x1?,?,xn? Φ \Phi Φ 上的插值函数 x 0 , x 1 , ? , x n x_0,x_1,\cdots,x_n x0?,x1?,?,xn? 称为插值结点 [ a , b ] [a,b] [a,b] 称为插值区间, f ( x ) f(x) f(x) 称为被插函数

根据插值定义,插值函数实际上是一条经过平面上点 ( x i , f ( x i ) ) i = 0 , 1 , ? , n (x_i,f(x_i))_{i=0,1,\cdots,n} (xi?,f(xi?))i=0,1,?,n? 的曲线,这条平面曲线函数,就可以作为 f ( x ) f(x) f(x) 的逼近函数。

插值函数的存在唯一性:插值函数类 Φ \Phi Φ 为一个函数空间,若插值结点数为 n + 1 n+1 n+1,实际上给出了 n + 1 n+1 n+1 个限制条件,为了保证插值函数的存在唯一性,给出的插值函数空间应是 n + 1 n+1 n+1 维的,即 d i m Φ = n + 1 dim\Phi=n+1 dimΦ=n+1

任取 Φ \Phi Φ n + 1 n+1 n+1 个线性无关函数 φ 0 ( x ) , φ 1 ( x ) , ? , φ n ( x ) \varphi_0(x),\varphi_1(x),\cdots,\varphi_n(x) φ0?(x),φ1?(x),?,φn?(x),它们可作为 Φ \Phi Φ 的一组基,记为:
Φ = s p a n { φ 0 ( x ) , φ 1 ( x ) , ? , φ n ( x ) } \Phi=span\{\varphi_0(x),\varphi_1(x),\cdots,\varphi_n(x)\} Φ=span{ φ0?(x),φ1?(x),?,φn?(x)}
于是,任取 φ ( x ) ∈ Φ \varphi(x)\in\Phi φ(x)Φ,则 φ ( x ) \varphi(x) φ(x) 可唯一地表为:
φ ( x ) = a 0 φ 0 ( x ) + a 1 φ 1 ( x ) + ? + a n φ n ( x ) \varphi(x)=a_0\varphi_0(x)+a_1\varphi_1(x)+\cdots+a_n\varphi_n(x) φ(x)=a0?φ0?(x)+a1?φ1?(x)+?+an?φn?(x)
这里 ( a 0 , a 1 , ? , a n ) (a_0,a_1,\cdots,a_n) (a0?,a1?,?,an?) 称之为 φ ( x ) \varphi(x) φ(x) 在基 { φ i ( x ) } i = 1 n \{\varphi_i(x)\}^n_{i=1} { φi?(x)}i=1n? 下的坐标。

(*)定理: { x i } i = 0 n \{x_i\}^n_{i=0} { xi?}i=0n? [ a , b ] [a,b] [a,b] n + 1 n+1 n+1 个互异点, Φ = s p a n { φ 0 ( x ) , φ 1 ( x ) , ? , φ n ( x ) } \Phi=span\{\varphi_0(x),\varphi_1(x),\cdots,\varphi_n(x)\} Φ=span{ φ0?(x),φ1?(x),?,φn?(x)} n + 1 n+1 n+1 维函数空间,定义在 [ a , b ] [a,b] [a,b] 上的函数 f ( x ) f(x) f(x) 关于结点 { x i } i = 0 n \{x_i\}^n_{i=0} { xi?}i=0n? Φ \Phi Φ 上的插值函数存在且唯一的充要条件为行列式:
∣ φ 0 ( x 0 ) φ 1 ( x 0 ) ? φ n ( x 0 ) φ 0 ( x 1 ) φ 1 ( x 1 ) ? φ n ( x 1 ) ? ? φ 0 ( x n ? 1 ) φ 1 ( x n ? 1 ) ? φ n ( x n ? 1 ) φ 0 ( x n ) φ 1 ( x n ) ? φ n ( x n ) ∣ ≠ 0 \left|\begin{matrix}\varphi_0(x_0) & \varphi_1(x_0) & \cdots & \varphi_n(x_0)\\\varphi_0(x_1) & \varphi_1(x_1) & \cdots & \varphi_n(x_1)\\&\cdots&\cdots\\\varphi_0(x_{n-1}) & \varphi_1(x_{n-1}) & \cdots & \varphi_n(x_{n-1})\\\varphi_0(x_n) & \varphi_1(x_n) & \cdots & \varphi_n(x_n)\end{matrix}\right|\neq0 ?φ0?(x0?)φ0?(x1?)φ0?(xn?1?)φ0?(xn?)?φ1?(x0?)φ1?(x1?)?φ1?(xn?1?)φ1?(xn?)???????φn?(x0?)φn?(x1?)φn?(xn?1?)φn?(xn?)????=0

插值多项式的存在唯一性

P n = { a 0 + a 1 x + ? + a n x n ∣ a i ∈ R } P_n=\{a_0+a_1x+\cdots+a_nx^n|a_i\in R\} Pn?={ a0?+a1?x+?+an?xnai?R},则 P n P_n Pn? 为一个 n + 1 n+1 n+1 维的线性空间( n n n 次多项式空间)。

{ x i } i = 0 n \{x_i\}^n_{i=0} { xi?}i=0n? [ a , b ] [a,b] [a,b] 上互异点, f ( x ) f(x) f(x) 为定义在 [ a , b ] [a,b] [a,b] 上的函数,若有 P n ( x ) ∈ P n P_n(x)\in P_n Pn?(x)Pn?,满足 P n ( x i ) = f ( x i ) , i = 0 , 1 , ? , n P_n(x_i)=f(x_i),i=0,1,\cdots,n Pn?(xi?)=f(xi?),i=0,1,?,n,则称 P n ( x ) P_n(x) Pn?(x) f ( x ) f(x) f(x) 关于结点 { x i } i = 0 n \{x_i\}^n_{i=0} { xi?}i=0n? n n n 次插值多项式

定理1: f ( x ) f(x) f(x) 关于 n + 1 n+1 n+1 个互异结点 { x i } i = 0 n \{x_i\}^n_{i=0} { xi?}i=0n? n n n 次插值多项式存在且唯一。

证明:设插值多项式: P n ( x ) = a 0 + a 1 x + ? + a n x n P_n(x)=a_0+a_1x+\cdots+a_nx^n Pn?(x)=a0?+a1?x+?+an?xn,满足 a 0 + a 1 x i + ? + a n x i n = f ( x i ) , i = 0 , 1 , ? , n a_0+a_1x_i+\cdots+a_nx_i^n=f(x_i),i=0,1,\cdots,n a0?+a1?xi?+?+an?xin?=f(xi?),i=0,1,?,n,而
D = ∣ 1 x 0 x 0 2 ? x 0 n 1 x 1 x 1 2 ? x 1 n ? ? ? ? 1 x n x n 2 ? x n n ∣ = ∏ n ≥ i > j ≥ 0 ( x i ? x j ) ≠ 0 D=\left|\begin{matrix}1&x_0&x_0^2&\cdots&x_0^n\\1&x_1&x_1^2&\cdots&x_1^n\\\vdots&\vdots&\vdots&&\vdots\\1&x_n&x_n^2&\cdots&x_n^n\end{matrix}\right|=\prod_{n\geq i>j\geq0}(x_i-x_j)\neq0 D=?11?1?x0?x1??xn??x02?x12??xn2??????x0n?x1n??xnn???=ni>j0?(xi??xj?)??=0
由克莱姆法则得 a 0 , a 1 , ? , a n a_0,a_1,\cdots,a_n a0?,a1?,?,an? 存在唯一,即 P n P_n Pn? 上存在且唯一的有 P n ( x ) P_n(x) Pn?(x),满足 P n ( x i ) = f ( x i ) , i = 0 , 1 , ? , n P_n(x_i)=f(x_i),i=0,1,\cdots,n Pn?(xi?)=f(xi?),i=0,1,?,n

同时, n n n 次插值多项式 P ( x ) P(x) P(x) 可表示为 P n ( x ) = a 0 + a 1 x + ? + a n x n P_n(x)=a_0+a_1x+\cdots+a_nx^n Pn?(x)=a0?+a1?x+?+an?xn,其中 a i = D i D , i = 0 , 1 , 2 , ? , n a_i=\frac{D_i}{D},i=0,1,2,\cdots,n ai?=DDi??,i=0,1,2,?,n
D i = ∣ 1 x 0 ? x 0 i ? 1 f ( x 0 ) x 0 i + 1 ? x 0 n 1 x 1 ? x 1 i ? 1 f ( x 1 ) x 1 i + 1 ? x 1 n ? ? 1 x n ? x n i ? 1 f ( x n ) x n i + 1 ? x n n ∣ D_i=\left|\begin{matrix}1&x_0&\cdots&x_0^{i-1}&f(x_0)&x_0^{i+1}&\cdots&x_0^n\\1&x_1&\cdots&x_1^{i-1}&f(x_1)&x_1^{i+1}&\cdots&x_1^n\\&&&\cdots&\cdots\\1&x_n&\cdots&x_n^{i-1}&f(x_n)&x_n^{i+1}&\cdots&x_n^n\end{matrix}\right| Di?=?111?x0?x1?xn??????x0i?1?x1i?1??xni?1??f(x0?)f(x1?)?f(xn?)?x0i+1?x1i+1?xni+1??????x0n?x1n?xnn???

插值余项

R n ( x ) = f ( x ) ? P n ( x ) R_n(x)=f(x)-P_n(x) Rn?(x)=f(x)?Pn?(x) 称为插值余项(或称误差)。

定理2:若 f ∈ C n + 1 [ a , b ] f\in C^{n+1}[a,b] fCn+1[a,b],互异点 { x i } i = 0 n ? [ a , b ] \{x_i\}^n_{i=0}\subset[a,b] { xi?}i=0n??[a,b],则 f ( x ) f(x) f(x) { x i } i = 0 n \{x_i\}^n_{i=0} { xi?}i=0n? 为插值结点的 n n n 次插值多项式余项:
R n ( x ) = f ( n + 1 ) ( ξ ) ( n + 1 ) ! ( x ? x 0 ) ( x ? x 1 ) ? ( x ? x n ) 其 中 : m i n { x 0 , x 1 , ? , x n , x } ≤ ξ = ξ ( x ) ≤ m a x { x 0 , x 1 , ? , x n , x } R_n(x)=\frac{f^{(n+1)}(\xi)}{(n+1)!}(x-x_0)(x-x_1)\cdots(x-x_n)\\其中:min\{x_0,x_1,\cdots,x_n,x\}\leq\xi=\xi(x)\leq max\{x_0,x_1,\cdots,x_n,x\} Rn?(x)=(n+1)!f(n+1)(ξ)?(x?x0?)(x?x1?)?(x?xn?)min{ x0?,x1?,?,xn?,x}ξ=ξ(x)max{ x0?,x1?,?,xn?,x}
推论: f ( x ) ∈ C ( n + 1 ) [ a , b ] f(x)\in C^{(n+1)}[a,b] f(x)C(n+1)[a,b],且 ∣ f ( n + 1 ) ( x ) ∣ ≤ M n + 1 ( a ≤ x ≤ b ) |f^{(n+1)}(x)|\leq M_{n+1}(a\leq x\leq b) f(n+1)(x)Mn+1?(axb),则 f ( x ) f(x) f(x) { x i } i = 0 n \{x_i\}^n_{i=0} { xi?}i=0n? 为插值结点的 n n n 次插值多项式余项
∣ R n ( x ) ∣ ≤ M n + 1 ( n + 1 ) ! ∣ ω n + 1 ( x ) ∣ |R_n(x)|\leq\frac{M_{n+1}}{(n+1)!}|\omega_{n+1}(x)| Rn?(x)(n+1)!Mn+1??ωn+1?(x)
其中: ω n + 1 ( x ) = ∏ i = 0 n ( x ? x i ) \omega_{n+1}(x)=\prod^n_{i=0}(x-x_i) ωn+1?(x)=i=0n?(x?xi?)

注: 若插值点 x x x 位于插值区间 [ m i n 1 ≤ i ≤ n x i , m a x 1 ≤ i ≤ n x i ] [min_{1\leq i\leq n}x_i,max_{1\leq i\leq n}x_i] [min1in?xi?,max1in?xi?] 内,则该插值过程称为内插,否则称为外插。一般情况下,内插效果要比外插好一点,所以,插值结点尽可能选取在插值区间内。

插值多项式的求法

拉格朗日(Lagrange)型插值多项式

对于给定的 n + 1 n+1 n+1 个互异结点 { x i } i = 0 n \{x_i\}^n_{i=0} { xi?}i=0n?,如果能找到 P n P_n Pn? n + 1 n+1 n+1 个多项式 { l i ( x ) } i = 0 n \{l_i(x)\}^n_{i=0} { li?(x)}i=0n?,满足
l i ( x j ) = δ i j = { 1 , i = j 0 , i ≠ j , i , j = 0 , 1 , ? , n l_i(x_j)=\delta_{ij}=\begin{cases}1,i=j\\0,i\neq j\end{cases},i,j=0,1,\cdots,n li?(xj?)=δij?={ 1,i=j0,i??=j?,i,j=0,1,?,n
那么 L n ( x ) = ∑ i = 0 n l i ( x ) f ( x i ) L_n(x)=\sum^n_{i=0}l_i(x)f(x_i) Ln?(x)=i=0n?li?(x)f(xi?) 就是 f ( x ) f(x) f(x) 关于结点 { x i } i = 0 n \{x_i\}^n_{i=0} { xi?}i=0n? n n n 次插值多项式。其中, { l i ( x ) } i = 0 n ? P n \{l_i(x)\}^n_{i=0}\subset P_n { li?(x)}i=0n??Pn?,有 ∑ i = 0 n l i ( x ) f ( x i ) ∈ P n \sum^n_{i=0}l_i(x)f(x_i)\in P_n i=0n?li?(x)f(xi?)Pn?,且有
L n ( x k ) = ∑ i = 0 n l i ( x k ) f ( x i ) = f ( x k ) , k = 0 , 1 , ? , n L_n(x_k)=\sum^n_{i=0}l_i(x_k)f(x_i)=f(x_k),k=0,1,\cdots,n Ln?(xk?)=i=0n?li?(xk?)f(xi?)=f(xk?),k=0,1,?,n
l i ( x ) l_i(x) li?(x) 的构造: l i ( x j ) = 0 ( j ≠ i ) l_i(x_j)=0(j\neq i) li?(xj?)=0(j??=i)
l i ( x ) = ∏ j = 0 , j ≠ i n x ? x j x i ? x j = ( x ? x 0 ) ? ( x ? x i ? 1 ) ( x ? x i + 1 ) ? ( x ? x n ) ( x i ? x 0 ) ? ( x i ? x i ? 1 ) ( x i ? x i + 1 ) ? ( x i ? x n ) l_i(x)=\prod^n_{j=0,j\neq i}\frac{x-x_j}{x_i-x_j}=\frac{(x-x_0)\cdots(x-x_{i-1})(x-x_{i+1})\cdots(x-x_n)}{(x_i-x_0)\cdots(x_i-x_{i-1})(x_i-x_{i+1})\cdots(x_i-x_n)} li?(x)=j=0,j??=in?xi??xj?x?xj??=(xi??x0?)?(xi??xi?1?)(xi??xi+1?)?(xi??xn?)(x?x0?)?(x?xi?1?)(x?xi+1?)?(x?xn?)?
{ l i ( x ) } i = 0 n \{l_i(x)\}^n_{i=0} { li?(x)}i=0n? 是一组线性无关的函数,可作为 P n P_n Pn? 的一组基,称为关于结点 { x i } i = 0 n \{x_i\}^n_{i=0} { xi?}i=0n?的Lagrange基,其插值多项式称为Lagrange型插值多项式,记为 L n ( x , f ) L_n(x,f) Ln?(x,f) L n ( x ) L_n(x) Ln?(x),即
L n ( x ) = ∑ i = 0 n l i ( x ) f ( x i ) = ∑ i = 0 n ( ∏ j = 0 , j ≠ i n x ? x j x i ? x j ) f ( x i ) L_n(x)=\sum^n_{i=0}l_i(x)f(x_i)=\sum^n_{i=0}(\prod^n_{j=0,j\neq i}\frac{x-x_j}{x_i-x_j})f(x_i) Ln?(x)=i=0n?li?(x)f(xi?)=i=0n?(j=0,j??=in?xi??xj?x?xj??)f(xi?)
ω n + 1 ( x ) = ( x ? x 0 ) ( x ? x 1 ) ? ( x ? x n ) , ω n + 1 ′ ( x i ) = ∏ j = 0 , j ≠ i n ( x i ? x j ) \omega_{n+1}(x)=(x-x_0)(x-x_1)\cdots(x-x_n),\omega'_{n+1}(x_i)=\prod^n_{j=0,j\neq i}(x_i-x_j) ωn+1?(x)=(x?x0?)(x?x1?)?(x?xn?),ωn+1?(xi?)=j=0,j??=in?(xi??xj?),得
l i ( x ) = ω n + 1 ( x ) ( x ? x i ) ω n + 1 ′ ( x i ) L n ( x ) = ∑ i = 0 n ω n + 1 ( x ) ( x ? x i ) ω n + 1 ′ ( x i ) f ( x i ) l_i(x)=\frac{\omega_{n+1}(x)}{(x-x_i)\omega'_{n+1}(x_i)}\\L_n(x)=\sum^n_{i=0}\frac{\omega_{n+1}(x)}{(x-x_i)\omega'_{n+1}(x_i)}f(x_i) li?(x)=(x?xi?)ωn+1?(xi?)ωn+1?(x)?Ln?(x)=i=0n?(x?xi?)ωn+1?(xi?)ωn+1?(x)?f(xi?)
n = 1 n=1 n=1 时,可得 f ( x ) f(x) f(x) 关于 x 0 , x 1 x_0,x_1 x0?,x1? 的线性插值多项式的Lagrange型式:
L 1 ( x ) = x ? x 1 x 0 ? x 1 f ( x 0 ) + x ? x 0 x 1 ? x 0 f ( x 1 ) L_1(x)=\frac{x-x_1}{x_0-x_1}f(x_0)+\frac{x-x_0}{x_1-x_0}f(x_1) L1?(x)=x0??x1?x?x1??f(x0?)+x1??x0?x?x0??f(x1?)
n = 2 n=2 n=2 时,可得 f ( x ) f(x) f(x) 关于 x 0 , x 1 , x 2 x_0,x_1,x_2 x0?,x1?,x2? 的线性插值多项式的Lagrange型式:
L 2 ( x ) = l 0 ( x ) f ( x 0 ) + l 1 ( x ) f ( x 1 ) + l 2 f ( x 2 ) = ( x ? x 1 ) ( x ? x 2 ) ( x 0 ? x 1 ) ( x 0 ? x 2 ) f ( x 0 ) + ( x ? x 0 ) ( x ? x 2 ) ( x 1 ? x 0 ) ( x 1 ? x 2 ) f ( x 1 ) + ( x ? x 0 ) ( x ? x 1 ) ( x 2 ? x 0 ) ( x 2 ? x 1 ) f ( x 2 ) L_2(x)=l_0(x)f(x_0)+l_1(x)f(x_1)+l_2f(x_2)\\=\frac{(x-x_1)(x-x_2)}{(x_0-x_1)(x_0-x_2)}f(x_0)+\frac{(x-x_0)(x-x_2)}{(x_1-x_0)(x_1-x_2)}f(x_1)+\frac{(x-x_0)(x-x_1)}{(x_2-x_0)(x_2-x_1)}f(x_2) L2?(x)=l0?(x)f(x0?)+l1?(x)f(x1?)+l2?f(x2?)=(x0??x1?)(x0??x2?)(x?x1?)(x?x2?)?f(x0?)+(x1??x0?)(x1??x2?)(x?x0?)(x?x2?)?f(x1?)+(x2??x0?)(x2??x1?)(x?x0?)(x?x1?)?f(x2?)

三点插值又称抛物插值

误差的事后估计方法: 定理 2 给出了当被插函数充分光滑时的插值误差表达式,推论给出了误差的界。但在实际计算中,涉及到高价导数,很难给出较精确的估计,所以常用误差的事后估计

L n ( x ) L_n(x) Ln?(x) f ( x ) f(x) f(x) x 0 , x 1 , ? , x n x_0,x_1,\cdots,x_n x0?,x1??,xn? 为结点的插值多项式,对确定的 x x x,我们需要对误差 f ( x ) ? L n ( x ) f(x)-L_n(x) f(x)?Ln?(x) 做出估计。为此,另取一个结点 x n + 1 x_{n+1} xn+1?,记 L n ( 1 ) ( x ) L^{(1)}_n(x) Ln(1)?(x) f ( x ) f(x) f(x) x 1 , x 2 , ? , x n , x n + 1 x_1,x_2,\cdots,x_n,x_{n+1} x1?,x2?,?,xn?,xn+1? 为结点的插值多项式,由定理2,可得到:
f ( x ) ? L n ( x ) = f ( n + 1 ) ( ξ ) ( n + 1 ) ! ( x ? x 0 ) ( x ? x 1 ) ? ( x ? x n ) f ( x ) ? L n ( 1 ) ( x ) = f ( n + 1 ) ( ξ 2 ) ( n + 1 ) ! ( x ? x 1 ) ( x ? x 2 ) ? ( x ? x n ) ( x ? x n + 1 ) f(x)-L_n(x)=\frac{f^{(n+1)}(\xi)}{(n+1)!}(x-x_0)(x-x_1)\cdots(x-x_n)\\f(x)-L^{(1)}_n(x)=\frac{f^{(n+1)}(\xi_2)}{(n+1)!}(x-x_1)(x-x_2)\cdots(x-x_n)(x-x_{n+1}) f(x)?Ln?(x)=(n+1)!f(n+1)(ξ)?(x?x0?)(x?x1?)?(x?xn?)f(x)?Ln(1)?(x)=(n+1)!f(n+1)(ξ2?)?(x?x1?)(x?x2?)?(x?xn?)(x?xn+1?)
f ( n + 1 ) ( x ) f^{(n+1)}(x) f(n+1)(x) 在插值区间上变化不大时,则:
f ( x ) ? L n ( x ) f ( x ) ? L n ( 1 ) ( x ) ≈ x ? x 0 x ? x n + 1 ( x ? x n + 1 ) ( f ( x ) ? L n ( x ) ) ≈ ( x ? x 0 ) ( f ( x ) ? L n ( 1 ) ( x ) ) f ( x ) ≈ x ? x n + 1 x 0 ? x n + 1 L n ( x ) + x ? x 0 x n + 1 ? x 0 L n ( 1 ) ( x ) 即 : f ( x ) ? L n ( x ) ≈ x ? x 0 x 0 ? x n + 1 ( L n ( x ) ? L n ( 1 ) ( x ) ) \frac{f(x)-L_n(x)}{f(x)-L^{(1)}_n(x)}\approx\frac{x-x_0}{x-x_{n+1}}\\(x-x_{n+1})(f(x)-L_n(x))\approx(x-x_0)(f(x)-L^{(1)}_n(x))\\f(x)\approx\frac{x-x_{n+1}}{x_0-x_{n+1}}L_n(x)+\frac{x-x_0}{x_{n+1}-x_0}L^{(1)}_n(x)\\即:f(x)-L_n(x)\approx\frac{x-x_0}{x_0-x_{n+1}}(L_n(x)-L^{(1)}_n(x)) f(x)?Ln(1)?(x)f(x)?Ln?(x)?x?xn+1?x?x0??(x?xn+1?)(f(x)?Ln?(x))(x?x0?)(f(x)?Ln(1)?(x))f(x)x0??xn+1?x?xn+1??Ln?(x)+xn+1??x0?x?x0??Ln(1)?(x)f(x)?Ln?(x)x0??xn+1?x?x0??(Ln?(x)?Ln(1)?(x))
上式较好地给出了插值误差的实际估计。

差商与牛顿基本插值多项式

对于给定的 n + 1 n+1 n+1 个结点 x 0 , x 1 , ? , x n x_0,x_1,\cdots,x_n x0?,x1?,?,xn?,考虑 n n n 次多项式: N n ( x ) = a 0 + a 1 ( x ? x 0 ) + a 2 ( x ? x 0 ) ( x ? x 1 ) + ? + a n ( x ? x 0 ) ( x ? x 1 ) ? ( x ? x n ? 1 ) N_n(x)=a_0+a_1(x-x_0)+a_2(x-x_0)(x-x_1)+\cdots+a_n(x-x_0)(x-x_1)\cdots(x-x_{n-1}) Nn?(x)=a0?+a1?(x?x0?)+a2?(x?x0?)(x?x1?)+?+an?(x?x0?)(x?x1?)?(x?xn?1?) 满足插值条件: N n ( x i ) = f ( x i ) = y i , i = 0 , 1 , ? , n N_n(x_i)=f(x_i)=y_i,i=0,1,\cdots,n Nn?(xi?)=f(xi?)=yi?,i=0,1,?,n,称 N n ( x ) N_n(x) Nn?(x) 是以 x 0 , x 1 , ? , x n x_0,x_1,\cdots,x_n x0?,x1?,?,xn? 为结点的 n n n 次牛顿型插值多项式。

定义1:设函数 f ( x ) f(x) f(x) 在点 x 0 , x 1 , x 2 , ? x_0,x_1,x_2,\cdots x0?,x1?,x2?,? 上的值依次为 f ( x 0 ) , f ( x 1 ) , f ( x 2 ) , ? f(x_0),f(x_1),f(x_2),\cdots f(x0?),f(x1?),f(x2?),?,则称
f [ x i , x j ] = f ( x j ) ? f ( x i ) x j ? x i f[x_i,x_j]=\frac{f(x_j)-f(x_i)}{x_j-x_i} f[xi?,xj?]=xj??xi?f(xj?)?f(xi?)?
f ( x ) f(x) f(x) x i , x i x_i,x_i xi?,xi? 处的一阶差商。称
f [ x i , x j , x k ] = f [ x j , x k ] ? f [ x i , x j ] x k ? x i f[x_i,x_j,x_k]=\frac{f[x_j,x_k]-f[x_i,x_j]}{x_k-x_i} f[xi?,xj?,xk?]=xk??xi?f[xj?,xk?]?f[xi?,xj?]?
f ( x ) f(x) f(x) x i , x j , x k x_i,x_j,x_k xi?,xj?,xk? 处的二阶差商。一般地,称 m ? 1 m-1 m?1 阶差商的差商:
f [ x i 0 , x i 1 , ? , x i m ] = f [ x i 1 , ? , x i m ] ? f [ x i 0 , ? , x i m ? 1 ] x i m ? x i 0 f[x_{i0},x_{i1},\cdots,x_{im}]=\frac{f[x_{i1},\cdots,x_{im}]-f[x_{i0},\cdots,x_{im-1}]}{x_{im}-x_{i0}} f[xi0?,xi1?,?,xim?]=xim??xi0?f[xi1?,?,xim?]?f[xi0?,?,xim?1?]?
f ( x ) f(x) f(x) x i 0 , x i 1 , ? , x i m x_{i0},x_{i1},\cdots,x_{im} xi0?,xi1?,?,xim? 处的 m m m 阶差商

特别的,规定零阶差商为: f [ x i ] = f ( x i ) f[x_i]=f(x_i) f[xi?]=f(xi?)

通过归纳法, m m m 阶差商可表示成 f ( x 0 ) , f ( x 1 ) , ? , f ( x m ) f(x_0),f(x_1),\cdots,f(x_m) f(x0?),f(x1?),?,f(xm?) 的线性组合:
f [ x 0 , x 1 , ? , x m ] = ∑ j = 0 m f ( x j ) ( x j ? x 0 ) ? ( x j ? x j ? 1 ) ( x j ? x j + 1 ) ? ( x j ? x m ) f[x_0,x_1,\cdots,x_m]=\sum_{j=0}^m\frac{f(x_j)}{(x_j-x_0)\cdots(x_j-x_{j-1})(x_j-x_{j+1})\cdots(x_j-x_m)} f[x0?,x1?,?,xm?]=j=0m?(xj??x0?)?(xj??xj?1?)(xj??xj+1?)?(xj??xm?)f(xj?)?

差商具有对称性:任意调换结点的次序,不影响差商的值。 例如:
f [ x 0 , x 1 , x 2 ] = f [ x 1 , x 2 , x 0 ] = f [ x 1 , x 0 , x 2 ] f[x_0,x_1,x_2]=f[x_1,x_2,x_0]=f[x_1,x_0,x_2] f[x0?,x1?,x2?]=f[x1?,x2?,x0?]=f[x1?,x0?,x2?]
由插值条件 N n ( x i ) = f ( x i ) N_n(x_i)=f(x_i) Nn?(xi?)=f(xi?),可得
N n ( x 0 ) = a 0 = f ( x 0 ) → a 0 = f ( x 0 ) N n ( x 1 ) = a 0 + a 1 ( x 1 ? x 0 ) = f ( x 1 ) → a 1 = f ( x 1 ) ? f ( x 0 ) x 1 ? x 0 = f [ x 0 , x 1 ] N n ( x 2 ) = a 0 + a 1 ( x 2 ? x 0 ) + a 2 ( x 2 ? x 0 ) ( x 2 ? x 1 ) = f ( x 2 ) → a 2 = f [ x 0 , x 2 ] ? f [ x 0 , x 1 ] x 2 ? x 0 = f [ x 0 , x 1 , x 2 ] N_n(x_0)=a_0=f(x_0)\rightarrow a_0=f(x_0)\\N_n(x_1)=a_0+a_1(x_1-x_0)=f(x_1)\rightarrow a_1=\frac{f(x_1)-f(x_0)}{x_1-x_0}=f[x_0,x_1]\\N_n(x_2)=a_0+a_1(x_2-x_0)+a_2(x_2-x_0)(x_2-x_1)=f(x_2)\rightarrow a_2=\frac{f[x_0,x_2]-f[x_0,x_1]}{x_2-x_0}=f[x_0,x_1,x_2] Nn?(x0?)=a0?=f(x0?)a0?=f(x0?)Nn?(x1?)=a0?+a1?(x1??x0?)=f(x1?)a1?=x1??x0?f(x1?)?f(x0?)?=f[x0?,x1?]Nn?(x2?)=a0?+a1?(x2??x0?)+a2?(x2??x0?)(x2??x1?)=f(x2?)a2?=x2??x0?f[x0?,x2?]?f[x0?,x1?]?=f[x0?,x1?,x2?]
由归纳法可得:
a k = f [ x 0 , x 1 , ? , x k ] ( k = 0 , 1 , ? , n ) a_k=f[x_0,x_1,\cdots,x_k](k=0,1,\cdots,n) ak?=f[x0?,x1?,?,xk?](k=0,1,?,n)
x 0 , x 1 , ? , x n x_0,x_1,\cdots,x_n x0?,x1?,?,xn? 为结点的 n n n 次牛顿型插值多项式:
N n ( x ) = f ( x 0 ) + f [ x 0 , x 1 ] ( x ? x 0 ) + f [ x 0 , x 1 , x 2 ] ( x ? x 0 ) ( x ? x 1 ) + ? + f [ x 0 , x 1 , ? , x n ] ( x ? x 0 ) ( x ? x 1 ) ? ( x ? x n ? 1 ) N_n(x)=f(x_0)+f[x_0,x_1](x-x_0)+f[x_0,x_1,x_2](x-x_0)(x-x_1)+\cdots+f[x_0,x_1,\cdots,x_n](x-x_0)(x-x_1)\cdots(x-x_{n-1}) Nn?(x)=f(x0?)+f[x0?,x1?](x?x0?)+f[x0?,x1?,x2?](x?x0?)(x?x1?)+?+f[x0?,x1?,?,xn?](x?x0?)(x?x1?)?(x?xn?1?)
当新增加一个结点 x n + 1 x_{n+1} xn+1? 时:
N n + 1 ( x ) = N n ( x ) + f [ x 0 , x 1 , ? , x n , x n + 1 ] ( x ? x 0 ) ( x ? x 1 ) ? ( x ? x n ? 1 ) ( x ? x n ) N_{n+1}(x)=N_n(x)+f[x_0,x_1,\cdots,x_n,x_{n+1}](x-x_0)(x-x_1)\cdots(x-x_{n-1})(x-x_n) Nn+1?(x)=Nn?(x)+f[x0?,x1?,?,xn?,xn+1?](x?x0?)(x?x1?)?(x?xn?1?)(x?xn?)
插值多项式的误差(差商形式)表示:
f ( x ) ≡ f ( x 0 ) + f [ x 0 , x 1 ] ( x ? x 0 ) + ? + f [ x 0 , x 1 , ? , x n ] ( x ? x 0 ) ? ( x ? x n ? 1 ) + f [ x 0 , x 1 , ? , x n , x ] ( x ? x 0 ) ? ( x ? x n ) = N n ( x ) + f [ x 0 , x 1 , ? , x n , x ] ( x ? x 0 ) ? ( x ? x n ) f(x)\equiv f(x_0)+f[x_0,x_1](x-x_0)+\cdots+f[x_0,x_1,\cdots,x_n](x-x_0)\cdots(x-x_{n-1})+f[x_0,x_1,\cdots,x_n,x](x-x_0)\cdots(x-x_n)\\=N_n(x)+f[x_0,x_1,\cdots,x_n,x](x-x_0)\cdots(x-x_n) f(x)f(x0?)+f[x0?,x1?](x?x0?)+?+f[x0?,x1?,?,xn?](x?x0?)?(x?xn?1?)+f[x0?,x1?,?,xn?,x](x?x0?)?(x?xn?)=Nn?(x)+f[x0?,x1?,?,xn?,x](x?x0?)?(x?xn?)
f ( x ) ∈ C n + 1 [ a , b ] f(x)\in C^{n+1}[a,b] f(x)Cn+1[a,b],则有
R n ( x ) = f ( x ) ? N n ( x ) = f [ x 0 , x 1 , ? , x n , x ] ( x ? x 0 ) ? ( x ? x n ) f [ x 0 , x 1 , ? , x n , x ] = f ( n + 1 ) ( ξ ) ( n + 1 ) ! R_n(x)=f(x)-N_n(x)=f[x_0,x_1,\cdots,x_n,x](x-x_0)\cdots(x-x_n)\\f[x_0,x_1,\cdots,x_n,x]=\frac{f^{(n+1)}(\xi)}{(n+1)!} Rn?(x)=f(x)?Nn?(x)=f[x0?,x1?,?,xn?,x](x?x0?)?(x?xn?)f[x0?,x1?,?,xn?,x]=(n+1)!f(n+1)(ξ)?
一般地,若 f ( x ) ∈ C n + 1 [ a , b ] f(x)\in C^{n+1}[a,b] f(x)Cn+1[a,b],则存在 ξ ∈ ( a , b ) \xi\in(a,b) ξ(a,b),使得
f [ x 0 , x 1 , ? , x n ] = f ( n ) ( ξ ) n ! f[x_0,x_1,\cdots,x_n]=\frac{f^{(n)}(\xi)}{n!} f[x0?,x1?,?,xn?]=n!f(n)(ξ)?

差分与等距结点下的牛顿公式

设函数 f ( x ) f(x) f(x)等距结点 x k = x 0 + k h ( k = 0 , 1 , 2 , ? ) x_k=x_0+kh(k=0,1,2,\cdots) xk?=x0?+kh(k=0,1,2,?) 上的值 f ( x k ) f(x_k) f(xk?) 已知,步长 h h h 为常数。

定义2:函数 y = f ( x ) y=f(x) y=f(x) x k x_k xk? 处以 h h h 为步长的一阶向前差分与二阶向前差分:
Δ y k = Δ f ( x k ) = f ( x k + 1 ) ? f ( x k ) Δ 2 y k = Δ 2 f ( x k ) = Δ ( Δ f ( x k ) ) = Δ f ( x k + 1 ) ? Δ f ( x k ) = f ( x k + 2 ) ? 2 f ( x k + 1 ) + f ( x k ) \Delta y_k=\Delta f(x_k)=f(x_{k+1})-f(x_k)\\\Delta^2y_k=\Delta^2f(x_k)=\Delta(\Delta f(x_k))=\Delta f(x_{k+1})-\Delta f(x_k)=f(x_{k+2})-2f(x_{k+1})+f(x_k) Δyk?=Δf(xk?)=f(xk+1?)?f(xk?)Δ2yk?=Δ2f(xk?)=Δ(Δf(xk?))=Δf(xk+1?)?Δf(xk?)=f(xk+2?)?2f(xk+1?)+f(xk?)
一般性, m m m 阶向前差分:
Δ m y k = Δ m f ( x k ) = Δ ( Δ m ? 1 f ( x k ) ) = Δ m ? 1 f ( x k + 1 ) ? Δ m ? 1 f ( x k ) \Delta^my_k=\Delta^mf(x_k)=\Delta(\Delta^{m-1}f(x_k))=\Delta^{m-1}f(x_{k+1})-\Delta^{m-1}f(x_k) Δmyk?=Δmf(xk?)=Δ(Δm?1f(xk?))=Δm?1f(xk+1?)?Δm?1f(xk?)

定义3:函数 y = f ( x ) y=f(x) y=f(x) x k x_k xk? 处以 h h h 为步长的一阶向后差分与二阶向后差分:
▽ y k = ▽ f ( x k ) = f ( x k ) ? f ( x k ? 1 ) ▽ 2 y k = ▽ 2 f ( x k ) = ▽ ( ▽ f ( x k ) ) = ▽ f ( x k ) ? ▽ f ( x k ? 1 ) = f ( x k ) ? 2 f ( x k ? 1 ) + f ( x k ? 2 ) \triangledown y_k=\triangledown f(x_k)=f(x_k)-f(x_{k-1})\\\triangledown^2y_k=\triangledown^2f(x_k)=\triangledown(\triangledown f(x_k))=\triangledown f(x_k)- \triangledown f(x_{k-1})=f(x_k)-2f(x_{k-1})+f(x_{k-2}) yk?=f(xk?)=f(xk?)?f(xk?1?)2yk?=2f(xk?)=(f(xk?))=f(xk?)?f(xk?1?)=f(xk?)?2f(xk?1?)+f(xk?2?)
一般性, m m m 阶向后差分:
▽ m y k = ▽ m f ( x k ) = ▽ ( ▽ m ? 1 f ( x k ) ) = ▽ m ? 1 f ( x k ) ? ▽ m ? 1 f ( x k ? 1 ) \triangledown^my_k=\triangledown^mf(x_k)=\triangledown(\triangledown^{m-1}f(x_k))=\triangledown^{m-1}f(x_k)-\triangledown^{m-1}f(x_{k-1}) myk?=mf(xk?)=(m?1f(xk?))=m?1f(xk?)?m?1f(xk?1?)

差商与差分关系
f [ x 0 , x 1 , ? , x m ] = Δ m f ( x 0 ) m ! h m f [ x n , x n ? 1 , ? , x n ? m ] = ▽ m f ( x n ) m ! h m f[x_0,x_1,\cdots,x_m]=\frac{\Delta^mf(x_0)}{m!h^m}\\f[x_n,x_{n-1},\cdots,x_{n-m}]=\frac{\triangledown^mf(x_n)}{m!h^m} f[x0?,x1?,?,xm?]=m!hmΔmf(x0?)?f[xn?,xn?1?,?,xn?m?]=m!hmmf(xn?)?

等距结点的Newton型多项式插值的差分形式:引入变量 t t t ,设 x = x 0 + t h x=x_0+th x=x0?+th (有 x ? x i = ( t ? i ) h x-x_i=(t-i)h x?xi?=(t?i)h),则等距结点的Newton插值公式
N n ( x 0 + t h ) = f ( x 0 ) + t Δ f ( x 0 ) + t ( t ? 1 ) 2 ! Δ 2 f ( x 0 ) + ? + t ( t ? 1 ) ? ( t ? n + 1 ) n ! Δ n f ( x 0 ) N_n(x_0+th)=f(x_0)+t\Delta f(x_0)+\frac{t(t-1)}{2!}\Delta^2f(x_0)+\cdots+\frac{t(t-1)\cdots(t-n+1)}{n!}\Delta^nf(x_0) Nn?(x0?+th)=f(x0?)+tΔf(x0?)+2!t(t?1)?Δ2f(x0?)+?+n!t(t?1)?(t?n+1)?Δnf(x0?)
f ( x ) ∈ C n + 1 [ a , b ] f(x)\in C^{n+1}[a,b] f(x)Cn+1[a,b],则插值误差可表示为
R n ( x ) = R n ( x 0 + t h ) = t ( t ? 1 ) ? ( t ? n ) ( n + 1 ) ! h n + 1 f ( n + 1 ) ( ζ ) , ζ ∈ ( x 0 , x n ) R_n(x)=R_n(x_0+th)=\frac{t(t-1)\cdots(t-n)}{(n+1)!}h^{n+1}f^{(n+1)}(\zeta),\zeta\in(x_0,x_n) Rn?(x)=Rn?(x0?+th)=(n+1)!t(t?1)?(t?n)?hn+1f(n+1)(ζ),ζ(x0?,xn?)
(1)牛顿表初公式牛顿向前差分公式:若 x x x x 0 x_0 x0? 附近,选取的牛顿型插值公式为
N n ( x 0 + t h ) = f ( x 0 ) + t Δ f ( x 0 ) + t ( t ? 1 ) 2 ! Δ 2 f ( x 0 ) + ? + t ( t ? 1 ) ? ( t ? n + 1 ) n ! Δ n f ( x 0 ) N_n(x_0+th)=f(x_0)+t\Delta f(x_0)+\frac{t(t-1)}{2!}\Delta^2f(x_0)+\cdots+\frac{t(t-1)\cdots(t-n+1)}{n!}\Delta^nf(x_0) Nn?(x0?+th)=f(x0?)+tΔf(x0?)+2!t(t?1)?Δ2f(x0?)+?+n!t(t?1)?(t?n+1)?Δnf(x0?)
(2)牛顿表末公式牛顿向后差分公式:若 x x x x n x_n xn? 附近,选取的牛顿型插值公式为
N n ( x ) = N n ( x n + t h ) = f ( x n ) + f [ x n , x n ? 1 ] ( x ? x n ) + f [ x n , x n ? 1 , x n ? 2 ] ( x ? x n ) ( x ? x n ? 1 ) + f [ x n , x n ? 1 , ? , x 0 ] ( x ? x n ) ( x ? x n ? 1 ) ? ( x ? x 1 ) = f ( x n ) + t ▽ f ( x n ) + t ( t + 1 ) 2 ! ▽ 2 f ( x n ) + ? + t ( t + 1 ) ? ( t + n ? 1 ) n ! ▽ n f ( x n ) 其 中 , x k = x n ? ( n ? k ) h R n ( x ) = R n ( x n + t h ) = t ( t + 1 ) ? ( t + n ) ( n + 1 ) ! h n + 1 f ( n + 1 ) ( ζ ) , ζ ∈ ( x 0 , x n ) N_n(x)=N_n(x_n+th)=f(x_n)+f[x_n,x_{n-1}](x-x_n)+f[x_n,x_{n-1},x_{n-2}](x-x_n)(x-x_{n-1})\\+f[x_n,x_{n-1},\cdots,x_0](x-x_n)(x-x_{n-1})\cdots(x-x_1)\\=f(x_n)+t\triangledown f(x_n)+\frac{t(t+1)}{2!}\triangledown^2f(x_n)+\cdots+\frac{t(t+1)\cdots(t+n-1)}{n!}\triangledown^nf(x_n)\\其中,x_k=x_n-(n-k)h\\R_n(x)=R_n(x_n+th)=\frac{t(t+1)\cdots(t+n)}{(n+1)!}h^{n+1}f^{(n+1)}(\zeta),\zeta\in(x_0,x_n) Nn?(x)=Nn?(xn?+th)=f(xn?)+f[xn?,xn?1?](x?xn?)+f[xn?,xn?1?,xn?2?](x?xn?)(x?xn?1?)+f[xn?,xn?1?,?,x0?](x?xn?)(x?xn?1?)?(x?x1?)=f(xn?)+tf(xn?)+2!t(t+1)?2f(xn?)+?+n!t(t+1)?(t+n?1)?nf(xn?)xk?=xn??(n?k)hRn?(x)=Rn?(xn?+th)=(n+1)!t(t+1)?(t+n)?hn+1f(n+1)(ζ),ζ(x0?,xn?)
(3)牛顿表中插值公式

定义4: δ y k = f ( x k + h 2 ) ? f ( x k ? h 2 ) = y k + 1 2 ? y k ? 1 2 \delta y_k=f(x_k+\frac{h}{2})-f(x_k-\frac{h}{2})=y_{k+\frac{1}{2}}-y_{k-\frac{1}{2}} δyk?=f(xk?+2h?)?f(xk??2h?)=yk+21???yk?21?? 称为一阶中心差分。

δ m y k = δ m ? 1 y k + 1 2 ? δ m ? 1 y k ? 1 2 \delta^my_k=\delta^{m-1}y_{k+\frac{1}{2}}-\delta^{m-1}y_{k-\frac{1}{2}} δmyk?=δm?1yk+21???δm?1yk?21?? 称为 m m m 阶中心差分。

埃尔米特(Hermite)插值

插值在给定的结点处,不但要求插值多项式的函数值与被插函数的函数值相同,同时还要求在结点处,插值多项式的一阶直至指定阶的导数值也与被插函数的相应阶导数值相等。

f ( x ) f(x) f(x) [ a , b ] [a,b] [a,b] 上充分光滑函数,对给定的插值结点 { x i } i = 0 n \{x_i\}^n_{i=0} { xi?}i=0n? 及相应的重数标号 { m i } i = 0 n \{m_i\}^n_{i=0} { mi?}i=0n?,当 ∑ i = 0 n m i = N + 1 \sum_{i=0}^nm_i=N+1 i=0n?mi?=N+1 时,若有 H ( x ) ∈ P n H(x)\in P_n H(x)Pn? 满足:
H ( l ) ( x i ) = f ( l ) ( x i ) , l = 0 , 1 , ? , m i ? 1 , i = 0 , 1 , ? , n H^{(l)}(x_i)=f^{(l)}(x_i),l=0,1,\cdots,m_i-1,i=0,1,\cdots,n H(l)(xi?)=f(l)(xi?),l=0,1,?,mi??1,i=0,1,?,n
则称 H ( x ) H(x) H(x) f ( x ) f(x) f(x) 关于结点 { x i } i = 0 n \{x_i\}^n_{i=0} { xi?}i=0n? 及重数标号 { m i } i = 0 n \{m_i\}^n_{i=0} { mi?}i=0n?埃尔米特插值多项式。

二重( m i = 2 m_i=2 mi?=2): f ( x ) ∈ C 2 [ a , b ] f(x)\in C^2[a,b] f(x)C2[a,b],若有 H 2 n + 1 ( x i ) = f ( x i ) , H 2 n + 1 ′ ( x i ) = f ′ ( x i ) , i = 0 , 1 , ? , n H_{2n+1}(x_i)=f(x_i),H'_{2n+1}(x_i)=f'(x_i),i=0,1,\cdots,n H2n+1?(xi?)=f(xi?),H2n+1?(xi?)=f(xi?),i=0,1,?,n,称 H 2 n + 1 ( x ) H_{2n+1}(x) H2n+1?(x) f ( x ) f(x) f(x) 关于结点 { x i } i = 0 n \{x_i\}^n_{i=0} { xi?}i=0n?二重埃尔米特插值多项式,其存在且唯一(由克拉默法则易得)。

基函数构造法:
H 2 n + 1 ( x ) = ∑ i = 0 n A i ( x ) f ( x i ) + ∑ i = 0 n B i ( x ) f ′ ( x i ) H_{2n+1}(x)=\sum_{i=0}^nA_i(x)f(x_i)+\sum_{i=0}^nB_i(x)f'(x_i) H2n+1?(x)=i=0n?Ai?(x)f(xi?)+i=0n?Bi?(x)f(xi?)
P 2 n + 1 P_{2n+1} P2n+1? 上构造 2 n + 2 2n+2 2n+2 个基函数 { A i ( x ) , B i ( x ) } i = 0 n \{A_i(x),B_i(x)\}^n_{i=0} { Ai?(x),Bi?(x)}i=0n?,分别满足
{ A i ( x j ) = δ i j A i ′ ( x j ) = 0 , j = 0 , 1 , ? , n , i = 0 , 1 , ? , n { B i ( x j ) = 0 B i ′ ( x j ) = δ i j , j = 0 , 1 , ? , n , i = 0 , 1 , ? , n \begin{cases}A_i(x_j)=\delta_{ij}\\A'_i(x_j)=0\end{cases},j=0,1,\cdots,n,i=0,1,\cdots,n\\\begin{cases}B_i(x_j)=0\\B'_i(x_j)=\delta_{ij}\end{cases},j=0,1,\cdots,n,i=0,1,\cdots,n { Ai?(xj?)=δij?Ai?(xj?)=0?,j=0,1,?,n,i=0,1,?,n{ Bi?(xj?)=0Bi?(xj?)=δij??,j=0,1,?,n,i=0,1,?,n
可得 x 0 , x 1 , ? , x i ? 1 , x i + 1 , ? , x n x_0,x_1,\cdots,x_{i-1},x_{i+1},\cdots,x_n x0?,x1?,?,xi?1?,xi+1?,?,xn? A i ( x ) A_i(x) Ai?(x) 的二重零点, A i ( x ) ∈ P 2 n + 1 A_i(x)\in P_{2n+1} Ai?(x)P2n+1?,有:
A i ( x ) = ( a i x + b i ) [ ( x ? x 0 ) 2 ( x ? x 1 ) 2 ? ( x ? x i ? 1 ) 2 ( x ? x i + 1 ) 2 ? ( x ? x n ) 2 ] 也 可 设 : A i ( x ) = [ a i ( x ? x i ) + b i ] ∏ j = 0 , j ≠ i n ( x ? x j ) 2 A_i(x)=(a_ix+b_i)[(x-x_0)^2(x-x_1)^2\cdots(x-x_{i-1})^2(x-x_{i+1})^2\cdots(x-x_n)^2]\\也可设:A_i(x)=[a_i(x-x_i)+b_i]\prod_{j=0,j\neq i}^n(x-x_j)^2 Ai?(x)=(ai?x+bi?)[(x?x0?)2(x?x1?)2?(x?xi?1?)2(x?xi+1?)2?(x?xn?)2]:Ai?(x)=[ai?(x?xi?)+bi?]j=0,j??=in?(x?xj?)2
A i ( x i ) = 1 , A i ′ ( x i ) = 0 A_i(x_i)=1,A'_i(x_i)=0 Ai?(xi?)=1,Ai?(xi?)=0
b i = 1 / ∏ j = 0 , j ≠ i n ( x i ? x j ) 2 A i ( x ) = [ 1 ? 2 ( x ? x i ) ∑ j = 0 , j ≠ i n 1 x i ? x j ] l i 2 ( x ) b_i=1/\prod_{j=0,j\neq i}^n(x_i-x_j)^2\\A_i(x)=[1-2(x-x_i)\sum_{j=0,j\neq i}^n\frac{1}{x_i-x_j}]l_i^2(x) bi?=1/j=0,j??=in?(xi??xj?)2Ai?(x)=[1?2(x?xi?)j=0,j??=in?xi??xj?1?]li2?(x)
其中, l i ( x ) l_i(x) li?(x) 为关于点 { x i } i = 0 n \{x_i\}^n_{i=0} { xi?}i=0n? 的Lagrange 基函数。用类似的方法,可得到
B i ( x ) = ( x ? x i ) l i 2 ( x ) H 2 n + 1 ( x ) = ∑ i = 0 n A i ( x ) f ( x i ) + ∑ i = 0 n B i ( x ) f ′ ( x i ) B_i(x)=(x-x_i)l_i^2(x)\\H_{2n+1}(x)=\sum_{i=0}^nA_i(x)f(x_i)+\sum_{i=0}^nB_i(x)f'(x_i) Bi?(x)=(x?xi?)li2?(x)H2n+1?(x)=i=0n?Ai?(x)f(xi?)+i=0n?Bi?(x)f(xi?)
二重埃尔米特插值多项式的误差分析:若 f ∈ C 2 n + 2 [ a , b ] f\in C^{2n+2}[a,b] fC2n+2[a,b],则 f ( x ) f(x) f(x) 关于 [ a , b ] [a,b] [a,b] 上结点 { x i } i = 0 n \{x_i\}^n_{i=0} { xi?}i=0n? 的二重埃尔米特插值多项式误差为
f ( x ) ? H 2 n + 1 ( x ) = f ( 2 n + 2 ) ( ξ ) ( 2 n + 2 ) ! ω n + 1 2 ( x ) m i n { x 0 , x 1 , ? , x n , x } ≤ ξ = ξ ( x ) ≤ m a x { x 0 , x 1 , ? , x n , x } f(x)-H_{2n+1}(x)=\frac{f^{(2n+2)}(\xi)}{(2n+2)!}\omega^2_{n+1}(x)\\min\{x_0,x_1,\cdots,x_n,x\}\leq\xi=\xi(x)\leq max\{x_0,x_1,\cdots,x_n,x\} f(x)?H2n+1?(x)=(2n+2)!f(2n+2)(ξ)?ωn+12?(x)min{ x0?,x1?,?,xn?,x}ξ=ξ(x)max{ x0?,x1?,?,xn?,x}
具有两个结点 x 0 , x 1 x_0,x_1 x0?,x1? 的二重埃尔米特插值为一个三次多项式,基函数分别为:
A 0 ( x ) = [ 1 ? 2 x ? x 0 x 0 ? x 1 ] ( x ? x 1 x 0 ? x 1 ) 2 A 1 ( x ) = [ 1 ? 2 x ? x 1 x 1 ? x 0 ] ( x ? x 1 x 0 ? x 1 ) 2 B 0 ( x ) = ( x ? x 0 ) ( x ? x 1 x 0 ? x 1 ) 2 B 1 ( x ) = ( x ? x 1 ) ( x ? x 1 x 0 ? x 1 ) 2 A_0(x)=[1-2\frac{x-x_0}{x_0-x_1}](\frac{x-x_1}{x_0-x_1})^2\\A_1(x)=[1-2\frac{x-x_1}{x_1-x_0}](\frac{x-x_1}{x_0-x_1})^2\\B_0(x)=(x-x_0)(\frac{x-x_1}{x_0-x_1})^2\\B_1(x)=(x-x_1)(\frac{x-x_1}{x_0-x_1})^2 A0?(x)=[1?2x0??x1?x?x0??](x0??x1?x?x1??)2A1?(x)=[1?2x1??x0?x?x1??](x0??x1?x?x1??)2B0?(x)=(x?x0?)(x0??x1?x?x1??)2B1?(x)=(x?x1?)(x0??x1?x?x1??)2
所以,二重埃尔米特插值多项式为:
H 3 ( x ) = A 0 ( x ) f ( x 0 ) + A 1 ( x ) f ( x 1 ) + B 0 ( x ) f ′ ( x 0 ) + B 1 ( x ) f ′ ( x 1 ) H_3(x)=A_0(x)f(x_0)+A_1(x)f(x_1)+B_0(x)f'(x_0)+B_1(x)f'(x_1) H3?(x)=A0?(x)f(x0?)+A1?(x)f(x1?)+B0?(x)f(x0?)+B1?(x)f(x1?)
f ∈ C 4 [ a , b ] f\in C^4[a,b] fC4[a,b],则有误差表达式:
R 3 ( x ) = f ( x ) ? H 3 ( x ) = f ( 4 ) ( ξ ) 4 ! ( x ? x 0 ) 2 ( x ? x 1 ) 2 R_3(x)=f(x)-H_3(x)=\frac{f^{(4)}(\xi)}{4!}(x-x_0)^2(x-x_1)^2 R3?(x)=f(x)?H3?(x)=4!f(4)(ξ)?(x?x0?)2(x?x1?)2

一般形式的Hermite插值问题:求一个次数不大于 n + r + 1 n+r+1 n+r+1 的代数多项式 H ( x ) H(x) H(x) ,满足:
H ( x i ) = f ( x i ) , i = 0 , 1 , 2 , ? , n H ′ ( x i ) = f ′ ( x i ) , i = 0 , 1 , 2 , ? , r ( r ≤ n ) H(x_i)=f(x_i),i=0,1,2,\cdots,n\\H'(x_i)=f'(x_i),i=0,1,2,\cdots,r(r\leq n) H(xi?)=f(xi?),i=0,1,2,?,nH(xi?)=f(xi?),i=0,1,2,?,r(rn)
H ( x ) = ∑ k = 0 n h k ( x ) f ( x k ) + ∑ k = 0 r h ˉ k ( x ) f ′ ( x k ) H(x)=\sum_{k=0}^nh_k(x)f(x_k)+\sum_{k=0}^r\bar{h}_k(x)f'(x_k) H(x)=k=0n?hk?(x)f(xk?)+k=0r?hˉk?(x)f(xk?),其中 h k ( x ) 、 h ˉ k ( x ) h_k(x)、\bar{h}_k(x) hk?(x)hˉk?(x) 都是 n + r + 1 n+r+1 n+r+1 次待定多项式,并且满足:
h k ( x i ) = { 1 i = k 0 i ≠ k i , k = 0 , 1 , ? , n h k ′ ( x i ) = 0 , k = 0 , 1 , ? , n ; i = 0 , 1 , ? , r h ˉ k ′ ( x i ) = { 1 i = k 0 i ≠ k i , k = 0 , 1 , ? , r h ˉ k ( x i ) = 0 , k = 0 , 1 , ? , r ; i = 0 , 1 , ? , n h_k(x_i)=\begin{cases}1\ \ i=k\\0\ \ i\neq k\end{cases}\ \ \ \ i,k=0,1,\cdots,n\\h'_k(x_i)=0,\ \ k=0,1,\cdots,n;i=0,1,\cdots,r\\\bar{h}_k'(x_i)=\begin{cases}1\ \ i=k\\0\ \ i\neq k\end{cases}\ \ \ \ i,k=0,1,\cdots,r\\\bar{h}_k(x_i)=0,\ \ k=0,1,\cdots,r;i=0,1,\cdots,n hk?(xi?)={ 1  i=k0  i??=k?    i,k=0,1,?,nhk?(xi?)=0,  k=0,1,?,n;i=0,1,?,rhˉk?(xi?)={ 1  i=k0  i??=k?    i,k=0,1,?,rhˉk?(xi?)=0,  k=0,1,?,r;i=0,1,?,n
1、求解 h k ( x ) ( k = 0 , 1 , ? , n ) h_k(x)(k=0,1,\cdots,n) hk?(x)(k=0,1,?,n):由条件可得, x i ( i = 0 , 1 , ? , r ; i ≠ k ) x_i(i=0,1,\cdots,r;i\neq k) xi?(i=0,1,?,r;i??=k) h k ( x ) h_k(x) hk?(x) 的二重零点, x i ( i = r + 1 , r + 2 , ? , n ; i ≠ k ) x_i(i=r+1,r+2,\cdots,n;i\neq k) xi?(i=r+1,r+2,?,n;i??=k) h k ( x ) h_k(x) hk?(x) 的零点。

0 ≤ k ≤ r 0\leq k\leq r 0kr 时:
h k ( x ) = ( A x + B ) ( x ? x 0 ) 2 ? ( x ? x k ? 1 ) 2 ( x ? x k + 1 ) 2 ? ( x ? x r ) 2 ( x ? x r + 1 ) ? ( x ? x n ) = ( A x + B ) ∏ i = 0 , i ≠ k r ( x ? x i ) 2 ∏ i = r + 1 n ( x ? x i ) h_k(x)=(Ax+B)(x-x_0)^2\cdots(x-x_{k-1})^2(x-x_{k+1})^2\cdots(x-x_r)^2(x-x_{r+1})\cdots(x-x_n)\\=(Ax+B)\prod_{i=0,i\neq k}^r(x-x_i)^2\prod_{i=r+1}^n(x-x_i) hk?(x)=(Ax+B)(x?x0?)2?(x?xk?1?)2(x?xk+1?)2?(x?xr?)2(x?xr+1?)?(x?xn?)=(Ax+B)i=0,i??=kr?(x?xi?)2i=r+1n?(x?xi?)

又由 h k ( x k ) = 1 , h k ′ ( x k ) = 0 h_k(x_k)=1,h_k'(x_k)=0 hk?(xk?)=1,hk?(xk?)=0 得:
( A x k + B ) ∏ i = 0 , i ≠ k r ( x k ? x i ) 2 ∏ i = r + 1 n ( x k ? x i ) = 1 A ∏ i = 0 i ≠ k r ( x k ? x i ) 2 ∏ i = r + 1 n ( x k ? x i ) + 2 ( A x k + B ) ∑ j = 0 r ( x k ? x j ) ∏ i = 0 i ≠ j i ≠ k r ( x k ? x i ) 2 ∏ i = r + 1 n ( x k ? x i ) + ( A x k + B ) ∑ j = r + 1 n ∏ i = 0 i ≠ k r ( x k ? x i ) 2 ∏ i = r + 1 i ≠ j n ( x k ? x i ) = 0 (Ax_k+B)\prod_{i=0,i\neq k}^r(x_k-x_i)^2\prod_{i=r+1}^n(x_k-x_i)=1\\A\prod_{i=0\\i\neq k}^r(x_k-x_i)^2\prod_{i=r+1}^n(x_k-x_i)+2(Ax_k+B)\sum_{j=0}^r(x_k-x_j)\prod_{i=0\\i\neq j\\i\neq k}^r(x_k-x_i)^2\prod_{i=r+1}^n(x_k-x_i)+(Ax_k+B)\sum_{j=r+1}^n\prod_{i=0\\i\neq k}^r(x_k-x_i)^2\prod_{i=r+1\\i\neq j}^n(x_k-x_i)=0 (Axk?+B)i=0,i??=kr?(xk??xi?)2i=r+1n?(xk??xi?)=1Ai=0i??=kr?(xk??xi?)2i=r+1n?(xk??xi?)+2(Axk?+B)j=0r?(xk??xj?)i=0i??=ji??=kr?(xk??xi?)2i=r+1n?(xk??xi?)+(Axk?+B)j=r+1n?i=0i??=kr?(xk??xi?)2i=r+1i??=jn?(xk??xi?)=0
解得
A = ? 2 ∑ j = 0 r 1 x k ? x j + ∑ j = r + 1 n 1 x k ? x j ∏ i = 0 i ≠ k r ( x k ? x i ) 2 ∏ i = r + 1 n ( x k ? x i ) B = ? 1 ? A x k ∏ i = 0 i ≠ k r ( x k ? x i ) 2 ∏ i = r + 1 n ( x k ? x i ) h k ( x ) = { 1 ? ( x ? x k ) [ l k n ′ ( x k ) + l k r ′ ( x k ) ] } l k n ( x ) l k r ( x ) , k = 0 , 1 , ? , r 其 中 : l k n ( x ) = ∏ i = 0 i ≠ k n x ? x i x k ? x i l k r ( x ) = ∏ i = 0 i ≠ k r x ? x i x k ? x i l k n ′ ( x k ) = ∏ i = 0 i ≠ k n 1 x k ? x i l k r ′ ( x k ) = ∏ i = 0 i ≠ k r 1 x k ? x i A=-\frac{2\sum_{j=0}^r\frac{1}{x_k-x_j}+\sum_{j=r+1}^n\frac{1}{x_k-x_j}}{\prod_{i=0\\i\neq k}^r(x_k-x_i)^2\prod_{i=r+1}^n(x_k-x_i)}\\B=-\frac{1-Ax_k}{\prod_{i=0\\i\neq k}^r(x_k-x_i)^2\prod_{i=r+1}^n(x_k-x_i)}\\h_k(x)=\{1-(x-x_k)[l'_{kn}(x_k)+l'_{kr}(x_k)]\}l_{kn}(x)l_{kr}(x),k=0,1,\cdots,r\\其中:l_{kn}(x)=\prod_{i=0\\i\neq k}^n\frac{x-x_i}{x_k-x_i}\\l_{kr}(x)=\prod_{i=0\\i\neq k}^r\frac{x-x_i}{x_k-x_i}\\l'_{kn}(x_k)=\prod_{i=0\\i\neq k}^n\frac{1}{x_k-x_i}\\l'_{kr}(x_k)=\prod_{i=0\\i\neq k}^r\frac{1}{x_k-x_i} A=?i=0i??=kr?(xk??xi?)2i=r+1n?(xk??xi?)2j=0r?xk??xj?1?