Hi,

Suppose we have a grid (possibly irregular) of N function/value pairs, $(x_i, f_i)$, $i=1...N$. The function is differentiable everywhere at least twice (perhaps more).

What would be a good way to find, for example, a polynomial (or other) approximation for the derivative of the function in an interval $(x_j, x_{j+1})$, or perhaps $(x_{j-1}, x_{j+1})$, for a given $j$?

Say, cubic splines would provide the derivative, but it seems too wasteful to compute a spline approximation over all $N$ points, when all is needed is a neighborhood of just one point $j$. On the other hand, piecewise linear approximation only needs two points, but is rather imprecise, since we know that there are no jumps in the true derivative. What would be good alternatives that would need only a small number of points around $j$?