# Find the error of using an interpolating polynomial of degree 20 to approximate e^−x

An interpolating polynomial of degree 20 is to be used to approximate e−x on the interval [0, 2]. How accurate will it be? (Use 21 uniform nodes, including the endpoints of the interval. Compare results, using Theorems 1 and 2.)

The solutions from the textbook would be $4.105 × 10^−14 (Thm 1), 1.1905 × 10^−23 (Thm 2)$

First pic is thm 2 second pic is thm 1. Theorem 2 is not too hard to compute since e^-x to the 20th derivative is still e^-x so M the upper bound for that would be 1 for [0,2] interval as can be seen if plotted. Then i plug in n=20 to get the answer. How do i use the first theorem? I am confused about how to find ξ?

• You don't find $\xi$, but find the value such that $|f^{(n+1)}(x)|$ is maximal for $x \in (a,b)$, e.g. you could say $|f^{(n+1)}(\xi)|< 1$ for this example. Feb 12, 2018 at 4:44
• alright got it! what about the capital pi product part eith (x-xi)? what values can i possibly plug in for x to xn? Feb 12, 2018 at 4:50
• A bad estimate is $|\prod_{i=0}^n (x-x_i)|< 2^n$ since $x\in [0,2]$ and $x_i\in [0,2]$. Not sure if that would give you the answer though. Feb 12, 2018 at 5:02
• @jamesblack: It is looking like they got an incorrect result for Thm $1$.
– Moo
Feb 12, 2018 at 5:33

Continuing from my comments. I actually made a mistake and should have said $|\prod_{i=0}^n (x-x_i)| < 2^{n+1}$. We want to find the maximum error for $n=20$, that is,
$$|f(x)-p(x)| <\frac{1}{(20+1)!}|e^{-x}|.2^{21}= \frac{2^{21}}{21!} = 4.105 \times 10^{-14}$$
• That certainly agrees with the answer, but using the theorem, one can do much better as $$4.573568175141131 \times10^{-24}$$