The standard definition of the derivative of a function of a single
variable, f(x) is:
f'(x) = limit as d -> 0 {[f(x+d)-f(x)]/d}
If |d| is some small, but nonzero quantity, then the expression in
squiggly brackets above gives an approximation to the derivative of
the function at x. If d is a positive number, then this approximation
is called the "forward difference" approximation. If we change the
sign of d, and make it negative, then this approximation is called the
"backwards difference approximation. In general, the approximate
values one calculates using these formulas will be different from one
another, and a better estimate of the derivative at x can be obtained
by averaging the two. You should be able to show that the average of
the forward and backwards approximations is given by:
f'(x) ~= {[f(x+d) -f(x-d)]/(2*d)}
This expression is the "central difference" approximation of the derivative.
In your case, f(x) = log(x), and you are interested in finding the
derivative at x=1. What you need to do is to pick several
successively smaller values of d and calculate the quantity:
{[log(1+d) - log(1-d)]/(2d)}
Note that you can use the properties of the log function to write this as:
{log[(1+x)/(1-x)]/(2d)}
I get the following results for various values of d:
d approximate f'(x)
0.1 0.43575087
0.01 0.43430895
0.001 0.43429462
0.0001 0.43429448
The exact derivative of log(x) is 1/(x*ln(10)), where ln(10) is the
natural log of 10. At x = 1, this is numerically equal (to 8 decimal
places) to 0.43429448, so you can see that the central difference
approximation for d = 0.0001 is quite good. |