Instead of using the above first-order polynomials approximations for f, we attempt at using a second-order polynomials. In this case we need three points in order to define a second-order polynomial approximation f(x)≈P2(x)=a0+a1x+a2x2. Using again Lagrange's interpolation formula we have P2(x)=(x−x0)(x−x1)(x2−x0)(x2−x1)y2+(x−x0)(x−x2)(x1−x0)(x1−x2)y1+(x−x1)(x−x2)(x0−x1)(x0−x2)y0. Inserting this formula in the integral of Eq. (2) we obtain ∫+h−hf(x)dx=h3(fh+4f0+f−h)+O(h5), which is Simpson's rule.