Methods LibrarySimpson's Rule
ApproximationConvergence: O(h⁴) — exact for degree ≤ 3 polynomialsDerivative: Not needed

Simpson's Rule

Approximate definite integrals by fitting parabolas — far more accurate than the Trapezoidal Rule.

Try Simpson's Rule — No Sign-in Needed

What is the Simpson's Rule?

Simpson's Rule is a numerical integration method that approximates a definite integral by fitting a parabola (quadratic polynomial) over each pair of subintervals and summing the areas under each parabola. This gives it a significant accuracy advantage over the Trapezoidal Rule, which fits straight lines: where the Trapezoidal Rule has error proportional to h² (where h is the subinterval width), Simpson's Rule has error proportional to h⁴. Doubling the number of subintervals reduces the Trapezoidal error by a factor of 4, but reduces Simpson's error by a factor of 16.

The rule is named after Thomas Simpson (1710–1761), though it was actually known to Johannes Kepler a century earlier — it is sometimes called Kepler's rule in German-speaking countries. The underlying idea is that a parabola is a much better local approximation to a smooth curve than a straight line, and the integral of a parabola over a symmetric interval has a particularly clean closed form.

A remarkable property of Simpson's Rule is that it is exact for polynomials of degree up to 3, even though it uses only quadratic (degree 2) polynomials to approximate the integrand. This super-accuracy results from the specific choice of weighting coefficients (1/3, 4/3, 1/3) and is the reason Simpson's Rule is so widely used in practice.

The Formula

int_a^b f(x),dx approx (h) / (3)[f(x_0) + 4f(x_1) + 2f(x_2) + 4f(x_3) + ·s + 4f(x_n-1) + f(x_n)]

h = (b−a)/n is the subinterval width (n must be even). The pattern of coefficients 1, 4, 2, 4, 2, …, 4, 1 sums the parabolic approximations across all subintervals.

Step-by-Step Algorithm

  1. 1

    Choose the interval [a, b] and an even number of subintervals n.

  2. 2

    Compute h = (b − a) / n and the nodes xᵢ = a + i·h for i = 0, 1, …, n.

  3. 3

    Evaluate f(xᵢ) at all nodes.

  4. 4

    Apply the composite Simpson's rule: multiply f(x₀) and f(xₙ) by 1, odd-indexed nodes by 4, even-indexed interior nodes by 2.

  5. 5

    Sum all terms, multiply by h/3.

Convergence & Behaviour

The error of composite Simpson's Rule is −(b−a)h⁴f⁽⁴⁾(ξ)/180 for some ξ ∈ [a,b]. This O(h⁴) convergence means that halving h (doubling n) reduces the error by a factor of 16. For functions with zero fourth derivative (i.e., polynomials of degree ≤ 3), the rule is exact regardless of h. The main failure mode is functions with large fourth derivatives or discontinuities — for these, adaptive quadrature or Gaussian quadrature methods are preferred.

When to Use

Use Simpson's Rule for smooth functions on a fixed interval where high accuracy is needed with relatively few function evaluations. It is the standard first choice for numerical integration in engineering and science courses.

When to Avoid

Avoid it for functions with discontinuities, singularities, or highly oscillatory behavior on the integration interval. For those cases, use adaptive quadrature (e.g., adaptive Simpson or Gauss-Kronrod) that automatically concentrates evaluation points where the function varies rapidly.

Worked Example

Approximate ∫₀¹ 1/(1+x²) dx using n = 4 subintervals. (Exact value: π/4 ≈ 0.7854.)

  1. 1.h = (1−0)/4 = 0.25; nodes: x₀=0, x₁=0.25, x₂=0.5, x₃=0.75, x₄=1
  2. 2.f(0) = 1, f(0.25) = 16/17 ≈ 0.9412, f(0.5) = 4/5 = 0.8, f(0.75) = 16/25 = 0.64, f(1) = 0.5
  3. 3.Simpson's sum: 1·f(x₀) + 4·f(x₁) + 2·f(x₂) + 4·f(x₃) + 1·f(x₄)
  4. 4.= 1 + 4(0.9412) + 2(0.8) + 4(0.64) + 0.5 = 1 + 3.7647 + 1.6 + 2.56 + 0.5 = 9.4247
  5. 5.Integral ≈ (0.25/3) · 9.4247 = 0.7854

Result: ≈ 0.7854, matching π/4 to 4 decimal places with only 5 function evaluations.

Try It Now — No Account Required

Loading interactive solver…

Want the full platform experience?

Sign up free and unlock infinite-zoom canvas, AI Tutor explanations, Canvas LTI grade passback, and your full solve history — pre-loaded with the Simpson's Rule example above.

Related Methods