There are other ways to approximate the derivative. The central difference being popular.
For f (x) = sin(x), h=1/10, and c = pi/4 compare the difference between the forward difference at c and cos(c) and the difference between cos(c) and the central difference, defined by:
I Julia> (f(c+h) - f(c-h)) / (2h) (d) How close (in absolute value) is the difference with the forward difference operator? 0.670602968 (e) How close (in absolute value) is the difference with the central difference operator? -0.011
Sample Solution