# 高中数学/不等式与数列/插值法

## 基础知识

### 插值问题与简单的插值方法

${\displaystyle \left\{{\begin{array}{l}y_{1}=ax_{1}^{2}+bx_{1}+c\\y_{2}=ax_{2}^{2}+bx_{2}+c\\y_{3}=ax_{3}^{2}+bx_{3}+c\end{array}}\right.}$

${\displaystyle {\begin{array}{l}\left\{{\begin{array}{l}y_{1}=ax_{1}^{2}+bx_{1}+c\\y_{2}=ax_{2}^{2}+bx_{2}+c\\y_{3}=ax_{3}^{2}+bx_{3}+c\\\end{array}}\right.\quad \Rightarrow \quad \left\{{\begin{array}{l}2=a\times 1^{2}+b\times 1+c\\4=a\times 3^{2}+b\times 3+c\\6=a\times 5^{2}+b\times 5+c\\\end{array}}\right.\\\Rightarrow a=0,b=1,c=1\end{array}}}$

${\displaystyle y=-{\frac {121}{615}}x^{4}+{736}{615}x^{3}-{\frac {2537}{615}}x}$

### 拉格朗日插值法

#### 2个点与3个点的插值

${\displaystyle y=y_{1}\cdot {\frac {x-x_{2}}{x_{1}-x_{2}}}+y_{2}\cdot {\frac {x-x_{1}}{x_{2}-x_{1}}}}$

${\displaystyle y=y_{1}\cdot {\frac {(x-x_{2})(x-x_{3})}{(x_{1}-x_{2})(x_{1}-x_{3})}}+y_{2}\cdot {\frac {(x-x_{1})(x-x_{3})}{(x_{2}-x_{1})(x_{2}-x_{3})}}+y_{3}\cdot {\frac {(x-x_{1})(x-x_{2})}{(x_{3}-x_{1})(x_{3}-x_{2})}}}$

#### 多个点的插值

${\displaystyle L(x):=\sum _{j=0}^{k}y_{j}\ell _{j}(x)}$

${\displaystyle \ell _{j}(x):=\prod _{i=0,\,i\neq j}^{k}{\frac {x-x_{i}}{x_{j}-x_{i}}}={\frac {(x-x_{0})}{(x_{j}-x_{0})}}\cdots {\frac {(x-x_{j-1})}{(x_{j}-x_{j-1})}}{\frac {(x-x_{j+1})}{(x_{j}-x_{j+1})}}\cdots {\frac {(x-x_{k})}{(x_{j}-x_{k})}}.}$[1]

#### 拟合数列的通项

${\displaystyle {\begin{array}{l}a_{n}=a_{1}\cdot {\frac {(n-2)(n-3)}{(1-2)(1-3)}}+a_{2}\cdot {\frac {(n-1)(n-3)}{(2-1)(2-3)}}+a_{3}\cdot {\frac {(n-1)(n-2)}{(3-1)(3-2)}}\\={\frac {a_{1}}{2}}\cdot (n-2)(n-3)-a_{2}\cdot (n-1)(n-3)+{\frac {a_{3}}{2}}\cdot (n-1)(n-2)\\={\frac {1}{2}}\cdot (n-2)(n-3)-100\cdot (n-1)(n-3)+{\frac {10000}{2}}\cdot (n-1)(n-2)\\={\frac {9801}{2}}n^{2}-{\frac {29205}{2}}n+9703\end{array}}}$

${\displaystyle {\begin{array}{l}a_{n}=a_{1}\cdot {\frac {(n-2)(n-3)(n-4)}{(1-2)(1-3)(1-4)}}+a_{2}\cdot {\frac {(n-1)(n-3)(n-4)}{(2-1)(2-3)(2-4)}}+a_{3}\cdot {\frac {(n-1)(n-2)(n-4)}{(3-1)(3-2)(3-4)}}+a_{4}\cdot {\frac {(n-1)(n-2)(n-3)}{(4-1)(4-2)(4-3)}}\\=-{\frac {a_{1}}{6}}\cdot (n-2)(n-3)(n-4)+{\frac {a_{2}}{2}}\cdot (n-1)(n-3)(n-4)-{\frac {a_{3}}{2}}\cdot (n-1)(n-2)(n-4)+{\frac {a_{4}}{6}}\cdot (n-1)(n-2)(n-3)\\=-{\frac {1}{6}}\cdot (n-2)(n-3)(n-4)+{\frac {11}{2}}\cdot (n-1)(n-3)(n-4)-{\frac {112}{2}}\cdot (n-1)(n-2)(n-4)+{\frac {1122}{6}}\cdot (n-1)(n-2)(n-3)\\={\frac {409}{3}}n^{3}-{\frac {1545}{2}}n^{2}+{\frac {8239}{6}}n-736\end{array}}}$

## 计算机求解

### Mathematica

Mathematica软件提供了专门的内置命令“InterpolatingPolynomial”用于生成最常见的几种插值多项式，其语法格式为：[2]

InterpolatingPolynomial[{f1,f2,…},x]; (* 构建一个关于 x 的插值多项式，在连续的 x 的整数值 1、2、… 上再生成函数值 f_(i) *)
InterpolatingPolynomial[{{x1,f1},{x2,f2},…},x]; (* 对于函数值 f_(i)，对应于 x 的值 x_(i) 构建一个插值多项式 *)
InterpolatingPolynomial[{{{x1,y1,…},f1},{{x2,y2,…},f2},…},{x,y,…}]; (* 构建一个使用变量 x、y、… 的多维插值多项式 *)
InterpolatingPolynomial[{{{x1,…},f1,df1,…},…},{x,…}]; (* 构建一个插值多项式，同时拟合函数值及其导数 *)


InterpolatingPolynomial[{{-1, 4}, {0, 2}, {1, 6}}, x];


InterpolatingPolynomial[{1, 4, 9, 16}, n];


## 参考资料

1. （英文）Julius Orion Smith III．Lagrange Interpolation．Center for Computer Research in Music and Acoustics (CCRMA), Stanford University．於2009年12月22日查閱．
2. （简体中文）InterpolatingPolynomial - Wolfram语言参考资料．Wolfram Alpha官方网站（2020年）．

## 外部链接

• [1]（通过交互式动画演示插值点对所得多项式图形的影响）
1. （简体中文）InterpolatingPolynomial - Wolfram Demonstrations Project．Wolfram Alpha官方网站（2011年3月7日）．