Simpson's rule over one pair of intervals of half-width

PHYSICS · Subjective · Fermi University Physics · Mathematical Methods for Physics · Calculus of change and accumulation · Numerical and computational mathematics

Computational Physics, Ch Letting the computer do the algebra

Problem

Simpson's rule over one pair of intervals of half-width hh, centred on xx, estimates I=∫x−hx+hf(t) dtI=\int_{x-h}^{x+h}f(t)\,\mathrm{d}t by S=h3[f(x−h)+4f(x)+f(x+h)].S = \frac{h}{3}\Big[f(x-h)+4f(x)+f(x+h)\Big]. (a) By expanding f(x−h)f(x-h), f(x)f(x) and f(x+h)f(x+h) as Taylor series about xx up to and including the term in h4h^4, and by expanding the exact integral II the same way, show that I−S=−190h5f(4)(x)+O(h7).I - S = -\tfrac{1}{90}h^5f^{(4)}(x) + \mathcal{O}(h^7). (b) Test this on f(x)=x4f(x) = x^4 (so f(4)(x)=24f^{(4)}(x) = 24 for every xx), taking x=0x=0 and h=0.1 mh = 0.1\,\mathrm{m}. Compute II and SS directly from the polynomial, and confirm that I−SI-S agrees with the symbolic formula.

Browse the problem library