Skip to main content

Section 4.4 Hermite Interpolation

In the previous section, we studied polynomial interpolation in which a polynomial passes through the points \((x_{0},f_{0}), (x_{1},f_{1}),\ldots, (x_{n},f_{n})\text{.}\) In this section, we consider the polynomial also satisfies the derivative conditions \((x_{0},f'_{0})\text{,}\) \((x_{1},f'_{1})\text{,}\) \(\ldots\text{,}\) \((x_{n},f'_{n})\text{.}\) This is called Hermite Interpolation.
Consider an example in which a polynomial \(P(x)\) needs to satisfy the points \((0,0)\) and \((2,0)\) as well having a slope of 1 at \(x=0\) and a slope of \(-1\) at \(x=2\text{.}\) Visually, this is:
Figure 4.4.1.
where the lines in the plot are the tangent lines to the polynomial. This polynomial must be at most order 3 (with 4 unknowns) to satisfy the 4 conditions. A crude way to proceed would be to write:
\begin{equation*} \begin{aligned}P(x)\amp = a_{0} + a_{1}x + a_{2} x^{2} + a_{3} x^{3} \\ \text{and its derivative}\qquad\qquad \amp \\ P'(x)\amp = a_{1} + 2a_{2} x + 3a_{3} x^{2}\end{aligned} \end{equation*}
Applying \(P(0)=0\) and \(P'(0)=1\) leads to \(a_{0}=0\) and \(a_{1}=1\text{.}\) If we set \(P(2)=0\) and \(P'(2) = -1\) we get:
\begin{equation*} \begin{aligned}P(2)\amp = (2) + a_{2} (2)^{2} + a_{3} (2)^{3} \\ P'(2)\amp = 1 + 2 a_{2} (2) + 3 a_{3} (2)^{2}\end{aligned} \end{equation*}
and solve for \(a_{2}\) and \(a_{3}\) (using some linear algebra) results in \(a_{2}=-1/2\) and \(a_{3}=0\text{,}\) thus the polynomial is:
\begin{equation*} \begin{aligned}P(x)\amp = x -\frac{1}{2}x^{2}\end{aligned} \end{equation*}
In short, Hermite polynomials exist and are unique much like Lagrange polynomials. The proofs are similar to that shown in Section 4.2 however a bit more complicated in that the form of the interpolation is more complicated due to the requirement that the derivative needs to match. See Burden and Faires, Burden:2004fk for more information about this.

Subsection 4.4.1 Hermite Interpolation Implementation

The form presented above is not a simple way to find the polynomial coefficients as the degree of the polynomial gets large. Instead, we proceed in a way which closely follows that of Newton Divided Differences.
The idea behind using Newton Divided Differences in Hermite interpolation is as follows. Let \(z_{2i}=x_{i}\) and \(z_{2i+1}=x_{i}\) for \(i=0,1,\ldots, n\text{.}\) However some of the difference formulas will have the form:
\begin{equation*} \begin{aligned}f[z_{0},z_{1}]=f[x_{0},x_{0}]\amp = \frac{f[x_{0}]-f[x_{0}]}{x_{0}-x_{0}}\end{aligned} \end{equation*}
which has the form \(0/0\text{.}\) When this situation arises, let \(f[x_{i},x_{i}]=f'(x_{i})\text{.}\)
The Newton Divide Difference table for two points \(x_{0}\) and \(x_{1}\) (or the four points \(z_{0},z_{1},z_{2},z_{3}\)).
First divided Second divided
\(z\) \(f(z)\) difference difference
\(z_{0}=x_{0}\) \(f[z_{0}]=f(x_{0})\)
\(f[z_{0},z_{1}]=f[x_{0},x_{0}]=f'(x_{0})\)
\(z_{1}=x_{0}\) \(f[z_{1}]=f(x_{0})\) \(\displaystyle f[z_{0},z_{1},z_{2}] = \frac{f[z_{1},z_{2}]-f[z_{0},z_{1}]}{z_{2}-z_{0}}\)
\(\displaystyle f[z_{1},z_{2}] = \frac{f[z_{2}]-f[z_{1}]}{z_{2}-z_{1}}\)
\(z_{2} = x_{1}\) \(f[z_{2}]=f(x_{1})\) \(\displaystyle f[z_{1},z_{2},z_{3}] = \frac{f[z_{2},z_{3}]-f[z_{1},z_{2}]}{z_{3}-z_{1}}\)
\(\displaystyle f[z_{2},z_{3}] = f[x_{1},x_{1}]=f'(x_{1})\)
\(x_{3} = x_{1}\) \(f[z_{3}]=f(x_{1})\)
If additional points are needed, the divided difference table can be continued in a similar manner.

Example 4.4.2.

Use the Newton Divided Difference table to produce the Hermite Polynomial that satisfies \(P(0)=0, P(2)=0, P'(0)=1\) and \(P'(2)=-1\text{.}\)
First let \(z_{0}=z_{1}=x_{0}=0\) and \(z_{2}=z_{3}=x_{1}=2\text{.}\)
\(z\) \(f(z)\) 1st D.D. 2nd D.D. 3rd D.D.
\(0\) 0
\(\boxed{1}\)
\(0\) \(0\) \(-1/2\)
\(0\) \(0\)
\(2\) \(0\) \(1/2\)
\(\boxed{-1}\)
\(2\) \(0\)
where the two boxed values are the derivative values given in the problem.
And as we saw in Newton divided difference, we produce a polynomial based on the top diagonal elements of the table. The only difference is recall that since there are two \(z=0\) terms, there will be a \((z-0)^{2}\) term as well. The Hermite Polynomial will be:
\begin{equation*} H(z) = 0 + 1 \cdot z - \frac{1}{2}z^{2} + 0 \cdot z^{2} (z-2) \end{equation*}
or writing it back in terms of \(x\text{:}\)
\begin{equation*} H(x) = x - \frac{1}{2}x^{2} \end{equation*}
which is the same as seen above.
The next example applies this technique to finding a Hermite polynomial to \(\sin x\) on \([0,\pi]\text{.}\)

Example 4.4.3.

Find the Hermite Polynomial that satisfies both the function value and derivative of \(f(x)=\sin x\) for \(x_{0}=0, x_{1}=\pi/2\) and \(x_{2}=\pi\text{.}\)
Solution.
We will first produce a Divided Difference table:
\(z\) \(f(z)\) 1st D.D. 2nd D.D. 3rd D.D. 4th D.D. 5th D.D.
0 0
\(\boxed{1}\)
0 0 \(\dfrac{4-2\pi}{\pi^2}\)
\(2/\pi\) \(\dfrac{4\pi-16}{\pi^3}\)
\(\pi/2\) 1 \(-\dfrac{4}{\pi^2}\) \(\dfrac{16-4\pi}{\pi^4}\)
\(\boxed{0}\) 0 0
\(\pi/2\) 1 \(-\dfrac{4}{\pi^2}\) \(\dfrac{16-4\pi}{\pi^4}\)
\(-2/\pi\) \(\dfrac{16-4\pi}{\pi^3}\)
\(\pi\) 0 \(\dfrac{2\pi-4}{\pi^2}\)
\(\boxed{-1}\)
\(\pi\) 0
And then read the Hermite polynomial off the top diagonal row:
\begin{equation*} \begin{aligned}H(x)\amp = 0 + 1 \cdot x + \frac{4-2\pi}{\pi^{2}}\cdot x^{2} + \frac{4\pi-16}{\pi^{3}}\cdot x^{2} (x-\pi/2) \\\amp \qquad + \frac{16-4\pi}{\pi^{4}}\cdot x^{2} (x-\pi/2)^{2}\end{aligned} \end{equation*}
A plot both the polynomial and the sine function is:
Figure 4.4.4.
and this shows that to the visual eye, they appear the same. If we plot the absolute value of the difference:
Figure 4.4.5.
you can see that the error seems to be bounded by 0.003. There are error bounds for Hermite polynomials, however we will not cover them here.