Learning Scientific Programming with Python (2nd edition)

P10.2.1: Numerical differentiation

Question P10.2.1

The simplest (and least accurate) way to calculate the first derivative of a function is to simply use the definition: $$ f'(x) = \lim_{h\rightarrow 0} \frac{f(x+h) - f(x)}{h}, $$ fixing $h$ at some small value, our approximation is $$ f'(x) \approx \frac{f(x+h) - f(x)}{h}, $$

Using the function $f(x) = e^x$, which value of $h$ (to the nearest power of 10) gives the most accurate approximation to $f'(1) = e$?