The central-difference approximation to is

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 central-difference approximation to f′(x)f'(x) is Dhf(x)=f(x+h)−f(x−h)2hD_h f(x) = \dfrac{f(x+h)-f(x-h)}{2h}. Take f(x)=ln⁡xf(x) = \ln x. (a) Expand f(x+h)f(x+h) and f(x−h)f(x-h) as Taylor series in hh about xx, keeping every term up to and including the one in h3h^3, and combine the two series to show that Dhf(x)−f′(x)=16h2f′′′(x)+O(h4).D_hf(x) - f'(x) = \tfrac{1}{6}h^2 f'''(x) + \mathcal{O}(h^4). (b) Given f′′′(x)=2/x3f'''(x) = 2/x^3, evaluate the coefficient of h2h^2 in the error at x=2x=2. (c) A ratio table built by halving hh for f(x)=ln⁡xf(x)=\ln x at x=2x=2 gives a measured coefficient (the number multiplying h2h^2 in the error) of 0.04170.0417. State whether the symbolic result agrees, and to how many figures.

Browse the problem library