---
title: "Numerical Quadrature: Newton-Cotes and Adaptive Rules"
description: "Derive quadrature rules by integrating interpolating polynomials, compare their error orders, and use local error estimates to guide adaptive refinement."
canonical: https://lightmysky.com/learn/mathematics/numerical-quadrature-newton-cotes-and-adaptive-rules-mt_fT5kRCUiD5
source: https://lightmysky.com/learn/mathematics/numerical-quadrature-newton-cotes-and-adaptive-rules-mt_fT5kRCUiD5.md
retrieved: 2026-11-12
---

> **Agent view.** This is the Markdown twin of the page, for tools and assistants.
> When to use this site, and the call that answers each job: https://lightmysky.com/agent-instructions.md
> API description (OpenAPI 3.1): https://lightmysky.com/openapi.json · Authentication: https://lightmysky.com/auth.md
> Pricing: https://lightmysky.com/pricing.md · Catalog: https://lightmysky.com/llms.txt · Full catalog: https://lightmysky.com/llms-full.txt
> Every machine-readable file on this domain: https://lightmysky.com/.well-known/ai-catalog.json
> Ask for Markdown with `Accept: text/markdown`, a `.md` address, or `?mode=agent`.

# Numerical Quadrature: Newton-Cotes and Adaptive Rules

Derive quadrature rules by integrating interpolating polynomials, compare their error orders, and use local error estimates to guide adaptive refinement.

Subject: Mathematics · Area: Calculus & Analysis · Ages 20 to 21
Page: https://lightmysky.com/learn/mathematics/numerical-quadrature-newton-cotes-and-adaptive-rules-mt_fT5kRCUiD5

## Ready when they can

- Derive the trapezium and Simpson rules by integrating interpolating polynomials
- Compare error orders and predict how halving the step changes each error
- Explain when an adaptive rule beats a uniform one and how it decides where to refine

## Lesson: Area under the curve, panel by panel

You have built interpolating polynomials. Now integrate them to estimate I = ∫_a^b f(x) dx. On one panel, let W=b-a and t=(x-a)/W. The endpoint line is p(t)=(1-t)f(a)+t f(b). On [0,1], the integrals of 1-t and t are [t-t²/2]_0^1=1/2 and [t²/2]_0^1=1/2. Since dx=W dt, T=(W/2)[f(a)+f(b)]. This is exact for constants and lines.

For n equal trapezium subintervals, let h=(b-a)/n and x_i=a+ih. Adding the panel integrals gives T_n=(h/2)[f(x_0)+2f(x_1)+...+2f(x_(n-1))+f(x_n)]. Each shared interior sample occurs in two panels, so its coefficient is 2. There are n+1 samples.

*(drawing: For four equal subintervals, add these weighted samples and multiply by h/2.)*

On one Simpson panel, W=b-a and t=(x-a)/W. The endpoint-midpoint basis is L_0=2t²-3t+1, L_m=4t-4t², L_1=2t²-t. Integrate term by term on [0,1]: [2t³/3-3t²/2+t]_0^1=1/6; [2t²-4t³/3]_0^1=2/3; [2t³/3-t²/2]_0^1=1/6. Multiply each by W because dx=W dt. This gives S=(W/6)[f(a)+4f((a+b)/2)+f(b)].

Simpson is exact for polynomials of degree at most three. Quadratics are exact by construction. For a cubic, put u=x-m, where m is the panel midpoint, and d=W/2. Its difference from the quadratic interpolant is A(u³-d²u), where A is its leading coefficient. Replacing u by -u changes the residual's sign. The contributions at u and -u cancel, so its integral on [-d,d] is zero.

Composite Simpson uses an even number n of equal subintervals of width h=(b-a)/n. Each Simpson panel spans two subintervals, so W=2h. Adding panels gives S_n=(h/3)[f(x_0)+4f(x_1)+2f(x_2)+4f(x_3)+...+4f(x_(n-1))+f(x_n)]. Odd-index samples have coefficient 4; internal even-index samples have coefficient 2.

*(drawing: These four subintervals form two Simpson panels. Multiply the weighted sum by h/3.)*

If f has a continuous second derivative on [a,b] and |f''(x)|≤M_2, the composite trapezium bound is |I-T_n|≤(b-a)M_2 h²/12. Its error is therefore O(h²) on a fixed interval. This is an upper bound; the actual error can be smaller or zero.

If f has a continuous fourth derivative on [a,b] and |f''''(x)|≤M_4, the composite Simpson bound is |I-S_n|≤(b-a)M_4 h⁴/180, with n even. Its error is O(h⁴). For one panel of width W, h=W/2, so the bound becomes M_4 W⁵/2880.

For sufficiently small steps, suppose the absolute error is E(h)≈C h^p with C nonzero and rounding negligible. Halving h predicts E(h/2)≈E(h)/2^p: about E/4 for trapezium or E/16 for Simpson. These are leading-error predictions, not exact ratios for every function. Large steps, cancellation, limited smoothness or rounding can disturb them.

*(drawing: The prediction assumes a nonzero leading error term and negligible rounding.)*

Suppose Q(h)=I+c h^p and Q(h/2)=I+c h^p/2^p model the leading signed errors. Subtracting gives an estimate for the finer result: |Q(h/2)-I|≈|Q(h/2)-Q(h)|/(2^p-1). Divide the difference by 3 for trapezium or by 15 for Simpson when the panel width is halved. This estimates error; it is not a guaranteed bound. A further refinement is needed to check the trend in the differences.

Adaptive quadrature estimates errors separately on subintervals and refines selected parts. One largest-error-first strategy splits the subinterval with the largest estimate, then replaces it with estimates for its children. Other strategies test panels recursively against local tolerances. Equal refinement everywhere is not required.

A detected narrow peak can favor adaptivity: spend more samples near it and fewer on smooth stretches. This can save evaluations compared with uniform refinement. But a peak between all sampled points can be missed, even when the estimated error is zero. Choosing the largest estimate also does not prove which split will reduce the true error most.

Add nonnegative local absolute error estimates to estimate total error. A recursive scheme can assign each child half its parent's tolerance. If e_1≤τ/2 and e_2≤τ/2, then e_1+e_2≤τ, the parent tolerance. For example, a parent tolerance of 0.006 gives each child 0.003. Passing these tests controls estimated error, not a proven true-error bound.

Stop successfully when the chosen estimated-error test meets the tolerance. Also set an evaluation or subdivision limit and check for rounding or inability to split further. If a limit stops the calculation before tolerance is met, report the unmet tolerance. Identical successive floating-point estimates alone do not prove accuracy.

**Recap.** Integrate interpolants to get the rules. Smooth composite errors are O(h²) and O(h⁴). Adaptive refinement follows error estimates, with tolerance and work-limit checks.

*Original lesson, questions, worked solutions and flashcards written for this dataset.*

## Practice

17 questions on this page, each with its working shown.

## Needs first

- [Polynomial Interpolation and Its Error Term](https://lightmysky.com/learn/mathematics/polynomial-interpolation-and-its-error-term-mt_NSnzY9Xodd)
- [The Trapezium Rule](https://lightmysky.com/learn/mathematics/the-trapezium-rule-mt_rAlJ1WIRmZ)
