
Introduction to Models of Dynamical Systems 295
errors, care must be ta ken in applying the previous expressions of finite dif-
ferences. There are finite difference expressions for higher-order derivatives.
For example, an estimate of the second derivative of f(x) at x = c can be
computed with the central finite difference expr e ssion:
f
′′
(x)
x=c
≈
f(c + h) − 2f (c) + f(c − h)
h
2
.
19.4.2 Computing the First Derivative Using Python
Listing 19.2 shows the source program deriv1.py that computes the approx-
imations of the derivative values of f (x) = x
2
using forward, backward, and
central differences for several values of h.
Listing 19.2: Program that computes ...