Interpolation of $|x|$

34 Views Asked by At

Let's consider equally spaced numbers on the interval $[-1, 1]$ with $n(n \ge 5)$ partitions. I want to write Newton interpolation of absolute value function ($f(x) = |x|$) while treating those points as knots.

My work so far

We can treat those knots as: $x_i = \frac{2i}{n} - 1$ for $i = 0...n$

We know that our polynomial will be is formulated as:

$$f(x_0) + f[x_0, x_1](x - x_0) + f[x_0, x_1, x_2](x - x_0)(x -x_1) + .... + f[x_0,x_1,..,x_n](x-x_0)(x-x_1)...(x-x_{n-1})$$

Our polynomial will be specified when we will find closed form solution for $f[x_1, x_2,...,x_m]$.

$\textit{f[x_0]}:$ $$f[x_0] = f(x_0) = |0 - 1| = 1$$

$\textit{f[x_0, x_1]}:$

$$f[x_0, x_1] = \frac{f(x_1) - f(x_0)}{x_ 1 - x_0} = \frac{|\frac 2 n - 1| - 1}{\frac 2 n - 1} = \frac{1 - \frac 2 n - 1}{\frac 2 n - 1} = \frac{\frac{- 2}{n}}{\frac{2}{n} - 1} = \frac{2}{n - 2}$$

$\textit{f[x_0, x_1, x_2]}:$

$$f[x_0, x_1, x_2] = \frac{f[x_1, x_2] - f[x_0, x_1]}{x_2 - x_0} = \frac{f[x_1, x_2] - \frac{2}{n - 2}}{\frac{4}{n} - 1 - 1}$$

Let's calculate $f[x_1, x_2]$:

$$f[x_1, x_2] = \frac{f(x_2) - f(x_1)}{x_2 - x_1} = \frac{|\frac 4 n - 1| - |\frac 2 n + 1|}{\frac 4 n - 1 - \frac 2 n + 1} = - 1$$

Finally:

$$f[x_0, x_1, x_2] = \frac{-1 - \frac{2}{n - 2}}{\frac 4 n - 2}$$

So what I have is:

$$f[x_0] =1$$ $$f[x_0, x_1] = \frac{2}{n - 2}$$ $$f[x_0, x_1, x_2] = \frac{-1 - \frac{2}{n - 2}}{\frac 4 n - 2}$$

And here - for me any pattern is not visible. Could you please give me a hand in finding so?