# Interpolation of polynomials

let $f(x)=2^x$ and $x_0=1$, $x_1=2$, $x_2=3$. Use divided differences to compute the interpolation polynomial $P(x)$ satisfying $P(x_i)=f(x_i)$, i=0,1,2 and $P'(x_1)=f'(x_1)$ and estimate error |f(2.5)-p(2.5)| and the maxiaml error $max_{x\in [1,3]}$ $|f(x)-P(x)|$. So far I have form using the $P(x)=f(x_0)+(x-x_0) f[x_0,x_0]+(x-x_1)^2 f[x_1,x_1,x_2]+(x-x_1)^2 (x-x_2)^2 (x-x_3) f[x_1,x_1,x_2,x_2,x_3,x_3]$.

Is this the right P so that $P(x_i)=f(x_i)$, i=0,1,2 and $P'(x_1)=f'(x_1)$

We are given:

$$f(x) = 2^x, x_0 = 1, x_1 = 2, x_2 = 3$$

We are asked to use divided differences to find the polynomial $P(x)$.

The divided difference table is given by:

$$\begin{array}{c|ccc} x_i & f(x_i) & \text{1st-DD} & \text{2nd-DD} \\ \hline 1 & f(x_0) \\ & & f[x_0,x_1]\\ 2 & f(x_1) & & f[x_0,x_1,x_2]\\ & & f[x_1,x_2]\\ 3 & f(x_2) \end{array}$$

Filling in these values yields:

$$\begin{array}{c|ccc} x_i & f(x_i) & \text{1st-DD} & \text{2nd-DD} \\ \hline 1 & 2 \\ & & 2\\ 2 & 4 & & 1\\ & & 4\\ 3 & 8 \end{array}$$

$P(x)$ is now given by:

\begin{align}P(x) &= f(x_0) + f[x_0, x_1] (x - x_0)+ f[x_0,x_1,x_2](x-x_0)(x-x_1) \\ &= 2 + 2(x-1) + 1(x-1)(x-2) \\ &= x^2 - x + 2 \end{align}

Next, we need to account for the derivative term.

We will write $q(x) = (x-1)(x-2)(x-3)$ and need to find $w(x) = p(x) + a q(x)$ such that $w'(2) = f'(2) = 4 \ln 2$,

We have:

$$3 - a = 4 \ln 2 \implies a = 3 - 4 \ln 2$$

Hence:

$$P(x) = x^2 - x + 2 +(3 - 4 \ln 2)(x-1)(x-2)(x-3)$$

Note: $$P(1) = 2, P(2) = 4, P'(2) = 4 \ln 2, P(3) = 8$$

• the polynomial $P(x)$ should also satisfy $P'(x_1)=f'(x_1)$. @Amzoti – Black Dexter Dec 13 '14 at 16:02
• So how would compute the max error $max_{x\in[1,3]}|f(x)-P(x)|$ – Black Dexter Dec 14 '14 at 0:07