VKCMVI
COMPUTATIONAL MATHEMATICS

Simpson's rule

Approximate definite integrals with parabolic interpolation, even subintervals, grid refinement and error estimates.

Calculator

Load the problem, then select Solve to view the steps. Some advanced examples intentionally fail or do not converge.

Method and applicability

Simpson's rule

In=h3[f(x0)+4f(x1)+2f(x2)+…+f(xn)]

For sufficiently smooth f, the composite Simpson rule has order p = 4 and requires even n.

Use a positive target error to refine the grid automatically, or enter 0 to retain the requested grid.

Results

Worked examples

Basic 1

∫₀¹ x² dx; n = 4

Expected result: I₄ = 1/3

Calculation steps
  1. h = 1/4; f(x) = x²
  2. I₄ = (1/12)[0 + 4(1/16) + 2(1/4) + 4(9/16) + 1]
  3. I₄ = (1/12) · 4 = 1/3
  4. I₈ = I₄; |I₈ − I₄|/15 = 0

Source: Original exercise

Academic 3

∫₂⁵ e⁻⁰·¹ˣ dx; n = 2

Expected result: I₂ ≈ 2.122006886

Calculation steps
  1. h = 1.5; I₂ = 0.5[e⁻⁰·² + 4e⁻⁰·³⁵ + e⁻⁰·⁵]

Source: University of Waterloo · Topic 13.4

Advanced 5

∫₀¹ x⁴ dx; n = 4

Expected result: I₄ = 0.200520833333; I = 0.2

Simpson is exact for cubics, not generally for quartics.

Source: Original exercise

Accuracy and common pitfalls

For f ∈ C⁴[a,b] and even n, the error is bounded by (b−a)h⁴ max|f⁽⁴⁾|/180. Cubic polynomials are integrated exactly in exact arithmetic.

Recommended reading