Mathematics · Article
Numerical integration and differential equations
Approximate integrals and differential equations with explicit quadrature remainders, adaptive and improper-integral bounds, probabilistic sampling, Runge–Kutta and multistep error analysis, stiff stability, geometric oscillators and output-specific certificates.
Back to MathematicsAfter reading, you can
- Specify an integral, initial-value problem or boundary-value problem with its domain, units, regularity, uncertainty model and requested error scale.
- Derive and compare midpoint, trapezoidal, Simpson and Gaussian rules, including signed remainders, positive weights and data amplification.
- Use adaptive estimates, substitutions, tail bounds, known oscillatory phase and Monte Carlo under their actual deterministic or probabilistic hypotheses.
- Establish local IVP existence and explain how local defects, initial uncertainty and numerical forcing propagate into finite-time error.
- Analyze Runge–Kutta, implicit and multistep methods with separate order, stability, startup, stage-solvability and stiff-resolution requirements.
- Assess oscillator geometry, event times and boundary-value meshes using explicit sensitivity or residual bounds while retaining model and discretization uncertainty.
From accumulated quantities to evolving states
Integrating a flow rate gives an accumulated quantity. Integrating an equation of motion gives a changing state, while a boundary-value equation determines a field constrained at separated endpoints. Each calculation connects analysis with applications in transport, oscillation, population dynamics and engineering. A numerical answer becomes useful when its error statement matches the quantity and units that the scientific question actually asks for.
Begin with fixed-node quadrature: weights explain data sensitivity, and smoothness explains truncation. Midpoint, trapezoidal, Simpson and Gaussian rules then lead to adaptive refinement, singular endpoints, infinite tails, oscillatory phase and probabilistic sampling. The second half turns an IVP into an integral equation and develops Euler and Runge–Kutta methods before extending the analysis to stiffness, multistep starts, nonlinear dissipation and geometric oscillators. The final sections address event times and a boundary-value mesh, using the preceding linear-algebra lesson to distinguish a solved discrete system from an accurate continuous model.
Throughout, keep three questions visible: does the stated mathematical target exist, what approximation has actually been computed, and which bounds apply to the requested output? A stable step need not resolve a transient, a zero algebraic residual need not remove mesh error, and a small estimated difference need not certify an integral. The worked examples and full exercise solutions develop these distinctions with explicit calculations; the advanced proofs retain the domain, regularity and boundary cases on which their conclusions depend.
An integral or trajectory needs a numerical contract
An integral asks for I=∫_a^b f(x)dx, or a stated weighted or improper version. Its domain, orientation and convergence are part of the target: a finite sum returned for a divergent improper integral does not approximate a finite I. If x has units X and f has units F, then I has units FX. An absolute tolerance must have these units; a relative tolerance needs a nonzero reference scale and can be unsuitable when cancellation makes I zero or very small.
An initial-value problem specifies y'=F(t, y), y(t₀)=y₀, an interval and a state norm. A boundary-value problem instead imposes conditions at separated locations and may have different existence, uniqueness and conditioning. Time, position and state components can have different physical units, so a norm or component scale must be stated before numerical errors are compared. A trajectory on a grid is also different from a continuously evaluated trajectory or an event time.
The regularity assumptions must belong to the actual scientific target. A bound using f^(4) requires that derivative and a justified upper bound; a vector-field Lipschitz estimate must hold on a domain containing the compared trajectories or stages. The data model may provide exact symbolic values, deterministic uncertainty boxes or a probability law. These lead to different guarantees and cannot be interchanged by naming all of them noise.
For a complete error statement, insert intermediate exact objects and use the triangle inequality: physical target to chosen model, model to discretized target, discretized target to exact algorithmic output, and exact output to stored computation. Each term needs its own argument. The methods below primarily address quadrature and differential-equation approximation under a specified model; their mathematical accuracy does not independently establish that this model captures the physical system. For quadrature, IVP and BVP formulations, see [Quadrature](https://dlmf.nist.gov/3.5); [Numerical Solution of Differential Equations I](https://www.numerical.rl.ac.uk/media/people/tyrone-rees/nsde/notes/NSDE1_2016.pdf); [Collocation for linear problems](https://fncbook.com/linear/); the target, units and uncertainty contract must be supplied for the particular scientific question.
Quadrature weights and data amplification
Fix nodes x_i and weights w_i in a linear rule Q(f)=Σ_i w_i f(x_i). If observed values are f(x_i)+δ_i with independent admissible deterministic constraints |δ_i|≤ε, then δQ=Σ_i w_iδ_i and |δQ|≤εΣ_i|w_i|. The word independent here permits every combination in a box; it does not assert probabilistic independence or zero mean. With unequal bounds ε_i the corresponding estimate is Σ_i|w_i|ε_i.
The uniform bound is sharp: for real weights choose δ_i=ε sign(w_i), with any value at a zero weight, to make δQ=εΣ|w_i|. For complex weights and complex disk-valued errors choose phases that align w_iδ_i. Positivity is valuable because nonnegative weights integrating constants satisfy Σ|w_i|=Σw_i=b-a for an unweighted integral. Signed weights may have the same constant sum but a larger absolute sum and thus a larger worst-case amplification.
With exact target I, computed weighted sum Q̂ and noisy exact-data sum Q_data, write I-Q̂=(I-Q(f))+(Q(f)-Q_data)+(Q_data-Q̂). These are truncation, data and arithmetic contributions. Polynomial exactness only removes the first term for the specified polynomial class. A favorable cancellation in one error realization does not reduce the supremum used for the data bound, and increasing the number of positive weights does not by itself reduce its total mass.
Node perturbations are a separate dependence. If weights remain fixed and |f'|≤M on every connecting interval from x_i to x_i+δx_i, then the extra change is at most MΣ|w_i||δx_i|. Moving nodes can also change weights, endpoints or the admissible derivative domain, which requires further terms rather than reuse of the value-only bound. For an unweighted integral each w_i has the units of x, so these contributions have integral units. For the fixed-node weighted-rule setting, see [Quadrature](https://dlmf.nist.gov/3.5); the absolute-weight and node-uncertainty bounds above follow from the stated admissible errors.
Continuity already gives a convergence statement
Let a=x₀<⋯<x_N=b and select ξ_i in each closed cell [x_(i-1), x_i]. Put h_i=x_i-x_(i-1), h_max=max h_i and Q=Σ h_i f(ξ_i). For continuous f on [a, b], define its modulus of continuity ω_f(δ)=sup{|f(s)-f(t)|:s, t∈[a, b], |s-t|≤δ}. Compactness makes it finite, and uniform continuity gives ω_f(δ)→0 as δ→0.
Subtract the rule cell by cell: I-Q=Σ_i∫_(x_(i-1))^(x_i)[f(x)-f(ξ_i)]dx. Both points lie in the same cell, so |x-ξ_i|≤h_i≤h_max. The integral triangle inequality gives |I-Q|≤Σ_i h_iω_f(h_max)=(b-a)ω_f(h_max). This proof requires neither differentiability nor an equal mesh, and allows any choice of the stated in-cell samples.
Consequently every sequence of such partitions with h_max→0 converges to I. A bound |f'|≤M strengthens the modulus estimate to ω_f(δ)≤Mδ and yields an explicit first-order upper bound, while Hölder control Cδ^α gives its own rate. Continuity alone need not supply a known numerical modulus or a high-order power law, so convergence as an abstract limit is different from a verified finite-step tolerance.
These weights are positive and sum to b-a, hence value uncertainty bounded by ε adds at most (b-a)ε. Refining the mesh reduces the continuity-based truncation bound but does not force this deterministic data contribution to vanish. A singular integrand, samples outside their cells or a moving problem with an uncontrolled modulus falls outside the displayed statement and needs a corresponding new analysis. For quadrature families and regularity assumptions, see [Quadrature](https://dlmf.nist.gov/3.5); this in-cell modulus argument uses continuity rather than a derivative remainder.
The midpoint rule and its error
On a real cell [a, a+h], let c=a+h/2 and M_cell=h f(c). Assume f∈C² on the cell and let m=min f'', M=max f''. Taylor's integral remainder about c, on either side of c, implies (m/2)u²≤f(c+u)-f(c)-u f'(c)≤(M/2)u² for -h/2≤u≤h/2. For negative u, reversing both oriented integration factors gives the same positive second-derivative kernel.
Integrating symmetrically cancels the linear term. Since (1/2)∫_(-h/2)^(h/2)u²du=h³/24, it follows that mh³/24≤I_cell-M_cell≤Mh³/24. The continuous real derivative f'' takes every value between its minimum and maximum, so I_cell-M_cell=h³f''(ξ)/24 for some ξ in the cell. This mean-value conclusion does not require choosing a continuous family of pointwise Taylor remainder locations.
On a partition, apply the absolute form |I_i-M_i|≤h_i³||f''||∞/24 and sum. Since Σh_i³≤h_max²Σh_i=(b-a)h_max², the composite error is at most (b-a)h_max²||f''||∞/24. For equal h this is the familiar second-order bound. Convex f has f''≥0 and thus midpoint underestimation; the exact signed formula explains that direction rather than only the magnitude.
Every cell contributes one positive weight h_i, so the separate value-data amplification is b-a. The smoothness assumption must hold up to the cell endpoints; an integrable but unbounded endpoint singularity does not meet it. Constant curvature makes the remainder sharp, whereas variable signed curvature can cancel and produce a much smaller actual error than the maximum-derivative upper bound. For midpoint among interpolatory rules, see [Quadrature](https://dlmf.nist.gov/3.5); the symmetric C² cell argument above gives the signed remainder and its composite bound.
The trapezoidal rule and its error
Let ℓ be the linear interpolant through a and a+h, and let T_cell=h[f(a)+f(a+h)]/2=∫ℓ. For real f∈C², the interpolation remainder at an interior x is f(x)-ℓ(x)=f''(ξ_x)(x-a)(x-a-h)/2. This follows by subtracting a suitable multiple of the two-root polynomial and applying Rolle's theorem twice. The product is nonpositive on the cell, a sign that must be retained.
If m≤f''≤M, that sign gives (M/2)(x-a)(x-a-h)≤f(x)-ℓ(x)≤(m/2)(x-a)(x-a-h). Integrating the product gives -h³/6, so -Mh³/12≤I_cell-T_cell≤-mh³/12. Continuity of f'' then gives I_cell-T_cell=-h³f''(ξ)/12 for some ξ. No integral of an unspecified, potentially discontinuous choice ξ_x has been assumed.
Summing absolute cell bounds gives |I-T|≤(b-a)h_max²||f''||∞/12. The composite endpoint weights are h₁/2 and h_N/2; an interior node has weight (h_i+h_(i+1))/2. They are all nonnegative and their sum is b-a. Therefore the sharp deterministic value-data bound is (b-a)ε even on a nonuniform partition.
For convex data, T overestimates I, opposite to the midpoint sign. On an equal mesh, a second-order label describes truncation under the stated derivative control; it does not include noisy endpoints, floating-point summation or uncertain node locations. Nor does exact integration of an odd cubic on a symmetric interval extend degree-one polynomial exactness to all cubics. Cancellation in a particular target and a rule's guaranteed polynomial degree are different statements. For trapezoidal rules and signed remainders, see [Quadrature](https://dlmf.nist.gov/3.5); the nonuniform bound follows by summing the actual cell widths.
An integral error kernel for a quadrature rule
Write the error functional as L(f)=∫_a^b f(x)dx-Σ_i w_i f(x_i), with finitely many fixed nodes inside [a, b]. Suppose it annihilates every polynomial of degree at most m-1, m≥1. For f∈C^m, Taylor's integral formula is f(x)=Σ_(j=0)^(m-1)f^(j)(a)(x-a)^j/j!+∫_a^b[(x-s)_+^(m-1)/(m-1)!]f^(m)(s)ds. For m=1 the truncated zeroth power denotes the indicator s<x; its value on the diagonal is irrelevant to integration.
Applying L kills the polynomial. The finite quadrature sum commutes with the remaining integral by linearity. The double integral also interchanges: its factors are bounded on the compact square, with at most the harmless indicator discontinuity for m=1, and f^(m) is continuous. Thus L(f)=∫_a^b K_m(s)f^(m)(s)ds, where K_m(s)=L_x[(x-s)_+^(m-1)/(m-1)!]. This explicitly extends the finite-node functional reasoning to one containing an actual integral.
It follows directly that |L(f)|≤||f^(m)||∞∫_a^b|K_m(s)|ds. If the real kernel has one sign, the derivative can instead be bracketed between its extrema and continuity yields L(f)=f^(m)(ξ)∫K_m for some ξ, unless the kernel is identically zero, when the error is zero. For a sign-changing kernel a single-point derivative representation is not generally justified by this argument, though the absolute bound remains valid.
For x² the constant second derivative is 2. The composite derivative bounds (b−a)h²||f″||∞/24 and (b−a)h²||f″||∞/12 are attained. Both rules have nonnegative sample weights summing to the interval width. A shared endpoint has one distinct data value even though adjacent panels both use it.
| Quantity | Exact result |
|---|---|
| Cell width | 1/2 |
| Integral | 8/3 |
| Midpoint / trapezoid | (21/8, 11/4) |
| Signed I−M / I−T | (1/24, −1/12) |
| Second derivative norm | 2 |
| Attained absolute bounds | (1/24, 1/12) |
| Fixed-node value amplification each | 2ε |
Exact inputs and supporting calculations
| Parameter | Value |
|---|---|
| b | 2 |
| n | 4 |
| Physical node | Sample | Weight |
|---|---|---|
| 1/4 | 1/16 | 1/2 |
| 3/4 | 9/16 | 1/2 |
| 5/4 | 25/16 | 1/2 |
| 7/4 | 49/16 | 1/2 |
| Physical node | Sample | Weight |
|---|---|---|
| 0 | 0 | 1/4 |
| 1/2 | 1/4 | 1/2 |
| 1 | 1 | 1/2 |
| 3/2 | 9/4 | 1/2 |
| 2 | 4 | 1/4 |
Rescaling x=a+Ht shows why an mth-derivative integral error scales as H^(m+1): H from integration and H^m from the derivative transformation. The kernel is determined by the actual nodes and weights, not only by a method's name. Establishing polynomial annihilation and the kernel's sign or absolute integral is essential before importing a remainder constant; data and arithmetic terms are outside this exact-functional identity. For the quadrature error-functional setting, see [Quadrature](https://dlmf.nist.gov/3.5); the integral Taylor representation above supplies the kernel proof and its interchange hypotheses.
Simpson exactness and a signed fourth-order kernel
On [0, 1], Simpson's rule is S(f)=[f(0)+4f(1/2)+f(1)]/6. Its weights integrate 1, x, x², x³ exactly: the rule gives 1, 1/2, 1/3, 1/4 respectively. Hence its error functional annihilates degree three. For m=4, the preceding kernel is K(s)=(1-s)⁴/24-(1-s)³/36-(1/2-s)_+³/9. The first term is the integral of (x-s)_+³/6, and the other two are its nonzero quadrature contributions.
For 0≤s≤1/2, expansion simplifies this to s³(3s-2)/72; for 1/2≤s≤1 it is (1-s)³(1-3s)/72. Both pieces are nonpositive and are reflected versions of each other. Integrating the first gives -1/5760, hence ∫₀¹K=-1/2880. For real C⁴ data the fixed-sign mean-value argument therefore gives I-S=-f^(4)(ξ)/2880 on the unit panel.
On a panel of total width H, scaling gives I_panel-S_panel=-H⁵f^(4)(ξ)/2880. In a composite equal mesh let d be the spacing between consecutive nodes, so each Simpson panel spans H=2d and the number of panels is (b-a)/(2d). Summing the absolute bounds gives |I-S_comp|≤(b-a)d⁴||f^(4)||∞/180. Confusing d with the full panel width changes the constant by a factor of sixteen.
The three weights on a physical panel are H/6, 2H/3, H/6, all positive with total H; the composite value-data amplification is b-a. Degree-three integration despite a quadratic interpolant follows from symmetry of the integrated cubic error, not pointwise reproduction of cubics. The signed fourth-derivative formula requires C⁴ on the panel, so a difference estimator for an unresolved or singular target cannot claim this certificate without those hypotheses and a derivative bound. For Simpson formulas and their width conventions, see [Quadrature](https://dlmf.nist.gov/3.5); a full panel width and a composite node spacing have different remainder constants.
Interpolatory quadrature need not have positive weights
For n+1 distinct nodes x_0, …, x_n on [a, b], define the cardinal polynomial ℓ_i(x)=∏_(j≠i)(x-x_j)/(x_i-x_j). Interpolation gives p_n=Σ_i f(x_i)ℓ_i. Integrating it produces weights w_i=∫_a^bℓ_i(x)dx and a rule exact for every polynomial of degree at most n, since interpolation reproduces those polynomials. Existence of these integrals and distinctness of nodes are the relevant algebraic hypotheses.
Cardinal polynomials can change sign between nodes, so their integrals need not be positive. For nodes 0, 1/4, 1 on [0, 1], exactness of 1, x, x² requires w_0+w_1+w_2=1, w_1/4+w_2=1/2 and w_1/16+w_2=1/3. Subtracting the last two equations gives (3/16)w_1=1/6, so w_1=8/9, w_2=5/18 and w_0=-1/6.
Their absolute sum is 1/6+8/9+5/18=4/3. Thus values each uncertain by ε can perturb the quadrature by as much as 4ε/3 even though constants are integrated with total weight 1. For instance, perturbing the first value negatively and the other two positively aligns all weighted contributions. Exactness on quadratic data does not remove this amplification for arbitrary admitted value errors.
Integrating the Lagrange cardinal polynomials fixes the weights by the first three moment equations. For separately bounded value errors |δyᵢ|≤ε, the triangle inequality gives |δQ|≤εΣ|wᵢ|. Choosing sign-aligned perturbations attains the bound. This calculation fixes the nodes and excludes coordinate, rounding and model errors.
| Quantity | Exact result |
|---|---|
| Physical interval | [0,1] |
| Weights in node order | (−1/6, 8/9, 5/18) |
| Weight derivation | w_s=1/[6s(1−s)], w_1=1/2−s w_s, w_0=1−w_s−w_1 |
| Quadratic exact integral and rule | 1/3 in both cases |
| Degree of exactness | 2 |
| First nonexact degree | 3 |
| I−Q at first nonexact degree | −1/24 |
| Sharp absolute amplification | 4/3 |
| Worst-case data perturbation signs | −ε, +ε, +ε |
Exact inputs and supporting calculations
| Parameter | Value |
|---|---|
| s | 1/4 |
| Physical node | Sample | Weight |
|---|---|---|
| 0 | 0 | −1/6 |
| 1/4 | 1/16 | 8/9 |
| 1 | 1 | 5/18 |
The example uses unequal spacing; it illustrates interpolatory quadrature, not an assertion that these particular weights are an equally spaced Newton–Cotes formula. Higher polynomial degree and more nodes do not by themselves ensure small weights, stable interpolation or a useful error constant. Node choice, derivative or approximation information and the total data sensitivity must be assessed together, motivating positive Gaussian rules as well as subdivision into bounded-order panels. For integrated-cardinal quadrature, see [Quadrature](https://dlmf.nist.gov/3.5); the unequal-node calculation above demonstrates why polynomial exactness does not ensure positive weights.
Orthogonal-polynomial roots provide Gaussian nodes
Let n≥1 be an integer, and let w be continuous and strictly positive on the nondegenerate compact interval [a, b]. The real inner product ⟨p, q⟩=∫_a^b w(x)p(x)q(x)dx is positive definite on polynomials: a nonzero polynomial is nonzero on some subinterval, so its weighted square has positive integral. Solving the positive-definite moment system, or orthogonalizing 1, x, …, x^n, gives a unique real monic degree-n polynomial P_n orthogonal to all lower degrees.
List the distinct interior roots at which P_n changes sign as r_1, …, r_m and form q(x)=∏_(j=1)^m(x-r_j). Roots at which a real polynomial changes sign have odd multiplicity. Each such sign change is canceled by the corresponding factor of q, while other interior roots do not change the sign. Therefore P_n q has one constant sign on (a, b) except at its finitely many roots, and it is not identically zero.
If m<n, orthogonality gives ∫wP_nq=0 because deg q=m. Positivity of w and the constant nonzero sign of P_nq instead make that integral strictly positive or strictly negative, a contradiction. Thus m≥n. A degree-n polynomial has at most n distinct roots, so m=n. These n interior sign-changing roots exhaust its degree, and consequently each has multiplicity one and there are no remaining endpoint, exterior or nonreal roots.
These simple interior roots are the Gaussian nodes. The proof uses positivity on an interval, not only an arbitrary list of moments; a sign-changing weight or degenerate support may not satisfy it. Strict positivity is a convenient sufficient assumption here, rather than the weakest possible one. Computing nodes approximately introduces a separate numerical problem: the exact root theorem alone does not certify the stored nodes or their resulting quadrature weights. For positive-weight monic polynomials and Gaussian nodes, see [Quadrature](https://dlmf.nist.gov/3.5); the sign-change argument above establishes the interior simple-root property used here.
Gaussian exactness and positive weights
Let x_1, …, x_n be the roots of the monic orthogonal P_n, and choose interpolatory weights w_i=∫_a^b w(x)ℓ_i(x)dx. For any polynomial p of degree at most 2n-1, division by P_n gives p=P_nq+r with deg q≤n-1 and deg r≤n-1. Orthogonality makes the integral of wP_nq zero, and P_n vanishes at every quadrature node. The interpolatory rule integrates r exactly, proving Gaussian exactness through degree 2n-1.
For the ith cardinal polynomial, ℓ_i² has degree 2n-2 and its node values are one at i and zero elsewhere. Exactness therefore gives w_i=Q(ℓ_i²)=∫wℓ_i²>0. Applying exactness to the constant gives Σ_iw_i=∫w, the positive total mass. Hence fixed-node value errors bounded by ε have sharp amplification ε∫w, without the extra absolute-weight growth that signed rules can exhibit.
No rule with these n fixed nodes can integrate every degree-2n polynomial: P_n² is zero at every node, so its quadrature is zero, but ∫wP_n²>0. More generally the square of the product of any n distinct fixed real nodes supplies the same obstruction on a positive-weight interval. Thus degree 2n-1 is the maximal possible full polynomial exactness for n fixed function-value nodes in this setting.
Positive weights constrain data sensitivity but do not remove truncation, node or arithmetic errors. Nor does a high exactness degree guarantee a small error for a nonsmooth integrand or an unresolved oscillation. The theorem describes an exact rule with exact nodes and weights; a numerical implementation needs checks on their computation and a remainder or approximation argument for the actual function class. For Gaussian exactness and Christoffel weights, see [Quadrature](https://dlmf.nist.gov/3.5); the squared-cardinal and squared-node-polynomial arguments explain positivity and the degree limit.
The Gaussian remainder has explicit assumptions
Assume f is real and C^(2n) on [a, b]. Let H be the polynomial of degree at most 2n-1 matching f and f' at the n Gaussian nodes. Its existence follows from the nonsingular confluent interpolation system: a homogeneous solution would have n double roots and degree below 2n, hence vanish. For x not a node, subtract from f-H a multiple of P_n² that also vanishes at x. Repeated Rolle arguments across the double roots and this additional root give f(x)-H(x)=f^(2n)(ξ_x)P_n(x)²/(2n)!.
At nodes the same inequality with zero right factor holds. Let m and M be the minimum and maximum of f^(2n). The remainder is bracketed by mP_n²/(2n)! and MP_n²/(2n)! pointwise, without selecting a measurable or continuous ξ_x. Since Q(f)=Q(H) and the rule integrates H exactly, I_w(f)-Q(f)=∫w(f-H). Positivity gives corresponding bounds with the positive factor ∫wP_n².
The intermediate-value property of the continuous real derivative now yields I_w(f)-Q(f)=f^(2n)(ξ)∫wP_n²/(2n)! for some ξ∈[a, b]. In particular its absolute value is at most ||f^(2n)||∞∫wP_n²/(2n)!. The positivity and real-valued assumptions justify this single-point representation; for complex data the absolute bound can be obtained directly, but a common real ξ for a complex equality need not exist.
The real Gaussian remainder with unit weight and f∈C^4 uses the physical 4th derivative divided by 4! times the squared norm of the physical monic Legendre product. Scaling from t to x contributes h^5. The selected monomial has constant derivative 24 so its signed error equals the norm. The sample-value factor is a separate operator bound.
| Quantity | Exact result |
|---|---|
| Physical interval | [-1, 1] |
| Reference coordinate | t=(x−0)/1 |
| Reference monic Legendre product | t²−1/3 |
| Physical nodes | −1/√3, 1/√3 |
| Reference / physical weights | (1, 1) / (1, 1) |
| Last exact / first nonexact degrees | 3 / 4 |
| Integral / rule | (2/5, 2/9) |
| Signed I−Q | 8/45 |
| Reference / physical monic squared norm | (8/45, 8/45) |
| Power of half-width in physical norm | 5 |
| Physical derivative and coefficient | 24; 1/135 |
| Fixed-node value amplification | 2ε |
Exact inputs and supporting calculations
| Parameter | Value |
|---|---|
| n | 2 |
| center | 0 |
| scale | 1 |
For weight one on [-1, 1], the usual Legendre normalization has leading coefficient c_n=2^(-n)·binom(2n, n). Rodrigues' formula and n integrations by parts give ∫P_L, n²=(c_n/2^n)∫(1-x²)^n=2/(2n+1); the boundary terms vanish because (x²-1)^n has zeros of order n. Here the last integral follows from J_0=2 and J_n=[2n/(2n+1)]J_(n-1). Thus the monic norm is 2/[(2n+1)c_n²]. Mapping to [a, b] multiplies the error constant by ((b-a)/2)^(2n+1), retaining the correct derivative and interval factors. For the Gaussian remainder and monic Legendre norm, see [Quadrature](https://dlmf.nist.gov/3.5); the Hermite argument and affine scaling above retain the real smoothness and positivity assumptions.
Endpoint corrections and the trapezoidal expansion
Take a uniform partition of width h=(b-a)/N and f∈C⁶[a, b]. On a cell centered at c, Taylor expansion through degree five, with bounded sixth derivative, gives T_cell-I_cell=h³f''(c)/12+h⁵f^(4)(c)/480+O(h⁷). Odd powers cancel in the symmetric endpoint average and integral. Uniform derivative bounds make the remainder constant independent of the cell as h tends to zero.
The endpoint derivative differences on that cell satisfy Δf'=h f''(c)+h³f^(4)(c)/24+O(h⁵) and Δf'''=h f^(4)(c)+O(h³). Consequently (h²/12)Δf'-(h⁴/720)Δf''' has the same h³ term and the h⁵ coefficient 1/288-1/720=1/480. Its difference from T_cell-I_cell is O(h⁷), rather than an unexplained endpoint correction.
Sum across the N cells. The derivative differences telescope, and N·O(h⁷)=O(h⁶) on this fixed interval. Therefore T_h-I=h²[f'(b)-f'(a)]/12-h⁴[f'''(b)-f'''(a)]/720+O(h⁶). Subtracting the displayed endpoint terms from T_h gives a corrected rule whose truncation is O(h⁶) under these hypotheses. Uncertain derivative values would contribute their own weighted data errors.
If the endpoint derivatives match, the associated terms vanish. Matching just these terms proves only the remaining order supplied here, not geometric or exponential convergence for every periodic function. Higher smoothness permits further justified corrections; analytic convergence statements need additional complex-domain hypotheses. The expansion is a controlled small-h result for this equal-mesh family, not an automatic property of arbitrary continuous or singular data. For endpoint-correction and even-power expansion context, see [Quadrature](https://dlmf.nist.gov/3.5); the C⁶ cell calculation above fixes the coefficients and the actual remaining order.
Richardson cancellation and composite Simpson
Suppose the equal-mesh trapezoidal family has T_h=I+c₂h²+c₄h⁴+O(h⁶), with coefficients fixed by the integrand and endpoints. Halving the step gives T_(h/2)=I+c₂h²/4+c₄h⁴/16+O(h⁶). Thus R_h=(4T_(h/2)-T_h)/3=I-c₄h⁴/4+O(h⁶). Cancellation of the h² term is an algebraic consequence of a justified shared expansion, not an inference from two numerically close outputs.
There is also an exact rule identity independent of smoothness. On each coarse interval of width h, the fine trapezoid is (h/4)[f(left)+2f(mid)+f(right)] and the coarse trapezoid is (h/2)[f(left)+f(right)]. Their extrapolated combination is (h/6)[f(left)+4f(mid)+f(right)], exactly one Simpson panel. Summing gives composite Simpson with node spacing h/2.
This identity shows that the final function-value weights are positive even though the formula combines two estimates with a negative coefficient. If the same stored endpoint values are reused, their correlations are already included by combining the actual weights. If T_h and T_(h/2) instead have independently supplied aggregate uncertainty bounds ε_c and ε_f, a safe propagated bound is (ε_c+4ε_f)/3; one cannot silently assume cancellation of those independent errors.
For one panel of total width H the signed remainder is −H⁵ f⁽⁴⁾(ξ)/2880. The two half-width panels together give one sixteenth of the coarse error for this constant fourth derivative. The factor-fifteen correction is exact here. For a general integrand the difference is an estimate under a justified expansion or a controlled remainder.
| Quantity | Exact result |
|---|---|
| Integral | 2/5 |
| Coarse / refined quadrature | (2/3, 5/12) |
| Coarse / refined signed errors | (−4/15, −1/60) |
| Coefficients multiplying fourth derivative | (−1/90, −1/1440) |
| Fourth derivative | 24 |
| Coarse-to-fine signed error ratio | 16 |
| Refined minus coarse | −1/4 |
| Signed fine error from difference / 15 | −1/60 |
| Corrected quadrature / signed error | (2/5, 0) |
Exact inputs and supporting calculations
| Parameter | Value |
|---|---|
| a | 1 |
| Physical node | Sample | Weight |
|---|---|---|
| −1 | 1 | 1/3 |
| 0 | 0 | 4/3 |
| 1 | 1 | 1/3 |
| Physical node | Sample | Weight |
|---|---|---|
| −1 | 1 | 1/6 |
| −1/2 | 1/16 | 2/3 |
| 0 | 0 | 1/3 |
| 1/2 | 1/16 | 2/3 |
| 1 | 1 | 1/6 |
For a quadratic the trapezoidal h² error is exact and the extrapolate is exact. For more general data, the fourth-order conclusion still depends on sufficient smoothness or a separate Simpson remainder bound. A polynomial identity between rules does not create a derivative bound where none exists, and repeated extrapolation cannot be justified for an unspecified error expansion merely by continuing the pattern of powers. For Richardson and Simpson extrapolation, see [Quadrature](https://dlmf.nist.gov/3.5); [Adaptive integration](https://fncbook.com/matlab/adaptive/); the nested-weight identity is algebraic, while its accuracy conclusion still needs an applicable remainder.
An adaptive difference is usually an estimator
Assume a fixed-interval Simpson family satisfies S_h=I+c h⁴+R_c and S_(h/2)=I+c h⁴/16+R_f, with R_c, R_f=O(h⁶). Then D=S_(h/2)-S_h=-15c h⁴/16+R_f-R_c, while the fine error is I-S_(h/2)=-c h⁴/16-R_f. Hence the leading signed fine error is D/15, and the usual magnitude indicator is |D|/15.
The exact discrepancy between that estimate and the true fine error is (R_c-16R_f)/15. Therefore verified bounds on R_c and R_f give |I-S_(h/2)-D/15|≤(|R_c|+16|R_f|)/15. The corrected value S_(h/2)+D/15 cancels the leading fourth-order term under the stated expansion. Without such remainder information, neither the fine estimate nor its correction is an unconditional error certificate; when c=0 the leading ratio can be especially misleading.
A finite-sample obstruction makes the limitation concrete. For the five combined nodes 0, 1/4, 1/2, 3/4, 1, let g(x)=∏_(j=0)^4(x-j/4)². Both Simpson estimates are zero, yet g is a nonnegative polynomial positive on subintervals and thus has positive integral. Positive multiples preserve the zero sampled estimates while increasing the true integral arbitrarily. This refutes a universal certificate based only on those samples over an unrestricted smooth class.
The counterexample does not contradict a verified derivative bound, a quantitative function class or a correctly bounded asymptotic remainder, because multiplying g changes those quantities. Adaptive comparison is often useful for allocating effort, but an output should identify it as an estimator when that is the available evidence. A certified acceptance decision needs a justified upper bound for the actual class, including data and arithmetic, rather than solely a small observed difference. For the Simpson difference estimate, see [Adaptive integration](https://fncbook.com/matlab/adaptive/); the explicit remainder discrepancy and invisible-polynomial example explain when an estimate is not a certificate.
Local error budgets add globally
Partition [a, b] into cells and suppose each exact cell integral I_i has an approximation Q_i with a proved absolute error bound ε_i≥0. Then |I-ΣQ_i|=|Σ(I_i-Q_i)|≤Σε_i. This remains true for an adaptively chosen partition if the actual final cells each satisfy their claimed hypotheses and bounds. The triangle inequality does not require the errors to be independent or random.
A simple deterministic allocation for a target τ is τ_i=τ h_i/(b-a). These budgets sum to τ, so certifying every ε_i≤τ_i suffices for the truncation target. Other allocations are possible, but replacing upper bounds by heuristic indicators changes the nature of the conclusion. If noisy values or summation also contribute, allocate a remaining budget for them rather than letting the cell truncation bounds consume the entire requested total tolerance.
Repeated endpoint evaluations can be reused when they refer to the same function, argument, parameters, data version and relevant arithmetic assumptions. A saved value is not valid evidence for an altered integrand or changed precision merely because its node label is the same. Cached derivative or interval bounds likewise require unchanged domains and dependencies. This is an economical reuse rule grounded in identity of the mathematical inputs, not permission to skip new local checks.
A maximum depth, time limit, evaluation cap or minimum representable interval width is a work constraint. If it stops refinement before all required bounds fit their budgets, report that distinct outcome and preserve the unresolved cells and current estimates. Do not relabel it tolerance achieved. The same separation applies to a failed derivative enclosure or a domain singularity: retaining partial work is useful, but it does not complete the missing proof. For recursive adaptive subdivision, see [Adaptive integration](https://fncbook.com/matlab/adaptive/); the certified sum above requires actual cell bounds and a total budget that also accounts for data and arithmetic.
A change of variables can regularize an endpoint
For the improper integral of x^(-α) on [0, 1], take a power substitution x=t^p with finite p>0. On positive truncated endpoints the usual change of variables gives x^(-α)dx=p t^(p(1-α)-1)dt. Set γ=p(1-α)-1. For α<1, γ>-1, and both improper integrals converge; integrating gives the common value 1/(1-α). Passing to the endpoint is justified through the truncated identities and their limits.
Integrability requires only γ>-1, while boundedness at zero requires γ≥0. Differentiability is stronger: a nonnegative integer γ gives a polynomial, whereas a noninteger γ gives a C^m extension when γ>m. Thus making the exponent less singular does not automatically provide the fourth or higher derivatives demanded by a high-order quadrature remainder. For a target with an additional amplitude factor, the smoothness of its composition with t^p must also be checked.
For this pure power, choosing p=1/(1-α) gives γ=0 and the transformed integrand is the constant p. Its value at t=0 is defined by that limit, not by multiplying an infinite x^(-α) evaluation by a zero Jacobian. For α=3/4, p=4 gives the continuous constant 4; p=2 instead gives 2t^(-1/2), which remains integrable but unbounded and cannot simply be supplied to an endpoint rule as a finite function.
If α=1 the transformed exponent is -1 for every finite p and the integral is still logarithmically divergent. If α>1 it is even less than -1. A legitimate substitution cannot repair divergence of this positive improper integral; discarding or assigning a finite endpoint value does not alter its behavior on a whole neighborhood. Regularization here means exposing a convergent target in a numerically smoother form, not changing the scientific quantity. For endpoint singularities and changes of variables, see [Improper integrals](https://fncbook.com/improper/); the power calculation above determines both integrability and the transformed endpoint regularity.
Infinite intervals and tail certificates
For an integral over [0, ∞), set x=t/(1-t) on 0≤t<1. Then dx=dt/(1-t)², so the transformed integrand is g(t)=f(t/(1-t))/(1-t)². The substitution is first an identity on finite truncated intervals. Only a justified limit at infinity turns it into the desired improper integral; changing the domain to a compact interval does not itself prove convergence or smoothness at t=1.
For f(x)=(1+x)^(-s), the formula simplifies exactly to g(t)=(1-t)^(s-2). It is integrable precisely when s>1, giving I=1/(s-1). Boundedness at t=1 requires s≥2. For a noninteger exponent s-2, a C^m extension requires s-2>m; nonnegative integer exponents are polynomials and are smooth. Thus a convergent infinite tail can become an integrable but still singular finite endpoint.
A different strategy truncates at a finite R>0. If a proved bound |f(x)|≤Cx^(-p) holds for all x≥R with C≥0, p>1, then |∫_R^∞f|≤∫_R^∞|f|≤CR^(1-p)/(p-1). Add this tail bound to the independently justified finite-interval quadrature and data bounds. Estimating a decay exponent from a few samples is not evidence that the inequality holds on the entire infinite tail.
When signs or oscillation cause conditional convergence, an absolute power-tail estimate may be unavailable even though the improper integral exists; a separate convergence and remainder argument is needed. For positive algebraic tails, choosing a large cutoff reduces the tail but can make uniform finite-interval sampling inefficient. The scientifically useful choice is one with a stated transformed regularity or tail certificate, not merely a finite returned sum. For infinite-domain truncation and transformed integrands, see [Improper integrals](https://fncbook.com/improper/); the tail majorant must hold beyond every point of the discarded interval.
Oscillation and unresolved sampling
Let g∈C¹[a, b] and real ω≠0. Integration by parts gives ∫_a^b g(x)e^(iωx)dx=[g(x)e^(iωx)/(iω)]_a^b-(1/(iω))∫_a^b g'(x)e^(iωx)dx. Hence the magnitude is at most (|g(a)|+|g(b)|+∫|g'|)/|ω|. The bound uses known phase and amplitude regularity, and can be loose when endpoint terms cancel; real and imaginary parts give corresponding sine and cosine integrals.
Repeated integration by parts requires the corresponding additional derivatives and controls their endpoint terms and remainder. For a polynomial amplitude, the moments J_k=∫_a^b x^k e^(iωx)dx satisfy J_0=(e^(iωb)-e^(iωa))/(iω) and J_k=[x^k e^(iωx)/(iω)]_a^b-[k/(iω)]J_(k-1). This identity can integrate a known oscillatory factor exactly against an approximated amplitude; amplitude approximation and arithmetic still need separate bounds.
At the grid x_j=j/N on [0, 1], the nonconstant function e^(i2πNx) has value 1 at every node. Its integral is zero, but a constant-exact grid rule returns 1. The real cosine has the same failure. Thus unresolved sampling can alias an oscillation to a constant; agreement of coarse-looking samples supplies no universal resolution certificate. A quantitative frequency or function-class hypothesis is needed to exclude this indistinguishable behavior.
Near ω=0 the displayed moment formulas contain subtractive cancellation and division by a small frequency, even though the integral itself has a regular limit. A suitable implementation must use a justified small-frequency representation, such as a bounded exponential-series expansion, rather than assuming that an exact identity is uniformly stable. Likewise a 1/|ω| bound concerns the actual oscillatory integral, not automatically the error of a quadrature rule that aliases it. For oscillatory quadrature context, see [Quadrature](https://dlmf.nist.gov/3.5); the known-phase integration-by-parts and alias arguments above identify information that finite unresolved samples cannot supply.
Monte Carlo bounds require a probability model
Let U_1, …, U_N be independent identically distributed uniform variables on [a, b], with length ℓ=b-a>0, and let f be real and integrable. The estimator Q_N=(ℓ/N)Σ_i f(U_i) has E[Q_N]=ℓE[f(U)]=∫_a^b f. This is an unbiasedness statement under a specified probability distribution, not a claim that every realized estimate equals or brackets the integral.
If f is also square-integrable and σ²=Var(f(U)) is finite, independence removes the cross covariances and gives Var(Q_N)=ℓ²σ²/N. The root mean square error is ℓσ/√N. Chebyshev therefore gives P(|Q_N-I|≥τ)≤ℓ²σ²/(Nτ²) for τ>0, or the same bound with any proved upper bound on σ². A displayed upper bound exceeding one is simply uninformative and can be clipped at one.
A sample variance estimates σ² but is not automatically a rigorous upper bound on it. Substituting it into this inequality without a justified confidence argument changes the guarantee. Dependence between draws introduces covariance terms, and biased sampling requires the appropriate weights and integrability conditions. A deterministic box of evaluation errors is a different uncertainty model and generally contributes its worst-case weighted bound rather than shrinking as N^(-1/2).
The guarantee has a failure probability and must state it alongside the tolerance and assumptions. It is distinct from a deterministic derivative-based certificate and does not excuse missing convergence of an improper integral or infinite variance. Data, random sampling and arithmetic contributions can be combined only through an explicit total-error argument. No random execution is needed to derive the expectation, variance or Chebyshev bounds used here. For iid Monte Carlo expectation, variance and RMSE, see [Simple Monte Carlo](https://artowen.su.domains/mc/Ch-intro.pdf); the probability guarantee here uses a known finite variance rather than a sample variance treated as an upper bound.
An initial-value problem as an integral fixed point
Consider y'=F(t, y), y(t₀)=y₀ in a finite-dimensional normed state space. Suppose F is continuous on [t₀, t₀+H]×B̄(y₀, R), bounded by M there and uniformly Lipschitz in y with constant L≥0. Choose 0<h≤H with hM≤R and hL<1. Let X be the closed set of continuous functions on [t₀, t₀+h] staying within R of y₀, equipped with the supremum norm. It is complete as a closed subset of a complete continuous-function space.
Define (Tv)(t)=y₀+∫_(t₀)^t F(s, v(s))ds. Boundedness gives ||Tv-y₀||∞≤hM≤R, so T maps X into itself. Lipschitz continuity gives ||Tv-Tw||∞≤hL||v-w||∞. The contraction theorem established in the fixed-point lesson therefore supplies one fixed point in X, with uniqueness there. The strict contraction bound is essential; boundedness alone does not imply uniqueness.
The fixed-point integral has a continuous integrand, so differentiation gives a C¹ solution of the IVP. Conversely every solution remaining in the rectangle satisfies the integral equation and thus is that fixed point on this interval. One can also bound Picard-iteration differences by the contraction estimates from the earlier lesson. Those are estimates for solving this integral equation, distinct from a time-stepping discretization error.
This is local existence and uniqueness. Extending the solution requires new domains on which the field and bounds remain valid; a trajectory can leave the rectangle or blow up in finite time. The case y'=y², y(0)=1 has solution 1/(1-t) only before t=1, despite a perfectly regular local field around the initial state. A numerical method returning values past a singularity does not supply the missing mathematical continuation. For the local Picard setting, see [Numerical Solution of Differential Equations I](https://www.numerical.rl.ac.uk/media/people/tyrone-rees/nsde/notes/NSDE1_2016.pdf); the invariant function-space contraction above gives the precise sufficient interval used in this proof.
Gronwall separates initial and forcing uncertainty
Let two existing trajectories share a domain where F is Lipschitz with constant L≥0, and suppose their initial difference is at most a. If their vector-field discrepancy along the comparison is bounded by d(t)≥0, their norm difference u(t) satisfies u(t)≤a+∫_(t₀)^t[L u(s)+d(s)]ds. This follows by subtracting their integral equations, adding and subtracting the same F at the second state, then using the triangle and Lipschitz inequalities.
For continuous u and integrable d, define v(t)=a+∫[Lu+d]. Then u≤v and v'≤Lv+d almost everywhere. Multiplying by e^(-L(t-t₀)) and integrating gives u(t)≤a e^(L(t-t₀))+∫_(t₀)^t e^(L(t-s))d(s)ds. This proves the integral Gronwall estimate rather than assuming that each discrepancy is introduced only at the initial time.
For constant d≤D and L>0, the forcing contribution is at most D(e^(LΔt)-1)/L. When L=0 the direct expression is a+DΔt; it also equals the continuous limiting formula but must not be evaluated as division by zero. Initial uncertainty and persistent model or solve forcing are different terms, propagated for different durations. If t has time units, L has inverse-time units and d has state-per-time units.
The bound is conditional on both compared trajectories existing in the common controlled domain; it does not itself prove global existence. It can also be pessimistic when the field is dissipative, for which a one-sided estimate may replace a positive norm Lipschitz amplification. Nevertheless it gives a transparent finite-time way to separate initial data, field perturbations and subsequent numerical forcing without attributing all discrepancies to a single step size. For Lipschitz error amplification context, see [Numerical Solution of Differential Equations I](https://www.numerical.rl.ac.uk/media/people/tyrone-rees/nsde/notes/NSDE1_2016.pdf); the continuous comparison above explicitly integrates persistent forcing and its remaining propagation time.
Euler consistency and global error
For explicit Euler, Y_(n+1)=Y_n+hF(t_n, Y_n)+δ_n, let δ_n denote an already bounded state-update perturbation. Along a true C² trajectory with ||y''||≤M, the true-start defect d_n=y(t_n+h)-y(t_n)-hF(t_n, y(t_n)) equals ∫₀^h(h-s)y''(t_n+s)ds, so ||d_n||≤Mh²/2. This is a local state defect, not the same as a residual divided by h.
Suppose the exact and computed states stay in a common domain with state Lipschitz constant L. For e_n=y(t_n)-Y_n, subtraction gives ||e_(n+1)||≤(1+Lh)||e_n||+Mh²/2+||δ_n||. Iteration propagates the initial error by (1+Lh)^N≤e^(LT), where T=Nh, and propagates each subsequent defect by the remaining powers. The recurrence explains how locally second-order defects accumulate into a globally first-order error.
For L>0 the truncation contribution is at most [Mh/(2L)]((1+Lh)^N-1)≤Mh(e^(LT)-1)/(2L). The full bound adds e^(LT)||e_0|| and Σ_(j=0)^(N-1)e^(L(T-t_(j+1)+t₀))||δ_j||, with times measured from t₀. For L=0, use the direct sum MTh/2 and the unweighted perturbation sum. Thus zero initial error and vanishing extra forcing give O(h) on a fixed interval.
A vector-field evaluation error bounded by D_j contributes a state perturbation hD_j, while a nonlinear solve or rounding error may enter differently. Each must be converted to the units and location actually used in the recurrence. The domain and derivative bounds must remain valid for the compared states; neither local consistency nor a small step proves this automatically. This argument concerns finite-time convergence, not unrestricted stability for a stiff problem at a chosen finite step. For Euler's local and global error framework, see [Numerical Solution of Differential Equations I](https://www.numerical.rl.ac.uk/media/people/tyrone-rees/nsde/notes/NSDE1_2016.pdf); the normalized residual and the local state defect differ by a factor of the step width.
A general one-step convergence argument
Let a one-step map Ψ_h(t, v) satisfy ||Ψ_h(t, v)-Ψ_h(t, w)||≤(1+Kh)||v-w|| for 0<h≤h₀, with K≥0 uniform on a stated common domain. Assume the exact trajectory's one-step defect is at most C h^(p+1), with p≥1 and C uniform. For computed updates Y_(n+1)=Ψ_(h_n)(t_n, Y_n)+δ_n, the error recurrence is E_(n+1)≤(1+Kh_n)E_n+C h_n^(p+1)+||δ_n||.
On a fixed interval of duration T, products of the factors obey ∏(1+Kh_n)≤exp(KΣh_n)=e^(KT). Also Σh_n^(p+1)≤h_max^pΣh_n=T h_max^p. Unrolling the recurrence therefore gives E_N≤e^(KT)[E_0+CT h_max^p+Σ||δ_n||]. This elementary bound permits nonuniform steps and displays explicitly which constants must remain independent of the refinement.
With E_0=O(h_max^p) and total update perturbation Σ||δ_n||=O(h_max^p), the method is globally order p on that interval. On a uniform mesh, per-step perturbations O(h^(p+1)) suffice; a fixed perturbation ε per update instead permits an Nε worst-case accumulation. A small algebraic stage residual must first be converted to a state error using an actual inverse or contraction bound; a raw residual is not automatically δ_n.
The one-step Lipschitz and defect assumptions are separate facts to establish for each method and domain. A matching scalar test polynomial alone does not verify them for a nonlinear vector field. Domain escape, failed stages, unbounded constants or a finite-time singularity invalidate this uniform refinement argument. Under its stated hypotheses, however, the same propagation proof can be reused without repeating the convergence derivation for every new method. For one-step consistency and propagation, see [Numerical Solution of Differential Equations I](https://www.numerical.rl.ac.uk/media/people/tyrone-rees/nsde/notes/NSDE1_2016.pdf); the uniform map and domain assumptions above also identify how solve and arithmetic perturbations enter.
Second-order Runge–Kutta methods
For nonautonomous y'=F(t, y), assume F∈C² with bounded derivatives on a neighborhood containing the exact segment and all trial stages. Along the exact trajectory, y''=F_t+F_yF, so y(t+h)=y+hF+(h²/2)(F_t+F_yF)+O(h³). All derivatives here are evaluated at the starting point; F_y is a linear map acting on the state slope, and the time derivative must not be omitted.
Heun uses k_1=F(t, y), k_2=F(t+h, y+hk_1), and y_new=y+h(k_1+k_2)/2. Multivariable Taylor expansion gives k_2=F+h(F_t+F_yF)+O(h²), so the update matches the displayed exact expansion through h². Explicit midpoint uses k_2=F(t+h/2, y+(h/2)F) and y_new=y+hk_2, giving the same matching coefficients. Each has local state defect O(h³) under these uniform assumptions.
If F is L-Lipschitz in state on the needed stage domain, comparing two starts at the same time bounds either update's Lipschitz factor by 1+hL+h²L²/2. For example, Heun's second slope differs by at most L(1+hL) times the initial difference; averaging the two slopes gives that expression. For h≤h₀ it is at most 1+Kh with K=L+h₀L²/2, so the previous one-step argument yields global order two with suitably accurate starts and bounded perturbations.
These explicit stages require no nonlinear solve, but still require valid function evaluations and the stated common domain. Omitting the stage time advance can destroy second order for a time-dependent field. The difference from an Euler update is typically O(h²), which can be useful as a local indicator but is not automatically the higher method's O(h³) defect; a later adaptive controller must identify which quantity its exponent actually estimates. For explicit midpoint and improved-Euler stages, see [Numerical Solution of Differential Equations I](https://www.numerical.rl.ac.uk/media/people/tyrone-rees/nsde/notes/NSDE1_2016.pdf); matching the full nonautonomous Taylor terms is what establishes the second-order local expansion.
Why the classical four-stage method is fourth order
Adjoin time to the state, x=(t, y), to write an autonomous field f(x)=(1, F(t, y)). Assume f∈C⁴ with bounded derivatives on a neighborhood containing the exact segment and all small-step stages. At the starting state write f for its value, A=f', B=f'' and C=f''', where B and C are symmetric multilinear maps. Classical RK4 uses k₁=f, k₂=f(x+hk₁/2), k₃=f(x+hk₂/2), k₄=f(x+hk₃), and x_new=x+h(k₁+2k₂+2k₃+k₄)/6. The appended time coordinate advances exactly by h.
Multivariable Taylor expansion gives k₂=f+(h/2)Af+(h²/8)B[f, f]+(h³/48)C[f, f, f]+O(h⁴). Substituting that stage into the next gives k₃=f+(h/2)Af+h²(A²f/4+B[f, f]/8)+h³(A B[f, f]/16+B[f, Af]/8+C[f, f, f]/48)+O(h⁴). The last stage is k₄=f+hAf+h²(A²f/2+B[f, f]/2)+h³(A³f/4+A B[f, f]/8+B[f, Af]/2+C[f, f, f]/6)+O(h⁴). These distinct compositions cannot all be tested by a scalar linear equation.
The weighted update is x+hf+(h²/2)Af+(h³/6)(A²f+B[f, f])+(h⁴/24)(A³f+A B[f, f]+3B[f, Af]+C[f, f, f])+O(h⁵). Along the exact trajectory, successive differentiation gives x''=Af, x'''=A²f+B[f, f] and x''''=A³f+A B[f, f]+3B[f, Af]+C[f, f, f]. Thus every vector Taylor term through degree four matches. Bounded fourth derivatives of f give the required bounded fifth trajectory derivative and stage remainder, hence local state defect O(h⁵).
If f is L-Lipschitz on the common stage domain, stage-by-stage comparison bounds the update factor by 1+hL+(hL)²/2+(hL)³/6+(hL)⁴/24. For h≤h₀ this is at most 1+Kh with fixed K. The one-step convergence argument therefore yields fourth-order finite-time error with appropriately accurate initial values and controlled update perturbations. Domain validity, arithmetic and stage evaluations remain hypotheses; agreement of R(z) with four exponential coefficients alone would omit the nonlinear derivative combinations proved above. For the classical four-stage formula, see [Numerical Solution of Differential Equations I](https://www.numerical.rl.ac.uk/media/people/tyrone-rees/nsde/notes/NSDE1_2016.pdf); the complete vector derivative comparison above establishes fourth order beyond the scalar linear test.
Absolute stability tests a particular equation
For the scalar test y'=λy with constant possibly complex λ, a fixed one-step method gives Y_(n+1)=R(z)Y_n, z=hλ. Its powers stay bounded when |R(z)|≤1 and decay when |R(z)|<1; on |R|=1 they need not decay. A convention using the strict inequality describes the decay region, while its closed bounded-amplification counterpart includes the boundary. The nondimensional product hλ, not h or λ separately, controls this test.
Substitution into the explicit stages gives R_E(z)=1+z, R_Heun(z)=1+z+z²/2 and R_RK4(z)=1+z+z²/2+z³/6+z⁴/24. For λ=-α with α>0, Euler is bounded precisely for 0<hα≤2, and decays for 0<hα<2. At hα=2 its factor is -1, so a physically decaying mode merely alternates. The higher polynomials have their own stability regions, rather than inheriting Euler's interval or a universal stable step.
Stability does not measure accuracy: a bounded factor can be far from e^z, especially for a transient one wishes to resolve. A positive real λ represents actual growth and is not a decaying test that a useful method should artificially suppress. Initial-data amplification over a fixed interval, asymptotic decay at fixed h and convergence as h→0 are related but distinct questions.
Separate the signed state error from the finite-time bound Mh(e^(LT)−1)/(2L) for T=2h and zero initial error, with L=α and M=α². The scalar recurrence also gives (1+|R|)Mh²/2. These bounds apply with exact data and updates; bounded or stable amplification does not guarantee a small discretization error.
| Quantity | Exact result |
|---|---|
| Times | (0, 1/4, 1/2) |
| z=−αh, R=1+z, |R| | (−1/2, 1/2, 1/2) |
| Numerical states | (1, 1/2, 1/4) |
| Exponential reference | 1, exp(−1/2), exp(−1) |
| Signed errors yₖ−y(tₖ) | 1/2 − exp(−1/2); 1/4 − exp(−1) |
| Two-step signed error | Negative |
| Stability | Strict scalar decay |
| L and exact second derivative bound M | 2, 4 |
| One-step defect bound Mh²/2 | 1/8 |
| Two-step scalar recurrence bound | 3/16 |
| Separate global Lipschitz bound | (e−1)/4 |
Exact inputs and supporting calculations
| Parameter | Value |
|---|---|
| rate | 2 |
| h | 1/4 |
For matrices, eigenvalue tests can miss the size of transients and the effect of nonnormality. For example, A=[[-1, K], [0, -1]] has e^(tA)=e^(-t)[[1, Kt], [0, 1]], allowing large finite-time amplification despite its negative eigenvalues. Jordan blocks at a unit-modulus discrete factor can also cause growing powers. A scalar region is therefore one diagnostic, not a complete nonlinear or nonnormal stability theorem; the norm, basis conditioning and actual propagator matter. For scalar absolute stability, see [Numerical Solution of Differential Equations I](https://www.numerical.rl.ac.uk/media/people/tyrone-rees/nsde/notes/NSDE1_2016.pdf); bounded amplification, strict decay and a finite-time accuracy claim remain different conditions.
Backward Euler and strong stiff damping
Backward Euler solves Y_new=Y+hF(t+h, Y_new). The exact trajectory gives a local state-equation defect O(h²) under bounded y'', so the method is first order when the corresponding stable one-step map and domain bounds hold. Unlike explicit Euler, each step may require a nonlinear solve; writing its equation is not evidence that a unique solution exists or has been computed accurately.
For the linear test, solving (1-z)Y_new=Y gives R(z)=1/(1-z). When Re z≤0, |1-z|²=(1-Re z)²+(Im z)²≥1, and the denominator is nonzero. Thus |R(z)|≤1 on the entire left half-plane, the A-stability property. Moreover R(z)→0 as |z|→∞ there, giving L-stability: very stiff scalar decaying modes are strongly damped by each step.
For a general field, the stage fixed-point map v↦Y+hF(t+h, v) is a contraction if hL<1, provided it maps a specified complete invariant set into itself. A globally L-Lipschitz field on the entire state space supplies a self-map directly; a local domain needs the invariance check. This is sufficient, not necessary: a linear negative λ has a unique backward-Euler stage for every positive h, including steps where h|λ|≥1.
If an exact stage v* exists and a stored v has equation residual ρ=v-Y-hF(t+h, v), the same contraction bound gives ||v-v*||≤||ρ||/(1-hL) when hL<1 and the comparison remains in the controlled domain. Outside that case a justified inverse or one-sided bound is needed. A-stability of the scalar formula does not establish global nonlinear solvability, physical transient accuracy or a state-error certificate from an unscaled residual. For backward Euler and left-half-plane stability, see [Numerical Solution of Differential Equations I](https://www.numerical.rl.ac.uk/media/people/tyrone-rees/nsde/notes/NSDE1_2016.pdf); nonlinear stage existence and residual conditioning require the separate bounds stated above.
The trapezoidal ODE method is A-stable but not L-stable
The implicit trapezoidal method is Y_new=Y+(h/2)[F(t, Y)+F(t+h, Y_new)]. Applying the scalar trapezoidal integral remainder to the true time derivative y' gives a local state-equation defect O(h³) when y''' is uniformly bounded. A contraction hL/2<1 with an invariant stage domain gives a unique local step, and comparing two starts bounds its Lipschitz factor by (1+hL/2)/(1-hL/2). With h≤h₀ and h₀L/2<1 this is 1+O(h), so the earlier propagation argument yields global order two.
On y'=λy the amplification is R(z)=(1+z/2)/(1-z/2). In the left half-plane the denominator does not vanish, and |1-z/2|²-|1+z/2|²=-2Re z≥0. Hence |R(z)|≤1 for Re z≤0, proving A-stability. This property concerns the specified scalar test and assumes the implicit equation has actually been solved.
Along the negative real axis, however, R(z) tends to -1 as z tends to -∞. Thus very stiff decay is represented by a nearly undamped alternating component rather than rapid elimination. The method is not L-stable. A nonzero high-frequency initial perturbation or solve error can therefore persist visibly even though the scalar stability inequality is satisfied.
For the oscillator and other imaginary-axis modes the same formula has unit modulus, which can be useful for geometry but is not a claim of exact phase. Method choice must distinguish preserving oscillations from damping physically decaying fast modes. Nonlinear stage residuals, conditioning and arithmetic remain separate terms; neither second-order consistency nor A-stability turns an unresolved transient into an accurate one. For the implicit trapezoidal and theta-method framework, see [Numerical Solution of Differential Equations I](https://www.numerical.rl.ac.uk/media/people/tyrone-rees/nsde/notes/NSDE1_2016.pdf); the rational amplification calculation above explains A-stability without strong stiff damping.
Stiffness separates resolution from explicit stability
Consider y'=diag(-1, -1000)y. Its exact components decay on timescales 1 and 1/1000. Euler's fast-mode boundedness requires h≤2/1000, with strict inequality for decay. This restriction can be much smaller than the scale on which the slow scientific component changes, even after the true fast component has become negligible. That separation between explicit stability and the resolution needed for a selected output is a characteristic manifestation of stiffness.
Backward Euler remains scalar-stable for every h>0, but a large stable step does not resolve the initial fast transient. For h=1/10 its fast factor is 1/101 while the exact factor is e^(-100); these are both small but not close on a relative scale. The trapezoidal factor is (1-50)/(1+50)=-49/51, whose magnitude is near one and whose alternating sign can preserve a spurious fast remnant.
Whether the unresolved fast component is acceptable depends on the output, the initial layer and the requested absolute or relative tolerance. A scientifically justified reduction or an initial transient treatment is different from assuming that all implicit steps are accurate because they are stable. Nonlinear solves also have a cost and error budget that must be weighed against the explicit restriction, rather than omitted from the comparison.
With z=−αh, the factors are 1+z, 1/(1−z), and (1+z/2)/(1−z/2). Along the negative real axis the exact decay tends to zero from above. Backward Euler damps stiff modes, whereas trapezoid tends to −1 and explicit Euler grows in magnitude. Such scalar stability and damping properties do not certify time resolution, finite-time accuracy, or behavior for a different system.
| Method | R | |R| | States at 0, h, 2h | Scalar behavior | Signed error at h | Signed error at 2h |
|---|---|---|---|---|---|---|
| Explicit Euler | −19 | 19 | (1, −19, 361) | Unstable scalar amplification | −19 − exp(−20) | 361 − exp(−40) |
| Backward Euler | 1/21 | 1/21 | (1, 1/21, 1/441) | Strict scalar decay | 1/21 − exp(−20) | 1/441 − exp(−40) |
| Implicit trapezoid | −9/11 | 9/11 | (1, −9/11, 81/121) | Strict scalar decay | −9/11 − exp(−20) | 81/121 − exp(−40) |
Exact inputs and supporting calculations
| Parameter | Value |
|---|---|
| rate | 40 |
| h | 1/2 |
| Quantity | Exact result |
|---|---|
| Exact time scale | 1/40 |
| Step divided by time scale | 20 |
| Times | (0, 1/2, 1) |
| Positive exponential states | 1, exp(−20), exp(−40) |
For a nonnormal matrix, negative eigenvalues and a scalar stable region do not fully control finite-time norms; the linear-algebra lesson's basis and propagator bounds remain relevant. Changing time units changes both λ and h but leaves hλ invariant. Thus stiffness is not diagnosed reliably by an isolated dimensional coefficient or a universal numerical threshold, and the simple diagonal example should not be promoted to a complete criterion for every system. For separated decay scales and common solver families, see [Numerical Solution of Differential Equations I](https://www.numerical.rl.ac.uk/media/people/tyrone-rees/nsde/notes/NSDE1_2016.pdf); [solve_ivp](https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.solve_ivp.html); an allowable stable step need not resolve the initial fast transient or a nonnormal output.
Multistep consistency and zero stability
A fixed-step k-step method has Σ_(j=0)^k α_jY_(n+j)=hΣ_(j=0)^k β_jF_(n+j), with α_k≠0. Substituting a constant exact function gives Σα_j=0; substituting a linear function gives Σjα_j=Σβ_j. These are the consistency moment conditions. More generally order p means the unscaled true-solution defect is O(h^(p+1)) under sufficient smoothness. Consistency alone says nothing about amplification of starting or rounding perturbations.
For F=0, the error recurrence is governed by ρ(ζ)=Σα_jζ^j and its companion matrix. Its powers are uniformly bounded precisely when all roots have |ζ|≤1 and every unit-modulus root is simple. A companion matrix has the full characteristic polynomial as its minimal polynomial; repeated unit roots therefore produce Jordan polynomial growth. Roots strictly inside the disk permit their Jordan factors because n^m|ζ|^n remains bounded. An exterior root gives an exponentially growing mode.
For a common Lipschitz domain and existing stages, write the perturbed error recurrence as this constant companion propagation plus h times the differences of the finite number of F values and the local defects. Variation of constants with bounded companion powers bounds it by a constant times the starting errors, Σ||defect||, and h times a sum of state errors. The finite overlap of k values only changes constants. For sufficiently small h the newest implicit error term can be absorbed; discrete Gronwall then gives a finite-time bound C_T(max_start||e_j||+Σ||defect||+Σ||extra update forcing||).
There are O(1/h) steps on a fixed interval, so defects O(h^(p+1)) sum to O(h^p). Starts of order p and suitably bounded additional forcing therefore yield global order p, provided the uniform domain, solvability and Lipschitz hypotheses persist. The root condition is necessary already for the zero equation, while higher consistency moments and accurate starts address distinct requirements. This qualified argument does not claim that moment conditions alone guarantee convergence or that a nonlinear implicit stage always exists. For multistep consistency, root conditions and convergence context, see [Numerical Solution of Differential Equations I](https://www.numerical.rl.ac.uk/media/people/tyrone-rees/nsde/notes/NSDE1_2016.pdf); the propagation argument above retains the order of the starts, defects and uniform domain bounds.
BDF2 with its startup and stability requirements
BDF2 is 3Y_(n+2)-4Y_(n+1)+Y_n=2hF(t_(n+2), Y_(n+2)). Taylor expansion about the newest exact time gives unscaled defect -(2/3)h³y'''+O(h⁴), or -(1/3)h²y'''+O(h³) after dividing by 2h. Its zero-equation polynomial is 3ζ²-4ζ+1=(ζ-1)(3ζ-1), so the roots are 1 and 1/3. The consistency and root arguments above support global order two with starts accurate to O(h²) and the usual uniform domain and solve bounds.
For the scalar test the roots satisfy (3-2z)ζ²-4ζ+1=0. They cannot be zero. If a root had |ζ|≥1, set w=1/ζ=x+iy with |w|≤1; rearranging gives z=3/2-2w+w²/2. Its real part is 3/2-2x+(x²-y²)/2≥(1-x)²≥0 because y²≤1-x². Thus for Re z<0 both roots lie strictly inside the unit disk.
On the imaginary boundary, a root with modulus at least one would force equality, x=1, y=0, w=1 and z=0. At z=0 the unit root is simple and the other root is 1/3. Hence the root criterion holds on the closed left half-plane. The explicit roots [2±√(1+2z)]/(3-2z) both tend to zero for large negative z, showing strong stiff damping in this multistep root sense; this is not an unqualified use of a one-step L-stability definition.
The nonlinear new-stage equation is Y_new=(4Y_n-Y_(n-1))/3+(2h/3)F(t_new, Y_new), so an invariant contraction with 2hL/3<1 is a sufficient local solvability condition, not a consequence of scalar stability. A poor starting value leaves a bounded but persistent unit-root error, as the solved zero-equation exercise shows. Variable-step BDF2 has different coefficients and ratio-dependent stability questions; the proof here is explicitly for fixed steps. For multistep stability and backward-differentiation context, see [Numerical Solution of Differential Equations I](https://www.numerical.rl.ac.uk/media/people/tyrone-rees/nsde/notes/NSDE1_2016.pdf); [solve_ivp](https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.solve_ivp.html); the fixed-step BDF2 coefficient and root proof above is separate from a library's variable-order implementation.
Adaptive ODE controllers must identify their error
Suppose a positive local indicator has the justified asymptotic form err≈Ch^q over a regime where C changes slowly. Solving for a target tol gives h_new=s h(tol/err)^(1/q), with a safety factor s and practical bounds. If the actual quantity is an order-p method's local state defect, then q=p+1. An embedded order-p/order-(p-1) difference instead usually has leading order h^p from the lower method, so its natural exponent is 1/p, not automatically 1/(p+1).
For a state with d≥1 differently scaled components, use positive s_i=atol_i+rtol_i max(|Y_i|, |Y_new, i|), where atol_i has that component's units and rtol_i is dimensionless. An RMS test [(1/d)Σ(err_i/s_i)²]^(1/2)≤1 bounds an individual normalized component only by √d, not necessarily by one. A componentwise guarantee needs the maximum norm or the corresponding conversion. A local scaled acceptance test is also distinct from a global trajectory bound accumulated under propagation.
Stage reuse must respect actual dependencies. A repeated starting slope can remain valid after a rejection if its time, state, field and parameters are unchanged, but step-dependent trial stages generally change with the retry. A first-same-as-last identity for a particular method applies only when its required accepted endpoint identity and inputs hold. An unexplained cache hit is not a substitute for these facts, and no universal reuse rule follows merely from an embedded pair's name.
A zero estimated difference does not prove zero true error, so the power formula needs a bounded policy rather than division by zero or unlimited growth. Rejections, minimum step size, event restrictions and evaluation budgets likewise require explicit stop reasons. Without a validated remainder and propagation argument, this controller is an efficient heuristic for local effort allocation; it does not certify every component, exclude missed events or validate an entire physical trajectory. For embedded estimates, tolerance scales and solver termination, see [Adaptive Runge–Kutta](https://fncbook.com/adaptive-rk/); [solve_ivp](https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.solve_ivp.html); the controller exponent follows the actual indicator order, and local acceptance is not a global certificate.
One-sided dissipation gives a nonlinear stability bound
Assume a real inner-product state space and a one-sided Lipschitz inequality ⟨F(t, u)-F(t, v), u-v⟩≤μ||u-v||² on the domain of interest, where μ may be negative. This controls growth in the displacement direction rather than bounding the full norm of the field difference. A dissipative field can have a large ordinary Lipschitz constant but μ≤0, so the two hypotheses support different stability estimates.
Consider existing backward-Euler stages u=u_old+hF(t_new, u)+ρ_u and v=v_old+hF(t_new, v)+ρ_v, with residuals written in state units. Put d=u-v and d_old=u_old-v_old. Taking the inner product of d=d_old+hΔF+(ρ_u-ρ_v) with d gives (1-hμ)||d||²≤(||d_old||+||ρ_u-ρ_v||)||d||. If d=0 the result is immediate; otherwise divide by its norm.
When 1-hμ>0, the bound is ||d||≤[||d_old||+||ρ_u-ρ_v||]/(1-hμ). For exact stages and μ≤0 this is nonexpansive for every h>0, and strictly contractive for μ<0 and distinct starts. Comparing an approximate stage with an exact stage at the same old value gives a residual-to-state bound ||ρ||/(1-hμ). A field discrepancy bounded by D adds hD to the numerator when the same inner-product comparison applies.
This argument is conditional on the stages existing in the controlled domain; it is not an existence theorem for arbitrary nonlinear equations. It also needs an actual residual bound, including evaluation and arithmetic if relevant. The estimate explains how nonlinear dissipation can justify a stronger result than the sufficient contraction condition hL<1, while keeping solvability, uniqueness within the valid comparison and error certification as explicit questions. For backward-Euler and Lipschitz stability context, see [Numerical Solution of Differential Equations I](https://www.numerical.rl.ac.uk/media/people/tyrone-rees/nsde/notes/NSDE1_2016.pdf); the one-sided inner-product proof above supplies the sharper conditional nonlinear comparison.
Symplectic Euler preserves geometry, not exact energy
For q'=p, p'=-ω²q with ω>0, kick-then-drift symplectic Euler is p'=p-hω²q and q'=q+hp'. In the state order (q, p), its matrix is M=[[1-h²ω², h], [-hω², 1]], whose determinant is one. For every real two-by-two matrix, MᵀJM=(det M)J with J=[[0, 1], [-1, 0]], so this proves preservation of the canonical symplectic form in this one-degree-of-freedom example.
The physical energy H=(p²+ω²q²)/2 is generally not preserved. Instead define H_h=(p²+ω²q²-hω²qp)/2. Substituting q'=q+hp' gives p'²+ω²q'²-hω²q'p'=p'²+ω²q²+hω²qp'. Substituting p'=p-hω²q then reduces it to p²+ω²q²-hω²qp, proving H_h is exactly invariant for the constant-step map in exact arithmetic.
Its symmetric quadratic matrix has determinant ω²(1-h²ω²/4), so it is positive definite precisely when |hω|<2. The cross-term bound gives (1-|hω|/2)H≤H_h≤(1+|hω|/2)H in that range. Thus this invariant controls the physical energy over repeated fixed steps without asserting that H itself is exactly constant. The positive margin degenerates at the boundary, which must not be included as though it supplied the same bound.
Ordinary explicit Euler instead has matrix [[1, h], [-hω², 1]], determinant 1+h²ω², and H_new=(1+h²ω²)H. It expands area and energy at every nonzero step. The comparison shows why preserving geometry can matter for long oscillatory trajectories, but it proves neither exact energy conservation for every symplectic method nor correctness at arbitrary step sizes. Physical units, phase error and arithmetic remain relevant. For symplectic Euler and separable Hamiltonian schemes, see [Geometric Numerical Integration, Lecture 2: Symplectic Integrators](https://unige.ch/~hairer/poly_geoint/week2.pdf); the two-dimensional matrix and modified-energy identities above give the precise oscillator conclusion.
Velocity Verlet is a reversible second-order composition
Velocity Verlet uses p_half=p-(h/2)ω²q, q'=q+h p_half and p'=p_half-(h/2)ω²q'. With z=hω its matrix is M(h)=[[1-z²/2, h], [-hω²(1-z²/4), 1-z²/2]]. Set a=1-z²/2 and g=ω²(1-z²/4); then a²+h²g=1, so det M=1. Changing h to -h reverses the off-diagonal entries and gives M(-h)=M(h)^(-1), proving reversibility of the constant-step formula.
The exact oscillator matrix has entries cos z, sin z/ω, -ω sin z, cos z. Expanding these shows that Verlet agrees through degree two in h, with local matrix error O(h³) for fixed ω. Together with a uniform small-step bound ||M(h)||≤1+Kh, the one-step propagation result yields second-order accuracy on fixed intervals. Symmetry of the composition is informative, but the actual expansion supplies the stated order for this system.
For 0<|z|<2, the trace 2-z² lies strictly between -2 and 2 and the determinant is one, so the two distinct conjugate eigenvalues have unit modulus. Moreover Mᵀdiag(g, 1)M=diag(g, 1), preserving H_h=[p²+ω²(1-z²/4)q²]/2. Since g>0 in this range, this is a positive invariant. The endpoint |z|=2 loses that positivity and can have a nontrivial repeated-mode growth, so it is excluded from this stable oscillatory conclusion.
The original H need not be exactly conserved: the solved step with ω=1, h=1/2 changes it from 1/2 to 65/128 while preserving H_h. Each prescribed step still has determinant one if its width varies, but its modified quadratic changes with h, so an arbitrary varying sequence need not preserve one common invariant. State-dependent step selection requires its own geometric analysis. Reversibility also refers to applying the matching reversed signed steps, not automatically to an adaptive controller. For Störmer–Verlet, adjoints and symmetry, see [Geometric Numerical Integration, Lecture 2: Symplectic Integrators](https://unige.ch/~hairer/poly_geoint/week2.pdf); the direct oscillator expansion and fixed-step invariant explain what is preserved and what may still have error.
Events and the limit of a trajectory
Let an event along an existing trajectory be φ(t)=g(t, y(t))=0. Suppose a selected connected interval contains the intended root t*, φ∈C¹ there, and a validated margin |φ'(t)|≥m>0 holds throughout it. Continuity prevents the derivative sign from changing on that interval. For a candidate t̂ in the same interval, the mean-value theorem therefore gives |φ(t̂)|≥m|t̂-t*|. Root existence and selection must be established separately, for example by an appropriately enclosed sign bracket.
If an evaluated event value φ̂(t̂) has proved error at most ε, then |t̂-t*|≤(|φ̂(t̂)|+ε)/m. Dense-output state uncertainty E contributes at most L_gE when g is L_g-Lipschitz in state on the relevant domain, in addition to its own evaluation uncertainty. A small root-finder residual for an unqualified interpolant is therefore not by itself a small physical event-time error.
At a grazing event φ(t)=(t-1)² the derivative margin vanishes. Perturbing to (t-1)²-ε moves roots by √ε, while adding positive ε removes real roots entirely. The linear residual-to-time estimate cannot be retained. Finite sign sampling can also miss two crossings or a tangency between samples; a returned absence of a bracket is not a universal proof of no event without additional enclosure or monotonicity information.
An event may also mark the limit of a valid trajectory rather than an ordinary crossing. For y'=y², y(0)=1, the exact solution 1/(1-t) blows up at t=1. No small local estimator, stable scalar test or finite printed step past that time extends this solution through the singularity. A useful result identifies its certified interval, event qualifications and unresolved continuation rather than treating a work limit or failed stage as successful integration. For documented event, dense-output and local-existence limitations, see [solve_ivp](https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.solve_ivp.html); [Numerical Solution of Differential Equations I](https://www.numerical.rl.ac.uk/media/people/tyrone-rees/nsde/notes/NSDE1_2016.pdf); the derivative-margin proof above adds the assumptions needed to convert an enclosed residual to a selected-time bound.
A boundary-value mesh has both discretization and solve error
For -u''=f on [0, 1] with u(0)=u(1)=0, use N≥2 equal subintervals, h=1/N and interior operator (L_hU)_i=(2U_i-U_(i-1)-U_(i+1))/h². With zero boundary components, UᵀL_hU=h^(-2)Σ_(i=0)^(N-1)(U_(i+1)-U_i)²>0 for nonzero U. Thus the real tridiagonal matrix is symmetric positive definite and its discrete solution is unique.
If u∈C⁴ and ||u^(4)||∞≤M, Taylor remainders at x_i±h give τ_i=(L_hu_grid)_i-f_i with |τ_i|≤Mh²/12. The leading sign is negative for a positive constant fourth derivative: L_hu=-u''-h²u^(4)/12 in that polynomial case. For a stored vector Û define r=f-L_hÛ and e=u_grid-Û. The exact error equation is L_he=τ+r, retaining both mesh and algebraic errors rather than confusing them.
The discrete maximum principle says L_hw≥0 and zero boundary values imply w≥0: a negative global interior minimum would force both neighbors to have the same minimum, and propagation would contradict a zero boundary. Take v_i=x_i(1-x_i)/2; direct differencing gives L_hv=1 and 0≤v_i≤1/8. With D=||τ+r||∞, the vectors Dv±e have nonnegative operator values and zero boundaries, so |e_i|≤Dv_i.
Consequently ||u_grid-Û||∞≤(Mh²/12+||r||∞)/8. The bound uses the actual h^(-2)-scaled operator, the unit interval, homogeneous Dirichlet data and this particular differential equation. A continuous-between-nodes error needs a further interpolation estimate, and uncertain f, boundary data or a different physical model introduce additional terms. A small residual alone certifies only the solve component after its inverse bound, not the omitted discretization or model error. For collocation and inverse-times-truncation analysis, see [Collocation for linear problems](https://fncbook.com/linear/); the discrete maximum principle above supplies an explicit stability constant for this particular boundary operator.
A scientific certificate for an integral or trajectory
For quadrature with exact model integral I, one useful total bound is |I-Q̂|≤ε_trunc+Σ|w_i|ε_i+ε_arith, augmented by justified node, tail or transformation contributions when present. Each term refers to the actual rule and data. An asymptotic difference indicator can be reported alongside this bound but cannot replace a missing rigorous term merely because it is small. A probabilistic sampling guarantee instead states its failure probability and distributional assumptions.
For a trajectory, the corresponding decomposition propagates initial error, model forcing, local discretization defects and solve or arithmetic perturbations using the justified Gronwall or discrete recurrence. Event times and boundary-value outputs require their own sensitivity conversion. Units and component scales must remain consistent through those conversions; an unscaled algebraic residual or a small dimensionless RMS indicator is not automatically the requested state or event certificate.
Smaller h need not lower the worst-case total error. On a uniform mesh, a fixed state perturbation ε at each update can accumulate like Tε/h before the finite-time amplification factor, while truncation falls like Ch^p. A simplified justified upper model Ch^p+Dε/h with C, D, p>0 and ε>0 has its positive minimizing balance at h=[Dε/(pC)]^(1/(p+1)), found by differentiation. If ε=0, the model reduces to Ch^p and has no positive interior minimizing step. This is only a model-dependent balance of bounds: actual perturbations may cancel, depend on h, or enter as h times field errors instead.
A complete scientific record states the mathematical target, domain, method and step information, assumptions and sources of each error contribution, and whether termination means certified tolerance, estimated tolerance, event, work limit or failure. It preserves unresolved uncertainty rather than disguising it with additional digits. Numerical accuracy under that record remains distinct from validating the physical model, extending a solution past a singularity, or proving an unobserved event cannot occur. For the distinct quadrature, IVP, BVP and sampling error settings, see [Adaptive integration](https://fncbook.com/matlab/adaptive/); [Adaptive Runge–Kutta](https://fncbook.com/adaptive-rk/); [Collocation for linear problems](https://fncbook.com/linear/); [Simple Monte Carlo](https://artowen.su.domains/mc/Ch-intro.pdf); the combined scientific contract must retain each applicable error contribution and its own assumptions.
Compare exact signed quadrature errors, data perturbation bounds, and time-step stability. The cases distinguish the fitted rule or update from its exact reference.
An exact rule can have a negative data weight
A negative left weight
Integrating the Lagrange cardinal polynomials fixes the weights by the first three moment equations. For separately bounded value errors |δyᵢ|≤ε, the triangle inequality gives |δQ|≤εΣ|wᵢ|. Choosing sign-aligned perturbations attains the bound. This calculation fixes the nodes and excludes coordinate, rounding and model errors.
| Quantity | Exact result |
|---|---|
| Physical interval | [0,1] |
| Weights in node order | (−1/6, 8/9, 5/18) |
| Weight derivation | w_s=1/[6s(1−s)], w_1=1/2−s w_s, w_0=1−w_s−w_1 |
| Quadratic exact integral and rule | 1/3 in both cases |
| Degree of exactness | 2 |
| First nonexact degree | 3 |
| I−Q at first nonexact degree | −1/24 |
| Sharp absolute amplification | 4/3 |
| Worst-case data perturbation signs | −ε, +ε, +ε |
Exact inputs and supporting calculations
| Parameter | Value |
|---|---|
| s | 1/4 |
| Physical node | Sample | Weight |
|---|---|---|
| 0 | 0 | −1/6 |
| 1/4 | 1/16 | 8/9 |
| 1 | 1 | 5/18 |
Signed integral-minus-rule errors for one quadratic
Four half-width cells
For x² the constant second derivative is 2. The composite derivative bounds (b−a)h²||f″||∞/24 and (b−a)h²||f″||∞/12 are attained. Both rules have nonnegative sample weights summing to the interval width. A shared endpoint has one distinct data value even though adjacent panels both use it.
| Quantity | Exact result |
|---|---|
| Cell width | 1/2 |
| Integral | 8/3 |
| Midpoint / trapezoid | (21/8, 11/4) |
| Signed I−M / I−T | (1/24, −1/12) |
| Second derivative norm | 2 |
| Attained absolute bounds | (1/24, 1/12) |
| Fixed-node value amplification each | 2ε |
Exact inputs and supporting calculations
| Parameter | Value |
|---|---|
| b | 2 |
| n | 4 |
| Physical node | Sample | Weight |
|---|---|---|
| 1/4 | 1/16 | 1/2 |
| 3/4 | 9/16 | 1/2 |
| 5/4 | 25/16 | 1/2 |
| 7/4 | 49/16 | 1/2 |
| Physical node | Sample | Weight |
|---|---|---|
| 0 | 0 | 1/4 |
| 1/2 | 1/4 | 1/2 |
| 1 | 1 | 1/2 |
| 3/2 | 9/4 | 1/2 |
| 2 | 4 | 1/4 |
A fourth derivative gives an exact test of the factor fifteen
Half-width one
For one panel of total width H the signed remainder is −H⁵ f⁽⁴⁾(ξ)/2880. The two half-width panels together give one sixteenth of the coarse error for this constant fourth derivative. The factor-fifteen correction is exact here. For a general integrand the difference is an estimate under a justified expansion or a controlled remainder.
| Quantity | Exact result |
|---|---|
| Integral | 2/5 |
| Coarse / refined quadrature | (2/3, 5/12) |
| Coarse / refined signed errors | (−4/15, −1/60) |
| Coefficients multiplying fourth derivative | (−1/90, −1/1440) |
| Fourth derivative | 24 |
| Coarse-to-fine signed error ratio | 16 |
| Refined minus coarse | −1/4 |
| Signed fine error from difference / 15 | −1/60 |
| Corrected quadrature / signed error | (2/5, 0) |
Exact inputs and supporting calculations
| Parameter | Value |
|---|---|
| a | 1 |
| Physical node | Sample | Weight |
|---|---|---|
| −1 | 1 | 1/3 |
| 0 | 0 | 4/3 |
| 1 | 1 | 1/3 |
| Physical node | Sample | Weight |
|---|---|---|
| −1 | 1 | 1/6 |
| −1/2 | 1/16 | 2/3 |
| 0 | 0 | 1/3 |
| 1/2 | 1/16 | 2/3 |
| 1 | 1 | 1/6 |
First nonexact degrees in Gaussian quadrature
Two nodes on [−1,1]
The real Gaussian remainder with unit weight and f∈C^4 uses the physical 4th derivative divided by 4! times the squared norm of the physical monic Legendre product. Scaling from t to x contributes h^5. The selected monomial has constant derivative 24 so its signed error equals the norm. The sample-value factor is a separate operator bound.
| Quantity | Exact result |
|---|---|
| Physical interval | [-1, 1] |
| Reference coordinate | t=(x−0)/1 |
| Reference monic Legendre product | t²−1/3 |
| Physical nodes | −1/√3, 1/√3 |
| Reference / physical weights | (1, 1) / (1, 1) |
| Last exact / first nonexact degrees | 3 / 4 |
| Integral / rule | (2/5, 2/9) |
| Signed I−Q | 8/45 |
| Reference / physical monic squared norm | (8/45, 8/45) |
| Power of half-width in physical norm | 5 |
| Physical derivative and coefficient | 24; 1/135 |
| Fixed-node value amplification | 2ε |
Exact inputs and supporting calculations
| Parameter | Value |
|---|---|
| n | 2 |
| center | 0 |
| scale | 1 |
Stability permits behavior that is still inaccurate
A step in strict scalar decay
Separate the signed state error from the finite-time bound Mh(e^(LT)−1)/(2L) for T=2h and zero initial error, with L=α and M=α². The scalar recurrence also gives (1+|R|)Mh²/2. These bounds apply with exact data and updates; bounded or stable amplification does not guarantee a small discretization error.
| Quantity | Exact result |
|---|---|
| Times | (0, 1/4, 1/2) |
| z=−αh, R=1+z, |R| | (−1/2, 1/2, 1/2) |
| Numerical states | (1, 1/2, 1/4) |
| Exponential reference | 1, exp(−1/2), exp(−1) |
| Signed errors yₖ−y(tₖ) | 1/2 − exp(−1/2); 1/4 − exp(−1) |
| Two-step signed error | Negative |
| Stability | Strict scalar decay |
| L and exact second derivative bound M | 2, 4 |
| One-step defect bound Mh²/2 | 1/8 |
| Two-step scalar recurrence bound | 3/16 |
| Separate global Lipschitz bound | (e−1)/4 |
Exact inputs and supporting calculations
| Parameter | Value |
|---|---|
| rate | 2 |
| h | 1/4 |
Three integrators have different stiff limits
Twenty exact decay times per step
With z=−αh, the factors are 1+z, 1/(1−z), and (1+z/2)/(1−z/2). Along the negative real axis the exact decay tends to zero from above. Backward Euler damps stiff modes, whereas trapezoid tends to −1 and explicit Euler grows in magnitude. Such scalar stability and damping properties do not certify time resolution, finite-time accuracy, or behavior for a different system.
| Method | R | |R| | States at 0, h, 2h | Scalar behavior | Signed error at h | Signed error at 2h |
|---|---|---|---|---|---|---|
| Explicit Euler | −19 | 19 | (1, −19, 361) | Unstable scalar amplification | −19 − exp(−20) | 361 − exp(−40) |
| Backward Euler | 1/21 | 1/21 | (1, 1/21, 1/441) | Strict scalar decay | 1/21 − exp(−20) | 1/441 − exp(−40) |
| Implicit trapezoid | −9/11 | 9/11 | (1, −9/11, 81/121) | Strict scalar decay | −9/11 − exp(−20) | 81/121 − exp(−40) |
Exact inputs and supporting calculations
| Parameter | Value |
|---|---|
| rate | 40 |
| h | 1/2 |
| Quantity | Exact result |
|---|---|
| Exact time scale | 1/40 |
| Step divided by time scale | 20 |
| Times | (0, 1/2, 1) |
| Positive exponential states | 1, exp(−20), exp(−40) |
Worked examples
An exact interpolatory rule with a negative weight
Integrate the quadratic interpolant through nodes 0, 1/4 and 1 on [0, 1]. Derive the three weights, evaluate the rule for f(x)=x², and find its sharp amplification of independently bounded value errors |δy_i|≤ε. Does exactness through degree two force the weights to be nonnegative?
- The cardinal polynomials are l_0=4x²-5x+1, l_1=(16/3)x(1-x) and l_2=(4/3)x²-(1/3)x. Each is one at its own node and zero at the others. Integrating them from 0 to 1 gives weights 4/3-5/2+1=-1/6, (16/3)(1/2-1/3)=8/9 and 4/9-1/6=5/18.
- Their sum is (-3+16+5)/18=1, so constants are integrated correctly. For x² the data are (0, 1/16, 1), giving Q=(8/9)(1/16)+5/18=1/18+5/18=1/3. More generally every polynomial of degree at most two equals its interpolant, so its exact integral equals this rule.
- The triangle inequality gives |δQ|≤ε(1/6+8/9+5/18)=4ε/3. Choosing the admissible data errors (-ε, +ε, +ε) makes every weighted contribution positive and attains that bound. The negative first weight therefore increases this fixed-node value-data amplification above the interval length one.
- This is an unequal-node interpolatory example, not a claim that the three-node equally spaced Simpson weights are negative. It demonstrates why polynomial exactness and noise amplification are separate properties. Perturbed node locations, uncertain target values between nodes and arithmetic require additional terms; no probability model has been inferred from the deterministic error box.
The weights are (-1/6, 8/9, 5/18), the value for x² is 1/3, and the sharp absolute data-error factor is 4/3. Polynomial exactness does not force positivity.
Sharp midpoint and trapezoidal errors on one mesh
Integrate f(x)=x² on [0, 2] with four equal cells. Compute the composite midpoint and trapezoidal values, their signed integral-minus-rule errors and the C² bounds. State whether each bound is attained and give the value-data amplification when each sampled value has error at most ε.
- The cell width is h=1/2. The midpoint squares at 1/4, 3/4, 5/4 and 7/4 sum to (1+9+25+49)/16=21/4, so M_4=(1/2)(21/4)=21/8. The exact integral is [x³/3]_0^2=8/3, giving I-M_4=(64-63)/24=1/24.
- For the trapezoidal rule, the interior squared values sum to 1/4+1+9/4=7/2. The half-weight endpoints contribute 0+2, so T_4=(1/2)(7/2+2)=11/4. Thus I-T_4=(32-33)/12=-1/12. Convexity explains the opposite signs: a midpoint underestimates this function while a chord overestimates it.
- Here ||f''||∞=2 and interval length is 2. The midpoint bound is 2·(1/2)²·2/24=1/24; the trapezoidal bound is 2·(1/2)²·2/12=1/12. Each is attained because the second derivative is constant and the cell errors have the same sign across the mesh.
- Both rules use nonnegative weights summing to the interval length 2. Their sharp fixed-node absolute value-error bound is therefore 2ε, attained by errors of one common sign. This contribution is independent of the exact truncation errors above. A small exact quadrature error does not make noisy or rounded input evaluations exact.
I=8/3, M_4=21/8 and T_4=11/4. The signed errors are +1/24 and -1/12, attaining their derivative bounds. Both usual positive-weight rules amplify bounded value error by at most 2ε.
Simpson refinement and the factor fifteen
For f(x)=x⁴ on [-1, 1], compare one Simpson panel with two equal Simpson panels. Give both values, exact signed errors, the fourth-derivative remainder constants and the coarse/fine difference estimate for the fine error. Does extrapolating this particular pair recover the exact integral?
- The exact integral is 2/5. A single panel has total width H=2 and values (1, 0, 1), so S_coarse=(H/6)(1+4·0+1)=2/3. The signed error is 2/5-2/3=-4/15. Since f^(4)=24, the remainder -H⁵·24/2880 equals exactly -4/15.
- For two panels the fine node spacing is 1/2. The five values are (1, 1/16, 0, 1/16, 1). The composite value is (1/6)(1+4/16+0+4/16+1)=5/12. Its error is 2/5-5/12=-1/60. Summing two width-one panel remainders gives -2·24/2880=-1/60, consistent with fourth-order refinement.
- The rule difference is S_fine-S_coarse=5/12-2/3=-1/4. Dividing its magnitude by 15 gives 1/60, exactly the fine error magnitude in this case. The corrected value is 5/12-1/60=2/5. The sign of the correction also agrees with the fine rule's overestimate.
- For this quartic the leading fourth-order error expression is exact, so no unknown higher-order remainder survives the cancellation. For a general integrand the factor-fifteen expression is only an asymptotic estimator unless its remainder is controlled. This exact example is not a proof that two agreeing adaptive rules certify every unsampled smooth function.
I=2/5, S_coarse=2/3 and S_fine=5/12. Their integral-minus-rule errors are -4/15 and -1/60. |S_fine-S_coarse|/15=1/60, and S_fine+(S_fine-S_coarse)/15=2/5 exactly for this quartic.
Two Gaussian nodes and a first nonexact degree
Construct the symmetric two-node Gaussian rule for weight 1 on [-1, 1], verify degree-three exactness, and apply it to x⁴. Compute the exact error and the squared norm of its monic nodal polynomial, and relate them to the C⁴ remainder.
- Let the nodes be ±a and both weights be w. Constants require 2w=2, giving w=1. Exactness for x² requires 2a²=2/3, hence a=1/√3. Odd functions x and x³ cancel between the symmetric nodes and also have zero integral. These conditions establish exactness for every polynomial through degree three.
- For f=x⁴, the rule is 2a⁴=2/9. The exact integral is 2/5, so I-Q=2/5-2/9=8/45. A degree-four counterexample is expected: no two-fixed-node rule can integrate every degree-four polynomial under a strictly positive interval weight.
- The monic nodal polynomial is p_2=x²-1/3. Its squared norm is integral(x⁴-(2/3)x²+1/9)=2/5-4/9+2/9=8/45. Since f^(4)=24, the Gaussian remainder coefficient f^(4)/4! is one and the formula gives precisely that error.
- The rule's weights are positive and sum to 2, so its fixed-node value-data amplification is the interval mass 2. Its high polynomial exactness and positive weights answer different questions from regularity of a general target or accuracy of irrational-node evaluations. Those uncertainties remain separate from this exact algebraic calculation.
The nodes are ±1/√3 with weights 1. For x⁴ the rule gives 2/9 instead of 2/5, error 8/45. The monic polynomial x²-1/3 has squared integral norm 8/45, matching f^(4)/4!=1.
Three Gaussian nodes on a shifted interval
Map the three-node unit-weight Gauss rule from [-1, 1] to [1, 3]. Derive its nodes and weights from the Legendre cubic and symmetric moments, then integrate f(x)=(x-2)⁶. Check the error using the monic polynomial norm and the sixth derivative.
- Use t=x-2, whose half-width scale is one. P_3(t)=(5t³-3t)/2 has roots 0 and ±√(3/5). If the outer weights are w and the central weight is v, moments of degrees zero and two give 2w+v=2 and 2w(3/5)=2/3. Thus w=5/9 and v=8/9; symmetry and the orthogonal-root construction give exactness through degree five.
- For t⁶ the central value vanishes and each outer value is (3/5)³. Hence Q=2(5/9)(27/125)=6/25. The exact integral on the shifted interval is integral from -1 to 1 of t⁶, namely 2/7. Their difference is (50-42)/175=8/175.
- The monic cubic is p_3=t³-(3/5)t. Its squared integral is 2/7-(6/5)(2/5)+(9/25)(2/3)=2/7-12/25+6/25=8/175. The sixth derivative of the target is 720, so f^(6)/6!=1, reproducing the same Gaussian remainder.
- The interval mapping must carry its Jacobian into the weights; it happens to be one here, not a universal default. A derivative bound and squared monic norm would give a conditional error bound for another C⁶ target, while this degree-six calculation attains it exactly. No infinite-precision implementation or general optimal actual-error claim follows from polynomial exactness alone.
The nodes are 2-√(3/5), 2 and 2+√(3/5), with weights 5/9, 8/9, 5/9. Q=6/25, I=2/7 and I-Q=8/175, the squared norm of t³-(3/5)t.
Richardson cancellation with a nonpolynomial target
For f(x)=eˣ on [0, 1], compute the one-cell and two-cell trapezoidal values and their Richardson combination. Show its exact equality with the one-panel Simpson expression, give its signed error relative to e-1, and bound that error using the fourth derivative rather than assuming the extrapolation is exact.
- The endpoint trapezoid is T_1=(1+e)/2. With cell width 1/2, the shared midpoint value is √e and T_(1/2)=(1/2)(1/2+√e+e/2)=(1+2√e+e)/4. These are exact symbolic values for the same fixed function and interval.
- The extrapolation (4T_(1/2)-T_1)/3 simplifies to (1+4√e+e)/6. Its weights are exactly the Simpson weights at 0, 1/2 and 1. This equality is an algebraic property of the nested mesh and holds independently of any smoothness-based asymptotic expansion.
- Subtracting I=e-1 gives R-I=(7+4√e-5e)/6. The Simpson remainder says I-R=-f^(4)(ξ)/2880 on this width-one panel. Since f^(4)(x)=eˣ lies between 1 and e, the rule overestimates and 1/2880≤R-I≤e/2880. Positivity follows from the remainder theorem, not an unreported decimal experiment.
- The endpoint-correction expansion explains why the leading h² trapezoidal term cancels, but the nonzero fourth-order contribution remains. Thus extrapolation has improved the approximation without making it exact. Evaluation error in e or √e and arithmetic in the subtraction would need additional bounds if the expression were implemented numerically.
T_1=(1+e)/2, T_(1/2)=(1+2√e+e)/4 and R=(1+4√e+e)/6. Its positive rule-minus-integral error is (7+4√e-5e)/6, lying between 1/2880 and e/2880.
Regularizing an integrable endpoint singularity
Evaluate I=integral from 0 to 1 of x^(-2/3) dx. Use x=t³ to construct a continuous transformed integrand on [0, 1], explain its value at zero, and assess a constant-exact quadrature rule. Why is directly computing the original left endpoint or the unsimplified product at t=0 inappropriate?
- The antiderivative for x>0 is 3x^(1/3). Its limit at zero is zero, so the improper integral converges and equals 3. The exponent 2/3 is below the integrability threshold one; the infinite point value of the original function does not by itself make its integral infinite.
- Under x=t³, dx=3t²dt and x^(-2/3)=t⁻² for positive t. Their product simplifies to the constant 3. Define the transformed endpoint value to be its limit 3, obtaining a continuous and indeed constant function on the closed t interval.
- Every quadrature rule whose weights sum to one is exact for this transformed constant. Thus midpoint, trapezoidal, Simpson and Gaussian rules all return 3 in exact arithmetic once supplied the correctly defined transformed integrand. This conclusion is about this function and substitution, not a universal order result for every endpoint singularity.
- The original function is undefined as a finite value at x=0, and the unsimplified transformed expression suggests 0⁻²·0². A numerical program should implement the simplified expression or the analytic limit rather than rely on cancellation of exceptional values. Original data and arithmetic uncertainty still need their own interpretation after a substitution.
I=3. For t>0 the transformed integrand is 3, with continuous endpoint value 3; any constant-exact rule on [0, 1] returns 3 in exact arithmetic. The endpoint is defined by a limit, not by evaluating infinity times zero.
A finite-interval transform and an independent tail bound
Evaluate the integral of (1+x)^(-3) from 0 to infinity using x=t/(1-t). Compute the exact integral truncated at R=3 and its exact tail. Compare that tail with the bound obtained from (1+x)^(-3)≤x⁻³ for x≥3.
- For 0≤t<1, 1+x=1/(1-t) and dx/dt=1/(1-t)². Thus (1+x)^(-3)dx=(1-t)dt. The transformed function extends continuously to zero at t=1, and its integral from 0 to 1 is 1/2. This is an exact variable change, not an assertion that every convergent infinite tail becomes smooth under this map.
- The antiderivative of (1+x)^(-3) is -(1/2)(1+x)^(-2). At R=3 the remaining tail is (1/2)4⁻²=1/32. The finite integral is consequently 1/2-1/32=15/32.
- For x≥3, the inequality (1+x)^(-3)≤x⁻³ gives tail at most integral from 3 to infinity of x⁻³, namely 1/(2·3²)=1/18. It is valid but looser than the exact 1/32. A numerical integral on [0, 3] would need its own finite-interval error added to whichever tail bound is used.
- Convergence, the transformed endpoint regularity and the quality of a truncation bound are three separate facts. Choosing a large cutoff alone does not establish the finite-part quadrature error, and observing small sampled tail values does not prove a tail envelope. Here both facts follow from explicitly stated algebraic inequalities and limits.
The transformed integrand is 1-t and the full integral is 1/2. The truncated integral is 15/32 and tail 1/32; the simpler power-tail bound is 1/18.
Stable Euler decay with a separate accuracy bound
For y'=-2y, y(0)=1, take two explicit Euler steps of size h=1/4. Give the numerical value and actual error at t=1/2, the scalar amplification and a global bound from L=2 and ||y''||∞≤4 on that interval. Does stable decay alone establish the requested accuracy?
- The exact trajectory is y(t)=e^(-2t). Explicit Euler multiplies by 1-2h=1/2, so y_1=1/2 and y_2=1/4 at time 1/2. The exact value there is e⁻¹, with numerical-minus-exact error 1/4-e⁻¹. The absolute value is e⁻¹-1/4 because the Euler decay lies below this exponential at the stated steps.
- The test-equation argument is z=hλ=-1/2, and |R(z)|=|1+z|=1/2<1. Thus errors in this exact scalar recurrence decay under repeated homogeneous updates. This is a statement about amplification, not equality between the discrete and exact decay factors.
- The vector field has global Lipschitz constant L=2. The exact solution has y''=4e^(-2t), bounded by M=4 on [0, 1/2]. The Euler global estimate with zero initial error is Mh(e^(LT)-1)/(2L)=(e-1)/4. It encloses the actual error but does not need to be sharp.
- A desired tolerance must be compared with an actual error certificate or a justified bound, not with the fact that |R|<1. Evaluation, rounding and uncertain initial data would add further contributions. The continuous problem here decays stably, the numerical recurrence is stable at this h, and its finite-time discretization error is nevertheless nonzero.
The iterates are 1/2 and 1/4, while y(1/2)=e⁻¹. The absolute error is e⁻¹-1/4; R(-1/2)=1/2. The stated global bound is (e-1)/4 and is conservative.
Heun stages for a time-dependent field
Apply one Heun step of size h=1/5 to y'=t+y, y(0)=1. Compute both stages, the numerical output and its exact error using the analytic solution. Explain why the second stage must advance both time and state, and what this one step proves about global order.
- The first stage is k_1=F(0, 1)=1. The Euler predictor is 1+h k_1=6/5 at the new time 1/5. Hence k_2=F(1/5, 6/5)=7/5. Holding the second stage time at zero would apply a different method to this nonautonomous equation.
- The Heun update is y_1=1+(h/2)(k_1+k_2)=1+(1/10)(1+7/5)=1+6/25=31/25. The two stage slopes are combined with the step duration; they are not values of y that could be averaged without that factor.
- Solving y'-y=t gives y(t)=2e^t-t-1. At t=1/5 this is 2e^(1/5)-6/5. Subtracting 31/25 gives 2e^(1/5)-61/25. Its series begins with the cubic term because 2e^h-h-1 and the Heun polynomial agree through h² for this initial step.
- The exact symbolic case illustrates local order two without constituting a general convergence proof. Finite-time global order also needs a stable one-step map, uniform smoothness and common-domain control over all accepted steps. The general derivation adjoins time or expands both F_t and F_yF rather than assuming that an autonomous calculation covers this example unchanged.
k_1=1, k_2=7/5 and y_1=31/25. The exact value is 2e^(1/5)-6/5, so exact-minus-numerical error is 2e^(1/5)-61/25.
Stiff decay and three different amplification factors
For y'=-40y, y(0)=1 and h=1/2, compare explicit Euler, backward Euler and the implicit trapezoidal method. Give their first two iterates and exact reference values. Distinguish scalar stability, stiff damping and accurate resolution of the initial transient.
- The exact step factor is e^(hλ)=e⁻²⁰. Explicit Euler has R=1+z=-19, so its first two values are -19 and 361. Its amplification magnitude exceeds one even though the actual differential equation decays rapidly. This chosen explicit step is unstable for the test equation.
- Backward Euler solves (1-z)y_(n+1)=y_n, giving factor 1/21 and values 1/21, 1/441. The trapezoidal equation gives factor (1+z/2)/(1-z/2)=(-9)/(11), so its values are -9/11, 81/121. Both factors have magnitude below one, but the trapezoidal response alternates sign and decays much more slowly here.
- As z tends down the negative real axis, backward Euler's factor tends to zero, whereas the trapezoidal factor tends to -1. This is the distinction between strong stiff damping and A-stability alone. The algebraic stages are uniquely solvable for these scalar data because their denominators are nonzero; a nonlinear stage would need its own solvability and residual assessment.
- Neither stable coarse result accurately resolves the exact first transient e⁻²⁰ or the later e⁻⁴⁰ merely by being bounded. The physical time of interest and requested tolerance determine whether suppressing that transient is sufficient. Stability, accuracy, sign behavior and nonlinear solve completion are therefore reported as different properties.
At z=-20, the factors are -19, 1/21 and -9/11. Their first/two-step values are (-19, 361), (1/21, 1/441) and (-9/11, 81/121), versus e⁻²⁰ and e⁻⁴⁰.
A symplectic step with modified rather than exact energy
For q'=p, p'=-4q, start at (q, p)=(1, 0) and take one kick-then-drift symplectic Euler step with h=1/4. Compute its matrix, determinant, the physical energy before/after and the modified quadratic invariant. Is the stable modified invariant positive for this step?
- With ω=2, the kick is p_1=p_0-hω²q_0=-1. The drift uses that new momentum: q_1=q_0+h p_1=3/4. Thus M=[[1-h²ω², h], [-hω², 1]]=[[3/4, 1/4], [-1, 1]], whose determinant is 3/4+1/4=1.
- The physical energy H=(p²+4q²)/2 starts at 2. At the new state it is (1+4·9/16)/2=13/8, so it is not exactly conserved. Preserving phase area has not made the numerical map equal to the exact oscillator flow.
- The modified form for this ordering is H_tilde=(p²+4q²-h·4qp)/2=(p²+4q²-qp)/2. Initially it is 2; after the step it is (1+9/4+3/4)/2=2. In general its matrix has determinant ω²(1-h²ω²/4), so positive ω and |hω|<2 make it positive definite.
- Here |hω|=1/2 satisfies that strict condition, so repeated exact fixed steps are bounded by the preserved positive modified energy. At the boundary the argument loses definiteness, and arbitrary variable steps do not automatically preserve this same invariant. A geometric method's structure and its physical-energy or phase accuracy need separate qualification.
p_1=-1, q_1=3/4, M=[[3/4, 1/4], [-1, 1]] and det(M)=1. Physical energy changes from 2 to 13/8, but (p²+4q²-qp)/2 remains 2. Here |hω|=1/2<2, so the modified form is positive definite.
Try it yourself
For the endpoint trapezoidal rule Q=(y_0+y_1)/2 on [0, 1], assume independently admissible value errors |δy_i|≤ε. The observed errors (+ε, -ε) cancel. Determine the sharp worst-case bound and explain why that observation does not establish it. If the nodes are perturbed with fixed weights, what extra bound follows from |f'|≤M on the connecting intervals?
Show the answer and reasoning
The sharp value-data bound is ε, attained by (+ε, +ε); opposite errors give zero only for that case. Fixed-weight node shifts add at most (M/2)(|δx_0|+|δx_1|) under the stated derivative hypothesis.
The value perturbation is δQ=(δy_0+δy_1)/2. The triangle inequality gives |δQ|≤(|δy_0|+|δy_1|)/2≤ε. This bound is attained when both errors are +ε, or both are -ε for the opposite sign, so it is sharp over the specified deterministic box. The particular choice (+ε, -ε) yields zero by cancellation. A favorable observed direction does not reduce the supremum over all independently admissible directions. Nor does the word independent here supply random variables or a variance model: it specifies which combinations the deterministic constraints permit. For fixed weights and a shifted evaluation x_i+δx_i, the mean-value or integral derivative bound gives |f(x_i+δx_i)-f(x_i)|≤M|δx_i| when the entire connecting interval is in the derivative-controlled domain. The quadrature change is therefore bounded by (M/2)(|δx_0|+|δx_1|). Moving a node beyond the domain without that extra hypothesis would invalidate the use of M. If weights or the integration interval also change, those are further perturbations, not included by merely enlarging the value-only ε. A total certificate must also include quadrature truncation and arithmetic. Here the endpoint weights have units of the integration variable, so value and node uncertainty contribute to the same integral units only after their proper factors are applied.
For f(x)=x³ on [-2, 2], compute one-cell midpoint and trapezoidal rules and their exact integral. Compare with the derivative-based absolute bounds using ||f''||∞=12. What does the example say about sufficiency, sign cancellation and relative error at a zero integral?
Show the answer and reasoning
I=M=T=0. The midpoint and trapezoidal bounds are 32 and 64, valid but non-sharp. The exact relative error normalized by |I| is undefined, not a meaningful zero percentage.
Odd symmetry gives the exact integral zero. The midpoint is 0, so the width-four midpoint rule returns 4f(0)=0. The endpoint trapezoid also returns (4/2)(f(-2)+f(2))=2(-8+8)=0. Both equal the integral for this particular odd cubic. The second derivative is 6x, whose maximum absolute value is 12. With interval length and single cell width both 4, the midpoint bound is 4·4²·12/24=32, and the trapezoidal bound is 4·4²·12/12=64. Exact error zero satisfies both inequalities. The bounds use a maximum derivative and discard cancellation. Their being large does not prove that a given function's error is large; they are sufficient upper bounds. Conversely, this exact odd example does not make either method exact for every cubic on every interval. The mean-value remainder may select a point where f'' vanishes, which is consistent with the result. Since I=0, dividing the absolute error by |I| produces 0/0 and defines no relative-error percentage. Absolute error or a separately chosen physical scale is appropriate. This distinction persists when a computed integral is close to zero because of cancellation rather than because the integrand itself is small.
Use composite trapezoidal quadrature with N equal cells for x² on [1, 4], assuming exact evaluations. Find the least positive N making the absolute truncation error at most 1/100, and prove necessity as well as sufficiency for this target. State the effect of value uncertainty separately.
Show the answer and reasoning
The exact error is T_N-I=9/(2N²), so the least N is 22. Value errors bounded by ε add a sharp possible contribution 3ε, independent of that truncation calculation.
The interval length is 3 and h=3/N. Since f''=2 is constant, the trapezoidal cell remainder is exact and all cells have the same sign. Thus T_N-I=(3)h²(2)/12=9/(2N²). The exact integral is (4³-1³)/3=21, although its value is not needed to normalize this absolute tolerance. The requirement 9/(2N²)≤1/100 is equivalent to N²≥450. Since 21²=441<450 and 22²=484≥450, the least positive integer is 22. In particular N=21 gives error 1/98>1/100, and N=22 gives 9/968<1/100. The exact expression decreases with positive N, so every smaller integer fails and every larger one passes for this function and equal-cell family. This is stronger than simply applying a potentially non-sharp general upper bound; constant curvature makes the bound exact here. It is not a universal minimal sample count across all quadrature methods. The usual composite weights are nonnegative and sum to 3. If each evaluated value instead has deterministic uncertainty at most ε, the possible data contribution is 3ε and must be budgeted separately. More cells reduce this truncation term but do not automatically reduce that worst-case data term or the accumulation error.
Apply a single Simpson panel to x³ on [1, 3]. Verify the exact value and explain degree-three integration even though the underlying three-node interpolating polynomial has degree at most two. Give the fixed-node value-data amplification.
Show the answer and reasoning
The rule and exact integral are 20. Centered odd-error cancellation gives the extra exact degree; the underlying interpolant need not equal the cubic. Data amplification is 2ε for value errors bounded by ε.
The panel width is 2 and its nodes are 1, 2, 3. Simpson gives (1/3)(1+4·8+27)=20. The exact integral is (3⁴-1⁴)/4=20, so there is no truncation error for this target. Set s=x-2, so x³=8+12s+6s²+s³ on [-1, 1]. Quadratic interpolation reproduces the first three terms. The interpolation error contributed by s³ at the symmetric nodes is a multiple of s(s²-1), an odd function whose integral vanishes on this symmetric interval. Thus integration can be exact even though the interpolating polynomial differs pointwise from the cubic. Equivalently, the Simpson functional annihilates every polynomial through degree three. The C⁴ remainder also gives zero because the fourth derivative of a cubic is zero; it does not assert reproduction of every cubic at unsampled points. The positive weights are (1/3, 4/3, 1/3), summing to the interval length 2. Hence independently bounded value errors contribute at most 2ε, attained by common-sign errors. Polynomial truncation exactness does not cancel arbitrary data or arithmetic errors.
Construct the one-node Gaussian rule for weight 1 on [-1, 1]. Show its maximum polynomial exactness using x², and verify that error with the general Gaussian remainder. Distinguish its data amplification from its truncation error.
Show the answer and reasoning
The node is 0 and weight 2; it is exact through degree 1. For x², Q=0, I=2/3 and error 2/3. The monic polynomial norm and f''/2! give the same result; value-data amplification is 2ε.
Constant exactness forces the sole weight to be 2. Linear exactness then forces 2x_1=integral from -1 to 1 of x=0, so x_1=0. This is the root of the degree-one orthogonal polynomial and uniquely specifies this one-node constant/linear-exact rule. For x² the sampled value is zero, so Q=0, while the exact integral is 2/3. Therefore the rule cannot be exact for every degree-two polynomial. More generally, the nonzero square of the monic nodal polynomial vanishes at the node but has strictly positive integral. Here that monic polynomial is p_1(x)=x, with squared integral norm 2/3. The target has f''=2, so the Gaussian remainder is (2/2!)(2/3)=2/3, exactly as calculated. The degree and derivative orders are both kept at their n=1 values. The absolute sole weight is 2, so a sample error ε can change Q by 2ε. This is a separate data uncertainty, not the reason the exact x² quadrature was inaccurate. A higher-order formula may change truncation behavior without making uncertain evaluations exact.
Map the two-node Gaussian rule to [1, 5] and integrate x³. Derive the mapped nodes and weights and verify the exact value without decimal nodes. What error would come from forgetting the change-of-variable scale?
Show the answer and reasoning
The nodes are 3±2/√3 and both weights are 2. The exact quadrature and integral are 156. Retaining the original weights 1 would give 78, half the correct integral.
Use x=3+2t, with t in [-1, 1] and dx=2dt. The reference nodes ±1/√3 map to 3±2/√3, and each reference weight 1 is multiplied by 2. Their sum is 4, the target interval length. Let a=2/√3. The sum (3-a)³+(3+a)³ is 54+18a²=54+24=78. Applying both mapped weights gives Q=2·78=156. Irrational odd terms cancel exactly in this symbolic computation. The exact integral is (5⁴-1⁴)/4=(625-1)/4=156, agreeing with degree-three exactness. If the Jacobian were omitted, the same node values with weights 1 would yield 78. The error would come from integrating under the wrong measure, not from the Gaussian remainder. Mapped weights carry the integration-variable scale and its physical units. For fixed mapped nodes, their absolute sum gives data amplification 4ε. Uncertainty in the mapping or node coordinates is another perturbation and is not included in that value-only bound.
For f(x)=x² on [0, 1], form trapezoidal estimates with one cell and two equal cells, then apply Richardson cancellation. Derive the error term for any equal-cell width h=1/N. Does the resulting exact value prove that the procedure certifies every continuous integrand?
Show the answer and reasoning
T_1=1/2, T_(1/2)=3/8, and (4T_(1/2)-T_1)/3=1/3=I. Here T_h-I=h²/6 exactly, so the leading term is the entire error. This polynomial example supplies no general certificate for an unknown continuous function.
The one-cell rule is (f(0)+f(1))/2=1/2. With h=1/2, the composite rule is h[f(0)/2+f(1/2)+f(1)/2]=(1/2)(1/4+1/2)=3/8. Direct integration gives I=1/3. Both trapezoidal approximations exceed I, as expected for this strictly convex integrand. On every cell, the constant second derivative 2 makes the trapezoidal error exactly h³/6. Summing N cells gives T_h-I=Nh³/6=h²/6. Thus halving h divides the error by four, with no neglected higher term for this quadratic. The sign convention here is T_h-I; the integral-minus-rule error has its negative. The extrapolate is [4(3/8)-1/2]/3=1/3. Substituting T_h=I+h²/6 and T_(h/2)=I+h²/24 shows algebraically that the h² contribution cancels. For these nested trapezoidal rules, the resulting weights are also the Simpson weights on the combined panel. The exactness follows from the specified polynomial and rule, not from observing agreement alone. For a wider function class, one must justify an appropriate remainder expansion or a derivative-based bound before turning cancellation into an error statement. Continuity alone gives convergence under refinement but not this two-term power expansion, a universal reduction factor, or certification from two estimates. Value and arithmetic errors can also survive or be amplified by the signed extrapolation combination and require their own bounds.
Consider an adaptive Simpson test that compares a panel on [0, 1] with its two half-panels, using the five combined nodes j/4, j=0, …, 4. Construct a smooth nonnegative integrand for which both estimates and the usual difference-over-15 indicator vanish but the true integral is positive. Explain precisely what the counterexample rules out.
Show the answer and reasoning
Take g(x)=∏_(j=0)^4(x-j/4)². All five samples vanish, so both Simpson estimates and their indicator are zero. The polynomial is positive away from those five roots, hence its integral is positive; finite samples alone do not give a universal absolute-error certificate.
Define g(x) as the product of the five squared factors (x-j/4)². It is a degree-ten polynomial, is nonnegative on the interval, and vanishes at every node used by either rule. Each quadrature sum is therefore exactly zero in exact arithmetic. Their difference, and its absolute value divided by 15, are also zero. The polynomial is strictly positive at every interior point other than its finitely many prescribed roots. Choose, for example, any point strictly between consecutive roots. Continuity gives a small subinterval on which g is bounded below by a positive number. Integrating over that subinterval proves ∫₀¹g(x)dx>0 without needing an expanded degree-ten antiderivative. Thus the indicated zero error is not the actual error. Multiplying g by any positive constant leaves all sampled data and the zero indicator unchanged while multiplying the true integral by that constant. Over an unrestricted smooth class, the same finite data permit arbitrarily large error. Smoothness by itself, without quantitative bounds on an appropriate class, does not repair this inference. This does not invalidate the usual asymptotic Simpson cancellation under its stated hypotheses, nor a certificate based on verified fourth-derivative bounds and complete error accounting. Such a bound would change with the amplitude in this example. The counterexample rules out promoting a sample-difference heuristic, or a budget-related stop, to a universal guarantee of the requested absolute accuracy.
Regularize ∫₀¹x^(-3/4)dx using x=t^p. Compare p=4 and p=2, including the transformed endpoint. Then apply the same family of substitutions to x^(-1) and explain why it does not remove that divergence.
Show the answer and reasoning
The original convergent integral is 4. With p=4 the transformed integrand is the continuous constant 4; with p=2 it is 2t^(-1/2), still unbounded but integrable. For x^(-1), every finite p>0 gives p/t and a divergent integral.
For a positive lower cutoff, the substitution x=t^p has dx=p t^(p-1)dt and gives x^(-3/4)dx=p t^(p/4-1)dt. Passing to the limit is legitimate as an improper change of variables: the truncated identities hold first, and the nonnegative limits exist. Direct integration of x^(-3/4) gives 4x^(1/4), so the integral equals 4. When p=4, the transformed expression is 4 on 0<t≤1 and has the continuous extension g(0)=4. Endpoint evaluation uses this limit of the product; it is not a numerical multiplication of the infinite original factor by a zero Jacobian. Every quadrature rule exact for constants integrates this transformed function exactly in exact arithmetic. When p=2, the expression is 2t^(-1/2). Its integral is again 4, but it remains unbounded at zero. An endpoint rule requiring a finite value cannot be justified by pretending that this endpoint is regular. The substitution improves the singular exponent but does not automatically supply the derivative bounds needed for a chosen high-order formula. For the divergent target x^(-1), the transformed expression is t^(-p)p t^(p-1)=p/t for every finite p>0. Its logarithmic improper integral still diverges. A valid substitution preserves the value or divergence of the improper integral; it cannot turn a nonintegrable positive singularity into a finite answer by assigning an arbitrary endpoint value.
Map ∫₀^∞e^(-x)dx to [0, 1] with x=-log(1-t), including a justified endpoint limit. Independently truncate the original integral at R=log 100 and give the exact retained part and tail. Which distinct errors would remain in a numerical computation?
Show the answer and reasoning
The transformed integrand is 1 with continuous extension at t=1, and the integral is 1. At R=log 100, the retained integral is 99/100 and the tail is 1/100. Quadrature, data and arithmetic errors remain distinct from that exact tail.
On 0≤t<1, x=-log(1-t) has derivative 1/(1-t), while e^(-x)=1-t. Their product is exactly 1. The transformed integrand therefore extends continuously to g(1)=1. As with an improper endpoint singularity, this extension is established algebraically by a limit rather than by evaluating an indeterminate zero-times-infinity expression. For each finite cutoff R, the transformed upper endpoint is 1-e^(-R), and the integral of g over that finite interval is 1-e^(-R). Letting R tend to infinity gives 1. This also justifies the compact-interval transformation without assuming in advance that a generic infinite-interval mapping makes every integrand smooth at its endpoint. For R=log 100, e^(-R)=1/100. Hence ∫₀^R e^(-x)dx=99/100 and ∫_R^∞ e^(-x)dx=1/100 exactly. Discarding the tail gives that known absolute truncation error, even if integration on the retained interval is otherwise exact. Including the exact tail eliminates it for this analytically known example. A numerical retained-interval estimate must add its own quadrature, evaluation and arithmetic contributions to a total error bound; none is already included in the tail number. On the transformed interval the constant target is exceptionally simple, but computing the two original factors separately near t=1 can be unstable. The identity g=1 is the justified endpoint representation for this example.
Use the composite trapezoidal rule with six equal cells for cos(12πx) on [0, 1]. Compare its result with the true integral. Explain the aliasing using the complex exponential and contrast a direct oscillatory integral identity with a generic integration-by-parts bound.
Show the answer and reasoning
Every sampled value is 1, so T_6=1, whereas the true integral is 0. The frequency aliases to the constant samples. The complex endpoint identity gives exact cancellation; a bound using only endpoint magnitudes gives the valid but non-sharp upper bound 1/(6π).
At x_j=j/6, cos(12πx_j)=cos(2πj)=1. The trapezoidal weights sum to the interval length 1, so the rule returns 1. The exact antiderivative is sin(12πx)/(12π), whose endpoint difference is zero. The absolute quadrature error is therefore 1 despite apparently constant sampled data. The complex target e^(i12πx) likewise takes the value 1 at every grid node. Its exact integral is (e^(i12π)-1)/(i12π)=0. Taking real parts recovers the cosine result. The grid cannot distinguish this oscillation from the constant integrand solely from these samples; the missing information concerns frequency and behavior between nodes. For a constant amplitude g=1, integration by parts is the same endpoint identity. If one bounds the two endpoint terms separately and discards cancellation, the resulting magnitude bound is 2/|12π|=1/(6π), with no derivative-integral contribution because g'=0. It is a bound on the actual oscillatory integral, not on the error of the aliased trapezoidal rule, and it need not be sharp. Methods that integrate a known oscillatory factor against an approximated amplitude can use that phase information explicitly. Merely increasing the nominal order of a rule at unresolved samples cannot establish that the oscillation has been resolved. Any guarantee must state the admissible frequency or regularity information and include amplitude approximation and arithmetic errors; the favorable exact endpoint cancellation here is not a universal value.
Let U_1, …, U_N be independent uniform draws on [0, 1], and estimate ∫₀¹x²dx by their squared-value mean. Derive its expectation and variance, then find the least integer N for which Chebyshev's bound alone guarantees probability at most 1/100 of absolute error at least 1/20. Explain what minimality means here.
Show the answer and reasoning
The estimate is unbiased with variance 4/(45N). Chebyshev gives failure probability at most 320/(9N), so the least integer meeting this bound is 3556. This is the least count certified by this inequality, not necessarily the least count achieving the actual probability target.
For one uniform U, E[U²]=∫₀¹x²dx=1/3 and E[U⁴]=1/5. Thus Var(U²)=1/5-(1/3)²=4/45. The estimator is the mean Q_N=(1/N)ΣU_j², whose expectation is 1/3. There is no quadrature bias in this probabilistic expectation statement. Independence makes the covariances of different squared draws zero, so Var(Q_N)=(1/N²)N(4/45)=4/(45N). Finite second moment and independence are the relevant assumptions; a deterministic box of value errors would not supply this variance reduction. The probability refers to repeated draws under this sampling model. Chebyshev's inequality yields P(|Q_N-1/3|≥1/20)≤[4/(45N)]/(1/20)²=1600/(45N)=320/(9N). Requiring this upper bound to be at most 1/100 gives N≥32000/9. The least positive integer satisfying it is 3556; 3555 fails that particular inequality and 3556 passes it. Chebyshev may be conservative, so failure of its sufficient inequality does not prove that the actual probability exceeds the target. No random simulation is needed for this derivation, and a sample variance cannot silently replace the proven population variance in the same guarantee. Evaluation errors, dependence, a different distribution or an altered integrand would require a fresh corresponding argument.
An initial-value perturbation on 0≤t≤1 has |δ(0)|≤1/20 and forcing discrepancy |d(t)|≤1/10. Under a Lipschitz bound L=2, derive the Gronwall bound at t=1. Show that it can be attained by a scalar example and distinguish amplification from forcing accumulation.
Show the answer and reasoning
The bound is e²/20+(e²-1)/20=(2e²-1)/20. It is attained by δ'=2δ+1/10 with δ(0)=1/20. The first contribution propagates initial uncertainty; the second integrates the persistent discrepancy.
The norm inequality for the perturbed solution is bounded by the scalar comparison a e^(Lt)+∫₀ᵗe^(L(t-s))|d(s)|ds, with a=1/20. At t=1 and L=2, its first contribution is e²/20. The forcing contribution is at most (1/10)∫₀¹e^(2(1-s))ds=(e²-1)/20. Adding the two gives (2e²-1)/20. The forcing is not merely multiplied by the total duration without amplification: discrepancies introduced at earlier times propagate for longer. Conversely, it should not be counted as another initial error with an arbitrary extra factor. The integral weights follow from the differential inequality. For sharpness within these hypotheses, take the scalar equation δ'=2δ+1/10 and the positive initial value 1/20. Its integrating-factor solution is δ(t)=e^(2t)/20+(e^(2t)-1)/20. It is positive, so the triangle inequalities are equalities, and the displayed bound is attained at t=1. This describes worst-case sensitivity on a valid common existence interval, not the discretization error of a particular method. A stable or contractive physical problem may admit a sharper one-sided estimate. Units also matter: a is in state units, d is in state units per time, and L is inverse time. When L=0, the correct limiting comparison is a+∫|d|, not an undefined division by zero.
Apply two forward Euler steps of width 1/2 to y'=y+t, y(0)=0. Find the exact solution and the signed exact-minus-computed error at t=1. Derive a valid global bound from L=1 and M=max_[0, 1]|y''|, rather than treating one local defect as the full error.
Show the answer and reasoning
The steps give Y_1=0 and Y_2=1/4. The exact solution is e^t-t-1, so the error is e-9/4. Here M=e and the usual Euler bound is e(e-1)/4, a valid upper bound rather than the exact error.
Euler advances by Y_(n+1)=Y_n+h(Y_n+t_n). From Y_0=0, t_0=0, the first step is zero. At t_1=1/2, the next slope is 1/2, so Y_2=1/4. Using the new time but the old state correctly is essential; evaluating both slopes at t=0 would define a different and incorrect procedure. Solving y'-y=t with y(0)=0 gives y(t)=e^t-t-1. Substitution verifies y'=e^t-1=y+t. At t=1 the exact value is e-2, hence the signed error is (e-2)-1/4=e-9/4>0. This is the global error after both steps, including propagation of the first defect. The state Lipschitz constant is L=1 and y''=e^t, so M=e on the interval. Each true-start local state defect is bounded by Mh²/2. Iterating the Lipschitz recurrence gives |e_N|≤Mh(e^(LT)-1)/(2L) for zero initial error. With h=1/2 and T=1, this is e(e-1)/4. The bound discards cancellation and replaces each local curvature by its interval maximum, so it need not equal the exact error. A local defect starts from the exact state at a given time; the second numerical step instead starts from Y_1. The difference is the propagated global error, which is why a single local calculation cannot by itself justify the final bound.
Use one classical fourth-order Runge–Kutta step with h=1/2 for y'=y, y(0)=1. Give all four stage slopes, the exact rational update and a Taylor-remainder interval for exact-minus-computed error. Explain why this scalar computation alone does not prove fourth order for a general nonlinear vector field.
Show the answer and reasoning
The stages are 1, 5/4, 21/16, 53/32 and the update is 211/128. The positive error e^(1/2)-211/128 lies between 1/3840 and e^(1/2)/3840. The general order claim also requires the nonlinear mixed-derivative terms, not just this stability polynomial.
The slopes are k_1=1, k_2=1+(h/2)k_1=5/4, k_3=1+(h/2)k_2=21/16, and k_4=1+h k_3=53/32. Here slopes rather than already multiplied increments are being named k_i; the final update therefore includes the factor h. The weighted update is 1+(h/6)(k_1+2k_2+2k_3+k_4)=211/128. Equivalently it is R(1/2), where R(z)=1+z+z²/2+z³/6+z⁴/24. The exact value is e^(1/2), so the method gives the fourth-degree exponential Taylor polynomial on this scalar linear problem. Taylor's real remainder is e^ξ(1/2)^5/5! for some 0<ξ<1/2. Therefore 1/3840≤e^(1/2)-211/128≤e^(1/2)/3840, with strict inequalities also available. These are analytic remainder bounds, not a floating-point subtraction that could hide a small positive difference. A scalar linear test has no second or higher derivatives of the vector field, so it cannot check the additional rooted derivative combinations occurring for nonlinear equations. The full fourth-order argument must compare those stage terms with the exact vector Taylor expansion under suitable smoothness and domain hypotheses. Also, positive y'=y genuinely grows: |R(1/2)|>1 is not a failure to reproduce a decaying solution.
Apply BDF2 to y'=0 whose true solution is 1, starting with Y_0=1 and Y_1=1+ε. Solve the recurrence for arbitrary n, compute Y_2-1 and its limit, and explain what the example says about zero stability and a second-order starter.
Show the answer and reasoning
Y_n-1=(3ε/2)(1-3^(-n)), so Y_2-1=4ε/3 and the limit is 3ε/2. The starting perturbation remains bounded but generally persists. To retain second-order global accuracy, this starting error must itself be O(h²).
With zero right-hand side, BDF2 gives 3Y_(n+2)-4Y_(n+1)+Y_n=0. Subtracting the constant true solution leaves the same homogeneous recurrence for e_n=Y_n-1. Its characteristic roots are 1 and 1/3, both simple, so e_n=A+B3^(-n). The initial conditions give A+B=0 and A+B/3=ε. Thus A=3ε/2, B=-3ε/2, and e_n=(3ε/2)(1-3^(-n)). At n=2 this is (3ε/2)(8/9)=4ε/3. As n increases it tends to 3ε/2 rather than zero. For every n≥0, |e_n|≤3|ε|/2. This is bounded amplification of the starting error, consistent with the root condition: the unit root is simple and the parasitic root lies strictly inside the unit disk. The decaying root removes one transient component but the constant mode retains the remaining perturbation. Zero stability is not error elimination or an absolute accuracy guarantee. On a fixed interval with h tending to zero, a second-order global claim requires the supplied starting values to have errors O(h²), along with consistency, regularity and stability hypotheses. A fixed nonzero ε violates that requirement even though this recurrence has no truncation error for the constant solution.
Use velocity Verlet for q'=p, p'=-q with q_0=0, p_0=1 and h=1/2. Compute its half-step and final values, its matrix determinant, physical energy and an exactly preserved positive modified quadratic energy. State the reversibility and step-size qualifications.
Show the answer and reasoning
p_(1/2)=1, q_1=1/2, p_1=7/8. The step matrix has determinant 1. Physical energy changes from 1/2 to 65/128, while [p²+(15/16)q²]/2 remains 1/2. The constant-step matrix reverses under h↦-h; positivity here follows from |hω|=1/2<2.
The first half-kick gives p_(1/2)=p_0-(h/2)q_0=1. The drift gives q_1=q_0+h p_(1/2)=1/2. The second half-kick gives p_1=p_(1/2)-(h/2)q_1=1-1/8=7/8. The ordering and use of the updated position in the second kick are part of the method. In the ordered state (q, p), the matrix is [[7/8, 1/2], [-15/32, 7/8]]. Its determinant is 49/64+15/64=1. Its inverse equals the same formula with the signed step -1/2, reflecting the symmetric kick-drift-kick composition. This is a reversible, area-preserving step in exact arithmetic. The physical Hamiltonian is H=(p²+q²)/2. Initially it is 1/2; after the step it is [(7/8)²+(1/2)²]/2=65/128. Thus this symplectic method does not exactly preserve the original energy on this example. Determinant one alone would not imply that energy identity either. For constant h=1/2 and ω=1, the modified quadratic is H_h=[p²+(1-h²/4)q²]/2=[p²+(15/16)q²]/2. At the new state its doubled value is 49/64+15/64=1, and the general matrix identity preserves it on every step. Its positive definiteness requires |hω|<2. Arbitrary varying steps do not preserve this same fixed quadratic, and arithmetic errors require separate treatment.
Discretize -u''=2 on [0, 1] with zero boundary values using N=4 equal subintervals. Verify the exact grid vector and evaluate the residual of Û=(31/160, 1/4, 29/160). Derive a rigorous infinity-norm error bound using the discrete barrier x(1-x)/2 and compare it with the actual error.
Show the answer and reasoning
The matrix is 16[[2, -1, 0], [-1, 2, -1], [0, -1, 2]] and the exact grid vector is (3/16, 1/4, 3/16). The residual b-AÛ is (-1/5, 0, 1/5); the barrier gives error at most 1/40. The actual grid error is (-1/160, 0, 1/160), of norm 1/160, with zero truncation error for this quadratic.
The mesh width is h=1/4. The centered negative second difference gives A=16[[2, -1, 0], [-1, 2, -1], [0, -1, 2]], and the right-hand side is (2, 2, 2). The exact continuous solution is u=x(1-x), which has grid values U=(3/16, 1/4, 3/16). A centered second difference differentiates this quadratic exactly, so AU=b and there is no grid truncation error in this example. The proposed vector is Û=U+(1/160, 0, -1/160). Multiplying that perturbation by A gives (1/5, 0, -1/5). Therefore r=b-AÛ=(-1/5, 0, 1/5), with ||r||∞=1/5. The sign follows the stated residual convention; the exact grid error e=U-Û satisfies Ae=r. For the barrier v_i=x_i(1-x_i)/2, the same difference operator gives Av=(1, 1, 1), with zero boundary values and 0≤v_i≤1/8. The discrete maximum principle applied to (1/5)v±e gives |e_i|≤(1/5)v_i. Hence ||e||∞≤(1/8)||r||∞=1/40. The h^(-2) scaling of A is essential to this constant. Direct subtraction gives e=(-1/160, 0, 1/160), so the actual error norm is 1/160, smaller than the valid barrier bound. For a nonquadratic C⁴ solution, the right side of the error equation also includes the bounded mesh truncation term; model and data errors are further contributions. A small algebraic residual alone does not certify the continuous solution unless those other terms and the inverse bound are also justified.
What to carry forward
- Polynomial exactness concerns truncation; value uncertainty and arithmetic remain separate contributions.
- A quadrature remainder needs the stated smoothness and width convention, and a sampled difference is usually an estimator.
- A substitution preserves the improper target; convergence, endpoint smoothness and a certified tail are different questions.
- Monte Carlo variance reduction depends on a probability model, independence and a finite population variance.
- Local existence and a small local defect do not establish a valid global trajectory or continuation through a singularity.
- Order, absolute stability, nonlinear stage existence and resolution of a fast transient must each be justified.
- Symplectic or reversible steps preserve stated geometric structures; they need not preserve the original energy exactly.
- A complete result names its error budget and stop reason, including event uncertainty, mesh error, solve error and the limits of the scientific model.
References
Sources for the concepts and teaching approaches in this article.
- QuadratureNIST Digital Library of Mathematical FunctionsInstitutional mathematical reference
Tobin A. Driscoll and Richard J. Braun4 sources
- Adaptive integrationTobin A. Driscoll and Richard J. BraunAuthor textbook
- Improper integralsTobin A. Driscoll and Richard J. BraunAuthor textbook
- Adaptive Runge–KuttaTobin A. Driscoll and Richard J. BraunAuthor textbook
- Collocation for linear problemsTobin A. Driscoll and Richard J. BraunAuthor textbook
- Simple Monte CarloArt OwenAuthor course notes · PDF
- Numerical Solution of Differential Equations ITyrone ReesAuthor course notes · PDF
- solve_ivpSciPy developersOfficial software documentation
- Geometric Numerical Integration, Lecture 2: Symplectic IntegratorsErnst HairerAuthor course notes · PDF