COMPUTER PROBLEMS 3.2

\(\def\ds{\displaystyle} \) 1 (a) Using newtdd.py to generate the coefficients of the interpolating polynomial results in \begin{align*} P_4(x)&= 1.433329+1.989870(x-0.6)+3.258900(x-0.6)(x-0.7)\\ &\quad + 3.680667(x-0.6)(x-0.7)(x-0.8)\\ &\quad + 4.000417(x-0.6)(x-0.7)(x-0.8)(x-0.9), \end{align*} or in nested form,

\( P_4(x)= 1.433329+(x-0.6)(1.989870+(x-0.7)(3.258900 +(x-0.8)(3.680667 +(x-0.9)4.000417))). \)

1 (b) Substitute into \(P_4(x)\) to get \(P_4(0.82)=1.958910\) and \(P_4(0.98) = 2.612848\).

1 (c) According to Theorem 3.3, the interpolation error satisfies \[|e^{x^2}-P_4(x)| = \frac{|(x-0.6)(x-0.7)(x-0.8)(x-0.9)(x-1)|}{5!}|f^{(v)}(c)| \] where \[f^{(v)}(x) = (32x^5+160x^3+120x)e^{x^2}.\] For \(c\leq 1\), an upper bound for \(f^{(v)}(c)\) is \[|f^{(v)}(c)|\leq (32+160+120)e^1 = 312e\approx 848.1.\] Substituting into the error formula gives the error bounds \[|e^{(0.82)^2}-P_4(0.82)|\leq 0.0000537\] and \[|e^{(0.98)^2}-P_4(0.98)|\leq 0.000217.\] The actual errors, using the results of part (b), are \[|e^{(0.82)^2}-P_4(0.82)|\approx 0.0000234\] and \[|e^{(0.98)^2}-P_4(0.98)|\approx 0.000107.\]

1 (d) The actual interpolation error is plotted below for the intervals \([0.5, 1]\) (left) and \([0,2]\) (right).



3 The degree 9 interpolating polynomial from Newton's divided differences, written in nested form, is \begin{align*} P_9(x)&= 91.69 + (x-2015)(0.3700+(x-2016)(0.0065\\ & +(x-2017)(0.3067+(x-2018)(-0.2583+ (x-2019)(0.0558\\ & + (x-2020)(0.01443+ (x-2021)(-0.01261\\ &\quad +(x-2022)(0.004244+(x-2023)(-0.0009451))))))))) \end{align*} and is plotted below.


Substituting \(x=2025\) gives \(P_9(2025)\approx -462.66 million barrels, which is mathematically correct but nonsensical, and not consistent with the data shown. This is a typical example of the Runge phenomenon, which prevents the degree-9 interpolating polynomial from being a usable model for extrapolating this data.