Since the derivative is defined in terms of a limit,
a derivative can be approximated numerically just like a limit.
With the typical difference quotient,
\[ f'(x) = \lim\limits_{h \to 0} \frac{f(x\!+\!h)\!-\!f(x)}{h} \approx \frac{f(x\!+\!h)\!-\!f(x)}{h}\;\;\text{ for a small value of } h\,. \]
A symmetric difference quotient
provides a better approximation \(f'(x):\)
\[ f'(x) \approx \frac{f(x\!+\!h)\!-\!f(x\!-\!h)}{2h}\;\;\text{ for a small value of } h\,.\]
For an even better approximation to \(f'\) we need two key facts:
there is a unique polynomial of degree \(n\)
that passes through any (generic) collection of \(n\!-\!1\) points,
and the derivative of a polynomial at a point
can expressed (pre-computed) as a formula in terms of its coefficients.
For example, for each \(x\) in the domain of \(f,\)
the nine-point stencil around \(\bigl(x,f(x)\bigr),\)