3. Numerical Derivative#
When we study physics, we often investigate the change of certain quantities. That is why basic calculus plays a major role in physics. Evaluating the derivative of a function \(f(x)\) is an ubiquitous operation in physics. However, an analytical expression of the derivative is not always available. Then, a numerical method must be deployed to evaluate it. That is not only the reason we need numerical derivative. In some cases an analytical expression of the function itself is not available. For example, when a function is experimentally obtained by measurement, it is given as a set of numerical data, \((x_i, f_i),\, i=1, \cdots, N\). Then, analysis of such data is always numerical. There are many algorithms for numerical derivative. In this chapter, we study some of well-known algorithms useful for studying physics.
Numerical methods are in general not exact and involve systematic errors. Understanding the source of errors and their magnitude is very important. It is possible to estimate the magnitude of expected errors based on mathematical analysis and the study of numerical error is an important part of numerical analysis. We will investigate the degrees of errors through theory and examples.
In this section, we assume that an analytical expression of function \(f(x)\) is given and that we can numerically evaluate it at any point \(x\). Furthermore, we assume that the numerical error in the evaluation of the function is negligibly small. In other words, the main errors arises from the numerical algorithm of derivative.