PHYSICS · Subjective · Fermi University Physics · Mathematical Methods for Physics · Computational Physics · Scientific programming for physicists
Computational Physics, Ch Letting the computer do the algebra
Problem
The forward-difference approximation to f′(x) is Dhf(x)=hf(x+h)−f(x). Take f(x)=e−x.
(a) Expand f(x+h) as a Taylor series in h about x, keeping every term up to and including the one in h2, and use it to show that Dhf(x)−f′(x)=21hf′′(x)+O(h2).
(b) Given f′′(x)=e−x, evaluate the coefficient of h in the error at x=1.
(c) A ratio table built by halving h for f(x)=e−x at x=1 gives a measured coefficient (the number multiplying h) of 0.184. Compare it with the symbolic value.