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$?



Approximating derivatives between gridpoints
CJC Kruger has a paper on "constrained cubic splines" which only use the nearby points, [(pdf)](https://pages.uoregon.edu/dgavin/software/spline.pdf), it may be of interest.


