6.5 Practice Problems
Problem 6.5.1. Construct the Lagrange polynomial through \((0,1)\), \((1,3)\), \((2,7)\) and check it against the divided-difference form.
Show solution
Solution. \(P(x) = 1\cdot \frac {(x-1)(x-2)}{2}+3\cdot \frac {x(x-2)}{-1}+7\cdot \frac {x(x-1)}{2} = x^2+x+1\). The divided differences are \(f[0,1] = 2\), \(f[1,2] = 4\), \(f[0,1,2] = 1\), so \(P(x) = 1+2x+1\cdot x(x-1) = x^2+x+1\), the same polynomial.
Problem 6.5.2. Use Theorem 6.1.3 to show that the polynomial interpolating \(f(x) = \sin x\) at \(11\) equally spaced points of \([0,\pi ]\) has error less than \(10^{-7}\) throughout the interval.
Show solution
Solution. \(|f^{(11)}|\leq 1\), and with \(h = \frac {\pi }{10}\) the nodal polynomial satisfies \(\left |\prod _{i=0}^{10}(x-x_i)\right |\leq \frac {h^{11}}{4}\cdot 10!\) (the standard bound for equally spaced nodes: the factor nearest \(x\) is at most \(\frac h2\), the next at most \(h\), and so on). So the error is at most \(\frac {1}{11!}\cdot \frac {h^{11}10!}{4} = \frac {h^{11}}{44} = \frac {(0.31416)^{11}}{44} = 6.7\times 10^{-8}\).
Problem 6.5.3. Show that \(f[x_0,x_1,x_2]\) is a symmetric function of its arguments: it does not change if the nodes are permuted.
Show solution
Solution. By Theorem 6.3.1, \(f[x_0,x_1,x_2]\) is the leading coefficient of the polynomial interpolating \(f\) at \(x_0,x_1,x_2\). That polynomial is unique and does not depend on the order in which the nodes are listed, so neither does its leading coefficient. Explicitly, \(f[x_0,x_1,x_2] = \sum _{i}\frac {f(x_i)}{\prod _{j\neq i}(x_i-x_j)}\), which is visibly symmetric. The same argument applies to divided differences of any order.
Problem 6.5.4. A table of \(\ln x\) gives \(\ln 2 = 0.693147\), \(\ln 2.2 = 0.788457\), \(\ln 2.4 = 0.875469\), \(\ln 2.6 = 0.955511\). Use the backward-difference formula to estimate \(\ln 2.5\) and compare with the true value \(0.916291\).
Show solution
Solution. The backward differences at \(2.6\) are \(\nabla f = 0.080042\), \(\nabla ^2f = -0.006970\), \(\nabla ^3f = 0.001328\). With \(s = \frac {2.5-2.6}{0.2} = -0.5\), \begin {align*} P(2.5) &= 0.955511-0.5(0.080042)+\frac {(-0.5)(0.5)}{2}(-0.006970)+\frac {(-0.5)(0.5)(1.5)}{6}(0.001328)\\ &= 0.955511-0.040021+0.000871-0.000083 = 0.916278, \end {align*}
with error \(1.2\times 10^{-5}\).
Problem 6.5.5. Find the Hermite cubic with \(H(0) = 0\), \(H'(0) = 1\), \(H(1) = 1\), \(H'(1) = 0\).
Show solution
Solution. Nodes \(0,0,1,1\): \(f[0,0] = 1\), \(f[0,1] = 1\), \(f[1,1] = 0\); second differences \(f[0,0,1] = 0\), \(f[0,1,1] = -1\); third \(f[0,0,1,1] = -1\). So \(H(x) = 0+x+0\cdot x^2-1\cdot x^2(x-1) = x+x^2-x^3\). Check: \(H(1) = 1\), \(H'(x) = 1+2x-3x^2\) gives \(H'(0) = 1\) and \(H'(1) = 0\).
Questions on this section
Stuck on something here? Ask below and it stays attached to this topic.