Many known functions have exact derivatives. For example, the derivative of the natural logarithm, ln(x), is 1/x. Other functions involving discrete data points don’t have known derivatives, so they must be approximated using **numerical differentiation**. The technique is also used when analytic differentiation results in an overly complicated and cumbersome expression (Bhat & Chakraverty, 2004).

## Interpolation as a Numerical Differentiation Method

One of the easiest ways to approximate a derivative for a set of discrete points is to create an interpolation Function, which gives an estimated continuous function for the data. Once you have the estimated function (for example a polynomial function), you can then use known derivatives.

If the function is given as a table of values, a similar approach is to differentiate the Lagrange interpolation formula to get (Ralston & Rabinowitz, 2001):

## Numerical Differentiation using Differences

**Differences** are a set of tools for estimating the derivative using a set range of x-values. The basic idea is that the algorithms “move” the points so that they get closer and closer together, to look like a tangent line. Exactly how the points are moved (for example, forwards or backwards) gives rise to three common algorithms: backward differencing, forward differencing, and central differencing.

**Forward differencing**(a one-sided differencing algorithm) is based on values of the function at points x and x + h.**Backward differencing**(also one-sided)is based on values at x and x – h.**Central (or centered) differencing**is based on function values at f(x – h) and f(x + h).

While all three formulas can approximate a derivative at point x, the central difference is the most accurate (Lehigh, 2020).

Let’s say you have a table with the following values, and you want to approximate the derivative at x = 0.5 using the central difference.

Using the formula from above, you would get:

F′(x) = (0.71 – 0.25) / 0.25 = 0.92.

## References

Bhat, R. & Chakraverty, S. (2004). Numerical Analysis in Engineering. Alpha Science International.

Hoffman, J. & Frankel, S. (2001). Numerical Methods for Engineers and Scientists, Second Edition. Taylor & Francis.

Lehigh University (2020). Numerical Differentiation. Retrieved September 6, 2020 from: https://www.lehigh.edu/~ineng2/clipper/notes/NumDif.htm

Levy, D. Numerical Differentiation. Retrieved September 6, 2020 from: http://www2.math.umd.edu/~dlevy/classes/amsc466/lecture-notes/differentiation-chap.pdf

Ralston, A. & Rabinowitz, P. (2001). A First Course in Numerical Analysis. Dover Publications.

MIT: Finite Difference Approximations.