Numerical differentiation of a continuous function can be determined by using the Taylor series. The forward Taylor series expansion of function
(Eq.1)
The backward Taylor series expansion of function
(Eq. 2) he forward difference approximation of the first derivative of the functionf(x) can be obtained from Eq. 1.
The backward difference approximation of the first derivative of the function Subtracting Eq.1 from Eq.2, the centered difference approximation of the first derivative of the function
The second derivative of the function f(x) can be found by adding Eq.1 to Eq. 2:
Using the Taylor series, the higher order derivative of the function (Source Code in C++) |