Higher-order derivatives

Approximations of the second (and third) derivative by forward, backward and central finite differences, with their error order.

Second derivative

The most used is the central one, combining the node and its two neighbours and already of order 2. The five-point one rises to order 4.

f(xi)fi+12fi+fi1h2+O(h2)f''(x_i)\approx\frac{f_{i+1}-2f_i+f_{i-1}}{h^2}+\mathcal{O}(h^2)
Central, order 2.
f(xi)fi+2+16fi+130fi+16fi1fi212h2+O(h4)f''(x_i)\approx\frac{-f_{i+2}+16f_{i+1}-30f_i+16f_{i-1}-f_{i-2}}{12h^2}+\mathcal{O}(h^4)
Five-point central, order 4.
  • Forward O(h): (f_{i+2}−2f_{i+1}+f_i)/h²
  • Forward O(h²): (−f_{i+3}+4f_{i+2}−5f_{i+1}+2f_i)/h²
  • Backward O(h): (f_i−2f_{i−1}+f_{i−2})/h²
  • Backward O(h²): (2f_i−5f_{i−1}+4f_{i−2}−f_{i−3})/h²