This is a general property of Newton-Cotes quadrature formulas: trapezoid is exact for degree 1 polynomials, Simpsons' for 3rd degree, the 5-point rule (sometimes called Bode or Boolean quadrature) is exact for 4th degree, etc.

One way to see this is the following: notice that, for simpsons' rule, you may assume that the points are symmetric relative to the origin (and as you have three, an odd number, one of them is in the origin); now let [tex]p_{3}(x)[/tex] be a 3rd degree polynomial and consider the integral:

And notice that you are left with the integral of a 2nd order polynomial. But remember that Simpsons' rule is based on the integration of an interpolating 2nd order polynomial, and these are unique; therefore, you are integrating the 2nd order interpolating polynomial of a 2nd order polynomial, and these must be equal.