Numerical differentiation: Central difference formulas for higher derivatives
Difference formulas for higher derivatives
In the same way as we derived central difference formulas for the first and second derivatives, we can also find difference formulas for the third and fourth derivatives of a 'neat' function \(f(x)\). Now we always need five points; for example, \[f'''(x_0)\approx\frac{f(x_0+2h)-2f(x_0+h)+2f(x_0-h)-f(x_0-2h)}{2h^3}\]
The table below summarises the central difference formulas in terms of the coefficients that can be used in a linear filter to calculate the derivative.
\[\begin{array}{|c|c|c|c|c|c|} \hline & f(x_0-2h) & f(x_0-h) & f(x_0) & f(x_0+h) & f(x_0+2h)\\ \hline 2hf'(x_0) & & -1 & 0 & 1 & \\ \hline h^2f''(x_0) & & 1 & -2 & 1 & \\ \hline 2h^3f'''(x_0) & -1 & 2 & 0 & -2 & 1\\ \hline h^4f''''(x) & 1 & -4 & 6 & -4 & 1 \\ \hline \end{array}\]