So far we have developed approximation methods which make use of function values only. Sometimes, the derivative information may also be available. Methods which make use of derivatives also to construct the approximation are known are Hermite approximations. Here we will look at interpolating given function and derivative information.
Example 1 (Cubic hermite interpolation)
Given f ( a ) f(a) f ( a ) , f ′ ( a ) f'(a) f ′ ( a ) , f ( b ) f(b) f ( b ) , f ′ ( b ) f'(b) f ′ ( b ) , we can try to construct a cubic polynomial p ( x ) p(x) p ( x ) so that
p ( a ) = f ( a ) , p ′ ( a ) = f ′ ( a ) p ( b ) = f ( b ) , p ′ ( b ) = f ′ ( b ) \begin{aligned}
p(a) = f(a), \quad p'(a) = f'(a) \\
p(b) = f(b), \quad p'(b) = f'(b)
\end{aligned} p ( a ) = f ( a ) , p ′ ( a ) = f ′ ( a ) p ( b ) = f ( b ) , p ′ ( b ) = f ′ ( b ) The polynomial satisfying the above conditions is
H 2 ( x ) = [ 1 + 2 x − a b − a ] [ b − x b − a ] 2 f ( a ) + [ 1 + 2 b − x b − a ] [ x − a b − a ] 2 f ( b ) + ( x − a ) ( x − b ) 2 ( b − a ) 2 f ′ ( a ) − ( x − a ) 2 ( b − x ) ( b − a ) 2 f ′ ( b ) \begin{aligned}
H_2(x) = & \left[1 + 2\frac{x-a}{b-a}\right] \left[ \frac{b-x}{b-a} \right]^2 f(a)
+ \left[ 1 + 2\frac{b-x}{b-a}\right] \left[\frac{x-a}{b-a}\right]^2 f(b) \\
& + \frac{(x-a)(x-b)^2}{(b-a)^2} f'(a) - \frac{(x-a)^2 (b-x)}{(b-a)^2} f'(b)
\end{aligned} H 2 ( x ) = [ 1 + 2 b − a x − a ] [ b − a b − x ] 2 f ( a ) + [ 1 + 2 b − a b − x ] [ b − a x − a ] 2 f ( b ) + ( b − a ) 2 ( x − a ) ( x − b ) 2 f ′ ( a ) − ( b − a ) 2 ( x − a ) 2 ( b − x ) f ′ ( b ) This is analogous to a Lagrange interpolation with some set of basis functions which are multiplying the given data.
We can write the Hermite interpolation in terms of Newton form
H 2 ( x ) = f ( a ) + ( x − a ) f [ a , a ] + ( x − a ) 2 f [ a , a , b ] + ( x − a ) 2 ( x − b ) f [ a , a , b , b ] H_2(x) = f(a) + (x-a)f[a,a] + (x-a)^2 f[a,a,b] + (x-a)^2 (x-b) f[a,a,b,b] H 2 ( x ) = f ( a ) + ( x − a ) f [ a , a ] + ( x − a ) 2 f [ a , a , b ] + ( x − a ) 2 ( x − b ) f [ a , a , b , b ] where the divided differences are given by
f [ a , a ] = lim t → a f [ t , a ] = lim t → a f ( t ) − f ( a ) t − a = f ′ ( a ) f[a,a] = \lim_{t \to a} f[t,a] = \lim_{t \to a} \frac{f(t) - f(a)}{t-a} = f'(a) f [ a , a ] = t → a lim f [ t , a ] = t → a lim t − a f ( t ) − f ( a ) = f ′ ( a ) f [ a , a , b ] = f [ a , b ] − f [ a , a ] b − a = f [ a , b ] − f ′ ( a ) b − a f[a,a,b] = \frac{f[a,b] - f[a,a]}{b-a} = \frac{f[a,b] - f'(a)}{b-a} f [ a , a , b ] = b − a f [ a , b ] − f [ a , a ] = b − a f [ a , b ] − f ′ ( a ) f [ a , a , b , b ] = f [ a , b , b ] − f [ a , a , b ] b − a = f [ a , b ] − f ′ ( b ) a − b − f [ a , b ] − f ′ ( a ) b − a b − a = f ′ ( b ) − 2 f [ a , b ] + f ′ ( a ) ( b − a ) 2 \begin{align*}
f[a,a,b,b] &= \frac{f[a,b,b] - f[a,a,b]}{b-a} = \frac{\frac{f[a,b] - f'(b)}{a-b} - \frac{f[a,b]
- f'(a)}{b-a}}{b-a} \\
&= \frac{f'(b) - 2f[a,b] + f'(a)}{(b-a)^2}
\end{align*} f [ a , a , b , b ] = b − a f [ a , b , b ] − f [ a , a , b ] = b − a a − b f [ a , b ] − f ′ ( b ) − b − a f [ a , b ] − f ′ ( a ) = ( b − a ) 2 f ′ ( b ) − 2 f [ a , b ] + f ′ ( a ) It is easy to see that H 2 ( a ) = f ( a ) H_2(a) = f(a) H 2 ( a ) = f ( a ) and
H 2 ( b ) = f ( a ) + ( b − a ) f ′ ( a ) + ( b − a ) 2 f [ a , b ] − f ′ ( a ) b − a = f ( a ) + ( b − a ) f [ a , b ] = f ( b ) \begin{align*}
H_2(b) &= f(a) + (b-a)f'(a) + (b-a)^2 \frac{f[a,b] - f'(a)}{b-a} \\
&= f(a) + (b-a)f[a,b] \\
&= f(b)
\end{align*} H 2 ( b ) = f ( a ) + ( b − a ) f ′ ( a ) + ( b − a ) 2 b − a f [ a , b ] − f ′ ( a ) = f ( a ) + ( b − a ) f [ a , b ] = f ( b ) Moreover
H 2 ′ ( x ) = f [ a , a ] + 2 ( x − a ) f [ a , a , b ] + { 2 ( x − a ) ( x − b ) + ( x − a ) 2 } f [ a , a , b , b , ] H_2'(x) = f[a,a] + 2(x-a)f[a,a,b] + \{ 2(x-a)(x-b) + (x-a)^2 \} f[a,a,b,b,] H 2 ′ ( x ) = f [ a , a ] + 2 ( x − a ) f [ a , a , b ] + { 2 ( x − a ) ( x − b ) + ( x − a ) 2 } f [ a , a , b , b , ] so that H 2 ′ ( a ) = f [ a , a ] = f ′ ( a ) H_2'(a) = f[a,a] = f'(a) H 2 ′ ( a ) = f [ a , a ] = f ′ ( a ) and
H 2 ′ ( b ) = f [ a , a ] + 2 ( b − a ) f [ a , a , b ] + ( b − a ) 2 f [ a , a , b , b ] = f ′ ( a ) + 2 { f [ a , b ] − f ′ ( a ) } + { f ′ ( b ) − 2 f [ a , b ] + f ′ ( a ) } = f ′ ( b ) \begin{aligned}
H_2'(b) &= f[a,a] + 2(b-a)f[a,a,b] + (b-a)^2 f[a,a,b,b] \\
&= f'(a) + 2\{ f[a,b] - f'(a) \} + \{ f'(b) - 2f[a,b] + f'(a) \} \\
&= f'(b)
\end{aligned} H 2 ′ ( b ) = f [ a , a ] + 2 ( b − a ) f [ a , a , b ] + ( b − a ) 2 f [ a , a , b , b ] = f ′ ( a ) + 2 { f [ a , b ] − f ′ ( a )} + { f ′ ( b ) − 2 f [ a , b ] + f ′ ( a )} = f ′ ( b ) Given ( x i , y i , y i ′ ) (x_i,y_i,y_i') ( x i , y i , y i ′ ) , i = 0 , 1 , 2 , … , N i=0,1,2,\ldots,N i = 0 , 1 , 2 , … , N , find a polynomial p ( x ) p(x) p ( x )
such that
p ( x i ) = y i = f ( x i ) , p ′ ( x i ) = y i ′ = f ′ ( x i ) , i = 0 , 1 , 2 , … , N p(x_i) = y_i = f(x_i), \qquad p'(x_i) = y_i' = f'(x_i), \qquad i=0,1,2,\ldots,N p ( x i ) = y i = f ( x i ) , p ′ ( x i ) = y i ′ = f ′ ( x i ) , i = 0 , 1 , 2 , … , N There are 2 N + 2 2N+2 2 N + 2 conditions given so we can try to find a polynomial of
degree 2 N + 1 2N+1 2 N + 1 that interpolates the given data. Define
ℓ ( x ) = ( x − x 0 ) … ( x − x N ) \ell(x) = (x-x_0)\ldots(x-x_N) ℓ ( x ) = ( x − x 0 ) … ( x − x N ) then the Lagrange polynomials are
ℓ i ( x ) = ∏ j = 0 , j ≠ i N x − x j x i − x j = ℓ ( x ) ( x − x i ) ℓ ′ ( x i ) \ell_i(x) = \prod_{j=0, j \ne i}^N \frac{x-x_j}{x_i - x_j} = \frac{\ell(x)}{(x-x_i)
\ell'(x_i)} ℓ i ( x ) = j = 0 , j = i ∏ N x i − x j x − x j = ( x − x i ) ℓ ′ ( x i ) ℓ ( x ) Define
r i ( x ) = [ 1 − 2 ℓ i ′ ( x i ) ( x − x i ) ] [ ℓ i ( x ) ] 2 s i ( x ) = ( x − x i ) [ ℓ i ( x ) ] 2 \begin{aligned}
r_i(x) &=& [1 - 2\ell_i'(x_i)(x-x_i)][\ell_i(x)]^2\\
s_i(x) &=& (x-x_i) [\ell_i(x)]^2
\end{aligned} r i ( x ) s i ( x ) = = [ 1 − 2 ℓ i ′ ( x i ) ( x − x i )] [ ℓ i ( x ) ] 2 ( x − x i ) [ ℓ i ( x ) ] 2 Since ℓ i ∈ P N \ell_i \in \poly_N ℓ i ∈ P N both r i r_i r i , s i s_i s i are in
P 2 N + 1 \poly_{2N+1} P 2 N + 1 . Since ℓ i ( x j ) = δ i j \ell_i(x_j) =
\delta_{ij} ℓ i ( x j ) = δ ij , we have
r i ( x j ) = δ i j , s i ( x j ) = 0 r_i(x_j) = \delta_{ij}, \qquad s_i(x_j) = 0 r i ( x j ) = δ ij , s i ( x j ) = 0 r i ′ ( x j ) = 0 , s i ′ ( x j ) = δ i j r_i'(x_j) = 0, \qquad s_i'(x_j) = \delta_{ij} r i ′ ( x j ) = 0 , s i ′ ( x j ) = δ ij Then the interpolating
polynomial is given by
H N ( x ) = ∑ i = 0 N y i r i ( x ) + ∑ i = 0 N y i ′ s i ( x ) H_N(x) = \sum_{i=0}^N y_i r_i(x) + \sum_{i=0}^N y_i' s_i(x) H N ( x ) = i = 0 ∑ N y i r i ( x ) + i = 0 ∑ N y i ′ s i ( x ) 1.1 Uniqueness ¶ Suppose there are two polynomials H ( x ) H(x) H ( x ) , G ( x ) G(x) G ( x ) of degree ≤ 2 N + 1 \le 2N+1 ≤ 2 N + 1
that interpolate the same set of data. Then define
R ( x ) = H ( x ) − G ( x ) R(x) = H(x) - G(x) R ( x ) = H ( x ) − G ( x ) which has degree ≤ 2 N + 1 \le 2N+1 ≤ 2 N + 1 and
R ( x i ) = R ′ ( x i ) = 0 , i = 0 , 1 , … , N R(x_i) = R'(x_i) = 0, \qquad i=0,1,\ldots,N R ( x i ) = R ′ ( x i ) = 0 , i = 0 , 1 , … , N Thus R ( x ) R(x) R ( x ) has N + 1 N+1 N + 1
double roots so that, and hence atleast 2 N + 2 2N+2 2 N + 2 roots, which implies that
R ( x ) ≡ 0 R(x) \equiv 0 R ( x ) ≡ 0 .
The polynomial interpolating f ( x ) f(x) f ( x ) at nodes z 0 , … , z 2 N + 1 z_0,\ldots,z_{2N+1} z 0 , … , z 2 N + 1 is
p 2 N + 1 ( x ) = f ( z 0 ) + ( x − z 0 ) f [ z 0 , z 1 ] + … + ( x − z 0 ) … ( x − z 2 N ) f [ z 0 , … , z 2 N + 1 ] p_{2N+1}(x) = f(z_0) + (x-z_0)f[z_0,z_1] + \ldots + (x-z_0)\ldots(x-
z_{2N})f[z_0,\ldots,z_{2N+1}] p 2 N + 1 ( x ) = f ( z 0 ) + ( x − z 0 ) f [ z 0 , z 1 ] + … + ( x − z 0 ) … ( x − z 2 N ) f [ z 0 , … , z 2 N + 1 ] with error formula
f ( x ) − p 2 N + 1 ( x ) = ( x − z 0 ) … ( x − z 2 N ) ( x − z 2 N + 1 ) f [ z 0 , … , z 2 N + 1 , x ] f(x) - p_{2N+1}(x) = (x-z_0)\ldots(x-z_{2N})(x-z_{2N+1})f[z_0,\ldots,z_{2N+1},x] f ( x ) − p 2 N + 1 ( x ) = ( x − z 0 ) … ( x − z 2 N ) ( x − z 2 N + 1 ) f [ z 0 , … , z 2 N + 1 , x ] We can let the nodes coincide and Newtons formula will still make sense.
z 0 , z 1 → x 0 z 2 , z 3 → x 1 ⋮ z 2 N , z 2 N + 1 → x N \begin{aligned}
z_0, z_1 \to x_0 \\
z_2, z_3 \to x_1 \\
\vdots \\
z_{2N}, z_{2N+1} \to x_N
\end{aligned} z 0 , z 1 → x 0 z 2 , z 3 → x 1 ⋮ z 2 N , z 2 N + 1 → x N which gives
p 2 N + 1 ( x ) = f ( x 0 ) + ( x − x 0 ) f [ x 0 , x 0 ] + ( x − x 0 ) 2 f [ x 0 , x 0 , x 1 ] + … + ( x − x 0 ) 2 … ( x − x N − 1 ) 2 ( x − x N ) f [ x 0 , x 0 , … , x N , x N ] \begin{aligned}
p_{2N+1}(x) = & f(x_0) + (x-x_0)f[x_0,x_0] + (x-x_0)^2 f[x_0,x_0,x_1] + \ldots \\
& + (x-x_0)^2 \ldots(x-x_{N-1})^2 (x-x_N) f[x_0,x_0,\ldots,x_N,x_N]
\end{aligned} p 2 N + 1 ( x ) = f ( x 0 ) + ( x − x 0 ) f [ x 0 , x 0 ] + ( x − x 0 ) 2 f [ x 0 , x 0 , x 1 ] + … + ( x − x 0 ) 2 … ( x − x N − 1 ) 2 ( x − x N ) f [ x 0 , x 0 , … , x N , x N ] This is a polynomial of degree ≤ 2 N + 1 \le 2N+1 ≤ 2 N + 1 with error
formula
f ( x ) − p 2 N + 1 ( x ) = ( x − x 0 ) 2 … ( x − x N ) 2 f [ x 0 , x 0 , … , x N , x N , x ] f(x) - p_{2N+1}(x) = (x-x_0)^2 \ldots (x-x_N)^2 f[x_0,x_0,\ldots,x_N,x_N,x] f ( x ) − p 2 N + 1 ( x ) = ( x − x 0 ) 2 … ( x − x N ) 2 f [ x 0 , x 0 , … , x N , x N , x ] 2.1 Claim: p 2 N + 1 = H N p_{2N+1} = H_N p 2 N + 1 = H N ¶ Assume that f ∈ C 2 N + 3 f \in \cts^{2N+3} f ∈ C 2 N + 3 . Due to the Newton form, we have
p 2 N + 1 ( x i ) = f ( x i ) , i = 0 , 1 , … , N p_{2N+1}(x_i) = f(x_i), \qquad i=0,1,\ldots,N p 2 N + 1 ( x i ) = f ( x i ) , i = 0 , 1 , … , N Differentiating the
error formula
f ′ ( x ) − p 2 N + 1 ′ ( x ) = ( x − x 0 ) 2 … ( x − x N ) 2 d d x f [ x 0 , x 0 , … , x N , x N , x ] + f [ x 0 , x 0 , … , x N , x N , x ] d d x [ ( x − x 0 ) 2 … ( x − x N ) 2 ] = ( x − x 0 ) 2 … ( x − x N ) 2 f [ x 0 , x 0 , … , x N , x N , x , x ] + 2 f [ x 0 , x 0 , … , x N , x N , x ] ∑ i = 0 N ( x − x i ) ∏ j = 0 , j ≠ i N ( x − x j ) 2 \begin{aligned}
f'(x) - p_{2N+1}'(x) = \ & (x-x_0)^2 \ldots (x-x_N)^2 \dd{}{x}
f[x_0,x_0,\ldots,x_N,x_N,x] \\
& + f[x_0,x_0,\ldots,x_N,x_N,x] \dd{}{x} [(x-x_0)^2 \ldots (x-x_N)^2] \\
= \ & (x-x_0)^2 \ldots (x-x_N)^2 f[x_0,x_0,\ldots,x_N,x_N,x,x] \\
& + 2 f[x_0,x_0,\ldots,x_N,x_N,x] \sum_{i=0}^N (x-x_i) \prod_{j=0,j \ne i}^N(x-
x_j)^2
\end{aligned} f ′ ( x ) − p 2 N + 1 ′ ( x ) = = ( x − x 0 ) 2 … ( x − x N ) 2 d x d f [ x 0 , x 0 , … , x N , x N , x ] + f [ x 0 , x 0 , … , x N , x N , x ] d x d [( x − x 0 ) 2 … ( x − x N ) 2 ] ( x − x 0 ) 2 … ( x − x N ) 2 f [ x 0 , x 0 , … , x N , x N , x , x ] + 2 f [ x 0 , x 0 , … , x N , x N , x ] i = 0 ∑ N ( x − x i ) j = 0 , j = i ∏ N ( x − x j ) 2 we see that
f ′ ( x i ) − p 2 N + 1 ′ ( x i ) = 0 , i = 0 , 1 , … , N f'(x_i) - p_{2N+1}'(x_i) = 0, \qquad i=0,1,\ldots,N f ′ ( x i ) − p 2 N + 1 ′ ( x i ) = 0 , i = 0 , 1 , … , N We have degree
p 2 N + 1 ≤ 2 N + 1 p_{2N+1} \le 2N+1 p 2 N + 1 ≤ 2 N + 1 and it satisfies the given data { x i , y i , y i ′ } \{x_i,y_i,y_i'\} { x i , y i , y i ′ } ,
i = 0 , 1 , … , N i=0,1,\ldots,N i = 0 , 1 , … , N . By uniqueness of the Hermite interpolating polynomial,
we have p 2 N + 1 = H N p_{2N+1} = H_N p 2 N + 1 = H N .