BREAKING NEWS
Hermite interpolation

## Summary

In numerical analysis, Hermite interpolation, named after Charles Hermite, is a method of polynomial interpolation, which generalizes Lagrange interpolation. Lagrange interpolation allows computing a polynomial of degree less than n that takes the same value at n given points as a given function. Instead, Hermite interpolation computes a polynomial of degree less than mn such that the polynomial and its m − 1 first derivatives have the same values at n given points as a given function and its m − 1 first derivatives.

Hermite's method of interpolation is closely related to the Newton's interpolation method, in that both are derived from the calculation of divided differences. However, there other methods for computing a Hermite interpolating polynomial. One can use linear algebra, by taking the coefficients of the interpolating polynomial as unknowns, and writing as linear equations the constraints that the interpolating polynomial must satisfy. For another method, see Chinese remainder theorem § Hermite interpolation.

## Statement of the problem

Hermite interpolation consists of computing a polynomial of degree as low as possible that matches an unknown function both in observed value, and the observed value of its first m derivatives. This means that n(m + 1) values

${\displaystyle {\begin{matrix}(x_{0},y_{0}),&(x_{1},y_{1}),&\ldots ,&(x_{n-1},y_{n-1}),\\(x_{0},y_{0}'),&(x_{1},y_{1}'),&\ldots ,&(x_{n-1},y_{n-1}'),\\\vdots &\vdots &&\vdots \\(x_{0},y_{0}^{(m)}),&(x_{1},y_{1}^{(m)}),&\ldots ,&(x_{n-1},y_{n-1}^{(m)})\end{matrix}}}$

must be known. The resulting polynomial has a degree less than n(m + 1). (In a more general case, there is no need for m to be a fixed value; that is, some points may have more known derivatives than others. In this case the resulting polynomial has a degree less than the number of data points.)

Let us consider a polynomial P(x) of degree less than n(m + 1) with indeterminate coefficients; that is, the coefficients of P(x) are n(m + 1) new variables. Then, by writing the constraints that the interpolating polynomial must satisfy, one gets a system of n(m + 1) linear equations in n(m + 1) unknowns.

In general, such a system has exactly one solution. Charles Hermite proved that this is effectively the case here, as soon as the xi are pairwise different,[citation needed] and provided a method for computing it, which is described below.

## Method

### Simple case

When using divided differences to calculate the Hermite polynomial of a function f, the first step is to copy each point m times. (Here we will consider the simplest case ${\displaystyle m=1}$  for all points.) Therefore, given ${\displaystyle n+1}$  data points ${\displaystyle x_{0},x_{1},x_{2},\ldots ,x_{n}}$ , and values ${\displaystyle f(x_{0}),f(x_{1}),\ldots ,f(x_{n})}$  and ${\displaystyle f'(x_{0}),f'(x_{1}),\ldots ,f'(x_{n})}$  for a function ${\displaystyle f}$  that we want to interpolate, we create a new dataset

${\displaystyle z_{0},z_{1},\ldots ,z_{2n+1}}$

such that

${\displaystyle z_{2i}=z_{2i+1}=x_{i}.}$

Now, we create a divided differences table for the points ${\displaystyle z_{0},z_{1},\ldots ,z_{2n+1}}$ . However, for some divided differences,

${\displaystyle z_{i}=z_{i+1}\implies f[z_{i},z_{i+1}]={\frac {f(z_{i+1})-f(z_{i})}{z_{i+1}-z_{i}}}={\frac {0}{0}}}$

which is undefined. In this case, the divided difference is replaced by ${\displaystyle f'(z_{i})}$ . All others are calculated normally.

### General case

In the general case, suppose a given point ${\displaystyle x_{i}}$  has k derivatives. Then the dataset ${\displaystyle z_{0},z_{1},\ldots ,z_{N}}$  contains k identical copies of ${\displaystyle x_{i}}$ . When creating the table, divided differences of ${\displaystyle j=2,3,\ldots ,k}$  identical values will be calculated as

${\displaystyle {\frac {f^{(j)}(x_{i})}{j!}}.}$

For example,

${\displaystyle f[x_{i},x_{i},x_{i}]={\frac {f''(x_{i})}{2}}}$
${\displaystyle f[x_{i},x_{i},x_{i},x_{i}]={\frac {f^{(3)}(x_{i})}{6}}}$

etc.

### Example

Consider the function ${\displaystyle f(x)=x^{8}+1}$ . Evaluating the function and its first two derivatives at ${\displaystyle x\in \{-1,0,1\}}$ , we obtain the following data:

x ƒ(x) ƒ'(x) ƒ''(x)
−1 2 −8 56
0 1 0 0
1 2 8 56

Since we have two derivatives to work with, we construct the set ${\displaystyle \{z_{i}\}=\{-1,-1,-1,0,0,0,1,1,1\}}$ . Our divided difference table is then:

${\displaystyle {\begin{array}{llcclrrrrr}z_{0}=-1&f[z_{0}]=2&&&&&&&&\\&&{\frac {f'(z_{0})}{1}}=-8&&&&&&&\\z_{1}=-1&f[z_{1}]=2&&{\frac {f''(z_{1})}{2}}=28&&&&&&\\&&{\frac {f'(z_{1})}{1}}=-8&&f[z_{3},z_{2},z_{1},z_{0}]=-21&&&&&\\z_{2}=-1&f[z_{2}]=2&&f[z_{3},z_{2},z_{1}]=7&&15&&&&\\&&f[z_{3},z_{2}]=-1&&f[z_{4},z_{3},z_{2},z_{1}]=-6&&-10&&&\\z_{3}=0&f[z_{3}]=1&&f[z_{4},z_{3},z_{2}]=1&&5&&4&&\\&&{\frac {f'(z_{3})}{1}}=0&&f[z_{5},z_{4},z_{3},z_{2}]=-1&&-2&&-1&\\z_{4}=0&f[z_{4}]=1&&{\frac {f''(z_{4})}{2}}=0&&1&&2&&1\\&&{\frac {f'(z_{4})}{1}}=0&&f[z_{6},z_{5},z_{4},z_{3}]=1&&2&&1&\\z_{5}=0&f[z_{5}]=1&&f[z_{6},z_{5},z_{4}]=1&&5&&4&&\\&&f[z_{6},z_{5}]=1&&f[z_{7},z_{6},z_{5},z_{4}]=6&&10&&&\\z_{6}=1&f[z_{6}]=2&&f[z_{7},z_{6},z_{5}]=7&&15&&&&\\&&{\frac {f'(z_{6})}{1}}=8&&f[z_{8},z_{7},z_{6},z_{5}]=21&&&&&\\z_{7}=1&f[z_{7}]=2&&{\frac {f''(z_{7})}{2}}=28&&&&&&\\&&{\frac {f'(z_{7})}{1}}=8&&&&&&&\\z_{8}=1&f[z_{8}]=2&&&&&&&&\\\end{array}}}$

and the generated polynomial is

{\displaystyle {\begin{aligned}P(x)&=2-8(x+1)+28(x+1)^{2}-21(x+1)^{3}+15x(x+1)^{3}-10x^{2}(x+1)^{3}\\&\quad {}+4x^{3}(x+1)^{3}-1x^{3}(x+1)^{3}(x-1)+x^{3}(x+1)^{3}(x-1)^{2}\\&=2-8+28-21-8x+56x-63x+15x+28x^{2}-63x^{2}+45x^{2}-10x^{2}-21x^{3}\\&\quad {}+45x^{3}-30x^{3}+4x^{3}+x^{3}+x^{3}+15x^{4}-30x^{4}+12x^{4}+2x^{4}+x^{4}\\&\quad {}-10x^{5}+12x^{5}-2x^{5}+4x^{5}-2x^{5}-2x^{5}-x^{6}+x^{6}-x^{7}+x^{7}+x^{8}\\&=x^{8}+1.\end{aligned}}}

by taking the coefficients from the diagonal of the divided difference table, and multiplying the kth coefficient by ${\displaystyle \prod _{i=0}^{k-1}(x-z_{i})}$ , as we would when generating a Newton polynomial.

#### Quintic Hermite interpolation

The quintic Hermite interpolation based on the function (${\displaystyle f}$ ), its first (${\displaystyle f'}$ ) and second derivatives (${\displaystyle f''}$ ) at two different points (${\displaystyle x_{0}}$  and ${\displaystyle x_{1}}$ ) can be used for example to interpolate the position of an object based on its position, velocity and acceleration. The general form is given by

{\displaystyle {\begin{aligned}p(x)&=f(x_{0})+f'(x_{0})(x-x_{0})+{\frac {1}{2}}f''(x_{0})(x-x_{0})^{2}+{\frac {f(x_{1})-f(x_{0})-f'(x_{0})(x_{1}-x_{0})-{\frac {1}{2}}f''(x_{0})(x_{1}-x_{0})^{2}}{(x_{1}-x_{0})^{3}}}(x-x_{0})^{3}\\&+{\frac {3f(x_{0})-3f(x_{1})+\left(2f'(x_{0})+f'(x_{1})\right)(x_{1}-x_{0})+{\frac {1}{2}}f''(x_{0})(x_{1}-x_{0})^{2}}{(x_{1}-x_{0})^{4}}}(x-x_{0})^{3}(x-x_{1})\\&+{\frac {6f(x_{1})-6f(x_{0})-3\left(f'(x_{0})+f'(x_{1})\right)(x_{1}-x_{0})+{\frac {1}{2}}\left(f''(x_{1})-f''(x_{0})\right)(x_{1}-x_{0})^{2}}{(x_{1}-x_{0})^{5}}}(x-x_{0})^{3}(x-x_{1})^{2}.\end{aligned}}}

## Error

Call the calculated polynomial H and original function f. Evaluating a point ${\displaystyle x\in [x_{0},x_{n}]}$ , the error function is

${\displaystyle f(x)-H(x)={\frac {f^{(K)}(c)}{K!}}\prod _{i}(x-x_{i})^{k_{i}},}$

where c is an unknown within the range ${\displaystyle [x_{0},x_{N}]}$ , K is the total number of data-points, and ${\displaystyle k_{i}}$  is the number of derivatives known at each ${\displaystyle x_{i}}$  plus one.