Simpson's Rule

Simpson's rule fits parabolas through pairs of subintervals. Formula with the 1-4-2-4-1 weights, why n must be even, a worked example and the error bound.

Simpson's Rule

You need a numerical method more accurate than the trapezoidal rule for the same number of subintervals. Simpson's rule uses parabolic arcs instead of straight lines. The formula is ∫ab f(x) dx ≈ (Δx/3)[f(x0) + 4f(x1) + 2f(x2) + 4f(x3) + ... + 2f(xn-2) + 4f(xn-1) + f(xn)], where n is even and Δx = (b − a)/n. The pattern of coefficients, 1, 4, 2, 4, 2, …, 4, 1, is the entire method. Get one coefficient wrong and the approximation fails.

Simpson's Rule Formula And The 1-4-2-4-...-4-1 Weights

The formula is a weighted sum of function values at equally spaced points. The endpoints f(x0) and f(xn) each have weight 1. Every odd-indexed point f(x1), f(x3), …, f(xn-1) gets weight 4. Every even-indexed point f(x2), f(x4), …, f(xn-2) gets weight 2. Multiply the entire sum by Δx/3. OpenStax Calculus Volume 2, section 3.6, and Stewart's Calculus, section 7.7, both state this form identically. The 1-4-2-4-…-4-1 pattern is the only one that makes Simpson's rule exact for polynomials up to degree three.

Why N Must Be Even In Simpson's Rule

Simpson's rule fits a parabola through three consecutive points. A parabola needs three points, which cover two subintervals. To cover the whole interval [a, b] with these three-point segments, the total number of subintervals n must be a multiple of two. If n is odd, the last subinterval has no partner and the rule cannot be applied. This is the single most common failure mode: a student uses n = 3 or n = 5 and gets a nonsense answer. The rule is undefined for odd n. If your problem gives an odd n, use the trapezoidal rule instead, or ask for a different method.

Worked Example: Simpson's Rule With N = 4

Approximate ∫02 x3 dx using Simpson's rule with n = 4.

Step 1: Δx = (2 − 0)/4 = 0.5. The partition points are x0 = 0, x1 = 0.5, x2 = 1.0, x3 = 1.5, x4 = 2.0.

Step 2: Evaluate f(x) = x3 at each point: f(0) = 0, f(0.5) = 0.125, f(1.0) = 1, f(1.5) = 3.375, f(2.0) = 8.

Step 3: Apply the 1-4-2-4-1 weights: S4 = (0.5/3)[0 + 4(0.125) + 2(1) + 4(3.375) + 8].

Step 4: Calculate: 0 + 0.5 + 2 + 13.5 + 8 = 24. Multiply by 0.5/3 = 1/6: 24 × 1/6 = 4. The exact integral is 4, so Simpson's rule with n = 4 gives the exact value for x3. This is not luck, Simpson's rule is exact for cubics.

Simpson's Rule Error Bound

The error bound for Simpson's rule is |ES| ≤ (K(b − a)5)/(180 n4), where K is an upper bound on |f(4)(x)| over [a, b]. Stewart's Calculus, section 7.7, gives this formula with K; OpenStax Calculus Volume 2, section 3.6, uses M instead, with the same meaning. The fourth derivative is the key: Simpson's rule is exact for any polynomial of degree three or less because its fourth derivative is zero.

For the worked example above, f(4)(x) = 0, so K = 0 and the bound is zero, the rule is exact. For a non-polynomial function like f(x) = sin(x), find the maximum of the fourth derivative on the interval. The bound is a worst-case guarantee, not the actual error. The actual error is usually much smaller. Do not confuse the bound with the real error.

Simpson's vs Trapezoid vs Midpoint on the Same Function
MethodApproximation for ∫₀² x³ dx, n=4Exact ValueAbsolute Error
Left Riemann Sum3.7540.25
Right Riemann Sum4.2540.25
Midpoint Riemann Sum3.937540.0625
Trapezoidal Rule4.040.0
Simpson's Rule4.040.0

Simpson's Rule Calculator: What To Expect

Check That N Is Even

A Simpson's rule calculator takes the function, the interval [a, b], and n, and returns the approximation. The best calculators also show the error bound and let you compare with trapezoidal and midpoint rules. The table above was generated by a calculator's 'compare all methods' feature for ∫02 x3 dx with n = 4. The trapezoidal rule happens to be exact here, but not because x3 is a quadratic parabola. It is a cubic. The error cancels for this symmetric function and partition.

Verify The Output Against The 1-4-2-4 Pattern

When you use a calculator, always check that n is even. Entering n = 3 will produce a result, but it will not be a Simpson's rule approximation. Most calculators warn you; some silently compute a different method. Verify the output against the 1-4-2-4-…-4-1 pattern.

Common Questions

What is the Simpson's rule formula?

∫<sub>a</sub><sup>b</sup> f(x) dx ≈ (Δx/3)[f(x<sub>0</sub>) + 4f(x<sub>1</sub>) + 2f(x<sub>2</sub>) + 4f(x<sub>3</sub>) + … + 4f(x<sub>n-1</sub>) + f(x<sub>n</sub>)], with Δx = (b − a)/n and n even.

Why must n be even for Simpson's rule?

Because Simpson's rule fits a parabola through three points covering two subintervals. To cover the whole interval, n must be a multiple of two. An odd n leaves one subinterval unpaired and the rule is undefined.

What is the error bound for Simpson's rule?

|E<sub>S</sub>| ≤ (K(b − a)<sup>5</sup>)/(180 n<sup>4</sup>), where K is the maximum absolute value of the fourth derivative f<sup>(4)</sup>(x) on [a, b]. It is a worst-case bound, not the actual error.

How is Simpson's rule different from the trapezoidal rule?

The trapezoidal rule uses straight line segments between points. Simpson's rule uses parabolic arcs through three points. Simpson's rule is exact for cubics; the trapezoidal rule is exact only for linear functions.