基本原理
给定函数 f(x)f(x)f(x),用 nnn 阶多项式 p(x)p\left( x \right)p(x) 在 x=x0x=x_0x=x0 邻域内,拟合该函数 f(x)f(x)f(x)。将 p(x)p\left( x \right)p(x) 表示为一般形式:
p(x)=a0+a1(x−x0)+a2(x−x0)2+...+an(x−x0)np\left( x \right) = {a_0} + {a_1}\left( {x - {x_0}} \right) + {a_2}{\left( {x - {x_0}} \right)^2} + ... + {a_n}{\left( {x - {x_0}} \right)^n}p(x)=a0+a1(x−x0)+a2(x−x0)2+...+an(x−x0)n
设置p(x)p\left( x \right)p(x)与f(x)f\left( x \right)f(x)的前 nnn 阶导数在 x=x0x=x_0x=x0 处相等,从而求解系数 a0,a1,a2,...,ana_0,a_1,a_2,...,a_na0,a1,a2,...,an,如下所示:
{
p(x0)=f(x0)p′(x0)=f′(x0)p′′(x0)=f′′(x0)⋮p(n)(x0)=f(n)(x0)→{
a0=f(x0)a1=f′(x0)1!a2=f′′(x0)2!⋮an=f(n)(x0)n!\left\{ {\begin{array}{c} {p\left( {
{x_0}} \right) = f\left( {
{x_0}} \right)}\\ {p'\left( {
{x_0}} \right) = f'\left( {
{x_0}} \right)}\\ {p''\left( {
{x_0}} \right) = f''\left( {
{x_0}} \right)}\\ \vdots \\ {
{p^{\left( n \right)}}\left( {
{x_0}} \right) = {f^{\left( n \right)}}\left( {
{x_0}} \right)} \end{array}} \right. \to \left\{ {\begin{array}{c} {
{a_0} = f\left( {
{x_0}} \right)}\\ {
{a_1} = \frac{
{f'\left( {
{x_0}} \right)}}{
{1!}}}\\ {
{a_2} = \frac{
{f''\left( {
{x_0}} \right)}}{
{2!}}}\\ \vdots \\ {
{a_n} = \frac{
{
{f^{\left( n \right)}}\left( {
{x_0}} \right)}}{
{n!}}} \end{array}} \right.⎩
⎨
⎧p(x0)=f(x0)p′(x