3

Here is the solution that was given to me for the question, "Under what circumstances could the Simpson’s rule guarantee an exact result of an integral?":

"Since the error term is proportional to the fourth derivative of f, this shows that Simpson’s rule provides exact results for any polynomial f of degree three or less, since the fourth derivative of such a polynomial is zero at all points."

I don't really understand why this is the case from what I have been given. If someone is able to really dumb it down/visually explain that would be amazing. Thank you.

4 Answers4

4

The Simpson's rule was designed by performing quadratic interpolation on three points. So it is naturally exact for quadratic functions.

Exactness for cubics comes as a bonus, because the residue to a cubic when you subtract the quadratic interpolant is an odd function that integrates to $0$.

Green: the cubic. Magenta: the quadratic interpolant. Blue: the error.

enter image description here

This lucky circumstance does not arise with linear interpolation.

  • But it does arise fitting any even-degree polynomial (even 0th degree, i.e. a rectangle with height matching the midpoint is exact on linear functions). – Especially Lime Sep 03 '24 at 09:13
3

You can apply Simpson's rule to an arbitrary third-degree polynomial and verify directly that the result is equal to the integral (a fourth-degree polynomial evaluated at both ends of the interval and subtracted).

Here is the calculation for $f(x)=x^3.$

Integral:

$$\int_a^bx^3dx=\frac{b^4}4-\frac{a^4}4=\frac14(b-a)(b+a)(a^2+b^2)$$

Approximation:

$$\frac{b-a}6\left(a^3+4\left(\frac{a+b}2\right)^3+b^3\right)=\frac16(b-a)(a+b)\left(a^2-ab+b^2+\frac12(a+b)^2\right)$$

Lieven
  • 2,462
2

You can decompose the integrand function into odd and even parts relative to the midpoint of the interval. For a cubic function the odd part will be cubic, the even part quadratic. Thus the even part gets integrated correctly by node counting. The integral of the odd part is zero by symmetry, the node values for the odd part cancel to zero, as the node positions are also symmetric. Thus the contribution of the cubic term "vanishes" from both sides equally, without leaving a residual.

Similar is true for all other symmetric quadrature rules where an odd number of nodes is symmetrically arranged in the integration interval.

Lutz Lehmann
  • 131,652
0

Plug the functions f(x) = 1, x, x^2, x^3 and x^4 into the Simpson formula and evaluate it, then calculate the integrals of these functions. You will find that for f(x) = 1, x, x^2 and x^3 the result of the Simpson formula and the integral are the same, while for x^4 the results are different.

Now you check that for both integral and Simpson formula, I(a x f) = a x I(f), I(f+g) = I(f) + I(g), S(a x f) = a x S(f), and S(f+g) = S(f) + S(g). That means if Simpson is exact for a set of functions, then it is exact for all linear combinations of those functions. So checking 1, x, x^2 and x^3 shows Simpson is exact for all polynomials of degree three.

(That’s why I asked you to check x^4 as well. Since it is not exact, you cannot prove Simpson is exact for polynomials of degree 4).

gnasher729
  • 10,611
  • 20
  • 38