Open Educational Resources

Numerical Differentiation: High-Accuracy Numerical Differentiation Formulas

High-Accuracy Numerical Differentiation Formulas

The formulas presented in the previous sections for the forward and backward finite difference have an error term of \mathcal O (h) while those for the centred finite difference scheme have an error term of \mathcal O (h^2). It is possible to provide formulas with less error by utilizing more terms in the Taylor approximation. In essence, by increasing the number of terms in the Taylor series approximation, we assume a higher-order polynomial for the approximation which increases the accuracy of the derivatives. In the following presentation, the function f is assumed to be smooth and the points are equidistant with a step size of h.

Forward Finite Difference

According to Taylor theorem, we have:

    \[f(x_{i+1})=f(x_i)+f'(x_i) h+\frac{f''(x_i)}{2!}h^2+\mathcal O (h^3)\\\]

Using the forward finite difference equation (Equation 3) for f''(x_i) yields:

    \[f'(x_i) h=f(x_{i+1})-f(x_i)-\frac{f(x_{i+2})-2f(x_{i+1})+f(x_i)}{2}+\mathcal{O} (h^3)\\\]


Therefore:

    \[f'(x_i)=\frac{-f(x_{i+2})+4f(x_{i+1})-3f(x_{i})}{2h}+\mathcal O (h^2)\\\]

In comparison with Equation 1, this equation provides an error term that is directly proportional to the square of the step size indicating higher accuracy.

Using the same procedure, the following equations can be obtained for the second, third, and fourth derivatives:

    \[\begin{split}f''(x_{i})&=\frac{-f(x_{i+3})+4f(x_{i+2})-5f(x_{i+1})+2f(x_{i})}{h^2}+\mathcal O (h^2)\\f'''(x_{i})&=\frac{-3f(x_{i+4})+14f(x_{i+3})-24f(x_{i+2})+18f(x_{i+1})-5f(x_{i})}{2h^3}+\mathcal O (h^2)\\f''''(x_{i})&=\frac{-2f(x_{i+5})+11f(x_{i+4})-24f(x_{i+3})+26f(x_{i+2})-14f(x_{i+1})+3f(x_{i})}{h^4}+\mathcal O (h^2)\end{split}\]

Backward Finite Difference

According to Taylor theorem, we have:

    \[f(x_{i-1})=f(x_i)-f'(x_i) h+\frac{f''(x_i)}{2!}h^2+\mathcal O (h^3)\\\]

Using the backward finite difference equation (Equation 4) for f''(x_i) yields:

    \[f'(x_i) h=-f(x_{i-1})+f(x_i)+\frac{f(x_{i})-2f(x_{i-1})+f(x_{i-2})}{2}+\mathcal O (h^3)\\\]


Therefore:

    \[f'(x_i)=\frac{3f(x_{i})-4f(x_{i-1})+f(x_{i-2})}{2h}+\mathcal O (h^2)\\\]

In comparison with Equation 2, this equation provides an error term that is directly proportional to the square of the step size indicating higher accuracy.
Using the same procedure, the following equations can be obtained for the second, third, and fourth derivatives:

    \[\begin{split}f''(x_{i})&=\frac{2f(x_{i})-5f(x_{i-1})+4f(x_{i-2})-f(x_{i-3})}{h^2}+\mathcal O (h^2)\\f'''(x_{i})&=\frac{5f(x_{i})-18f(x_{i-1})+24f(x_{i-2})-14f(x_{i-3})+3f(x_{i-4})}{2h^3}+\mathcal O (h^2)\\f''''(x_{i})&=\frac{3f(x_{i})-14f(x_{i-1})+26f(x_{i-2})-24f(x_{i-3})+11f(x_{i-4})-2f(x_{i-5})}{h^4}+\mathcal O (h^2)\end{split}\]

Centred Finite Difference

According to Taylor theorem, we have:

    \[\begin{split}f(x_{i+1})&=f(x_i)+f'(x_i) h+\frac{f''(x_i)}{2!}h^2+\frac{f'''(x_i)}{3!}h^3+\frac{f''''(x_i)}{4!}h^4+\mathcal O (h^5)\\f(x_{i-1})&=f(x_i)-f'(x_i) h+\frac{f''(x_i)}{2!}h^2-\frac{f'''(x_i)}{3!}h^3+\frac{f''''(x_i)}{4!}h^4+\mathcal O (h^5)\end{split}\]

Subtracting the above two equations and using the centred finite difference equation (Equation 6) for f'''(x_i) yields:

    \[f'(x_i) 2h=f(x_{i+1})-f(x_{i-1})-\frac{f(x_{i+2})-2f(x_{i+1})+2f(x_{i-1})-f(x_{i-2})}{6}+\mathcal O (h^5)\\\]


Therefore:

    \[f'(x_i) =\frac{-f(x_{i+2})+8f(x_{i+1})-8f(x_{i-1})+f(x_{i-2})}{12h}+\mathcal O (h^4)\\\]

Using the same procedure, the following equations can be obtained for the second, third, and fourth derivatives:

    \[\begin{split}f''(x_{i})&=\frac{-f(x_{i+2})+16f(x_{i+1})-30f(x_{i})+16f(x_{i-1})-f(x_{i-2})}{12h^2}+\mathcal O (h^4)\\f'''(x_{i})&=\frac{-f(x_{i+3})+8f(x_{i+2})-13f(x_{i+1})+13f(x_{i-1})-8f(x_{i-2})+f(x_{i-3})}{8h^3}+\mathcal O (h^4)\\f''''(x_{i})&=\frac{-f(x_{i+3})+12f(x_{i+2})-39f(x_{i+1})+56f(x_{i})-39f(x_{i-1})+12f(x_{i-2})-f(x_{i-3})}{6h^4}+\mathcal O (h^4)\end{split}\]

Lecture Video

Leave a Reply

Your email address will not be published.