Composite Simpson's rule 2026-10-18
Composite Simpson's rule applies Simpson's rule to consecutive pairs of equal subintervals. Choose a positive even integer , put , and take quadrature nodes for . There are subintervals, two-subinterval panels, and quadrature nodes. ThenThe second sum is empty when , recovering one panel. The quadrature weights, before multiplication by , are . Every interior even-indexed quadrature node is an endpoint of two panels, so its two endpoint contributions add to two; every odd-indexed quadrature node is a midpoint with weight four. An odd cannot be covered by these pairs. The displayed formula requires equal spacing.[ref]
5.6 Numerical integration. Fundamentals of Numerical Computation by Tobin A. Driscoll and others; §5.6, equations 5.6.20–5.6.21: elementary and composite Simpson formulas
For the exponential function on the interval , the exact integral is . With , the formula gives , an overestimate of about . With , it gives , an overestimate of about . The figure shows the intermediate refinements and compares every computed absolute error with the error bound for composite Simpson's rule.
Computed composite Simpson errors for the exponential function on zero to one approach fourth-order convergence; the dashed curve is the rigorous bound e over 180 n to the fourth power
. Details. For this exponential function, a geometric series also gives a compact independent formula. With and , summing the panel contributions yieldsA Taylor series at givesThe Big O notation describes the remaining terms as tends to zero. Consequently tends to sixteen: the computed ratios increase from about to . Fourth-order truncation error is also obtained by Richardson extrapolation of the composite trapezoidal rule.[ref]
5.6 Numerical integration. Fundamentals of Numerical Computation by Tobin A. Driscoll and others; §5.6.2, equations 5.6.14–5.6.15: Simpson extrapolation and fourth-order error
Composite trapezoidal rule Created 2026-10-14 Updated 2026-10-31
On an equal-panel partition of an interval, with , sum the trapezoidal rule over adjacent panels:There are distinct quadrature nodes. Each interior sample belongs to two panels and therefore has quadrature weight , while each endpoint has quadrature weight . Equivalently, the composite trapezoidal rule integrates the piecewise linear function obtained by linear interpolation exactly.[ref]
For and , summing panel quadrature errors givesfor some . Thus panel quadrature errors of order accumulate to order , using big O notation.[ref]
3.5 Quadrature, subsection (i) Trapezoidal Rules. §3.5(i), equations 3.5.2–3.5.3: composite formula and signed error
On a nonuniform partition of an interval with widths and largest width , the bound is .For the polynomial on , direct summation yieldsBoth quadrature errors shrink by exactly four when doubles, with opposite signs. This exact relation belongs to this polynomial example; the trapezoidal rule is not always twice as inaccurate as the midpoint quadrature rule.
Quadratic quadrature errors fall by four on refinement while a common sample bias persists
. Details. The left plot uses exact polynomial sums; the right adds a common sample bias to the composite trapezoidal rule. That mathematical model converges to , showing why smaller panels alone do not ensure accuracy for noisy samples. It illustrates noise sensitivity of a quadrature rule, rather than measured data.
Fresnel slit propagation 2026-10-18
Consider a uniform plane wave of unit complex amplitude transmitted by an ideal optical slit of full width . Treat the field as invariant along the optical slit height: this is one-dimensional transverse Fresnel propagation, so the prefactor is , rather than the two-dimensional prefactor . Removing the carrier givesHere is incident irradiance. This infinitely long slit model describes a transverse cut away from the ends of a sufficiently long physical slit; its finite conserved quantity is transmitted power per unit optical slit height.
Put and . Substitution reduces the integral toThis form separates the pattern's shape from its physical scale. Reflection proves , so the light intensity is an even function of . At , direct integration gives , with limit one at . Hence the Fraunhofer diffraction comparison is the squared sinc function. In this paragraph the unnormalized sinc function takes argument .
For an original example, choose wavelength and full width . At , , and the edge-to-centre wave phase change is radians. At , , and that wave phase change is only radians. Even the nearer screen is fifty slit widths away; that geometric comparison alone misses its strong Fresnel diffraction.
Original calculated Fresnel diffraction profiles of a 0.400 mm slit at 633 nm, compared with the Fraunhofer diffraction shape
. Details. These are numerical predictions from the displayed scalar integral, using the composite trapezoidal rule, rather than measured profiles. Each curve is divided by its own peak light intensity; the two horizontal scales differ. At 2 cm the computed central irradiance is about , with brighter off-axis maxima. At 2 m it is about and is the peak. The dashed Fraunhofer diffraction curve has its own central normalization; its first zeros are at . The finite-distance Fresnel diffraction curve remains slightly nonzero there.
Normalization hides the brightness change, but not the change in shape. The Fourier transform propagation multiplier has unit complex modulus, so Plancherel theorem givesThis is conservation of transmitted power per unit height in the ideal scalar model. An integral over only the displayed screen interval misses the tails; a peak-normalized profile is not a unit-integral probability density. Spreading and decreasing brightness together preserve the transmitted power.
Midpoint quadrature rule Created 2026-10-03 Updated 2026-10-14
The midpoint quadrature rule replaces the integrand on , , by its value halfway across the interval:Geometrically, is the signed area of a rectangle with width and height . Its single quadrature node is and its quadrature weight is . Sampling in the interior is useful when endpoint evaluation is inconvenient, although an endpoint singularity can invalidate the quadrature error estimates below.
The midpoint quadrature rule is exact for every affine function : the average height over an interval equals its midpoint height. For example, on , gives and . Positive and negative area discrepancies cancel for a sloping straight line. For the polynomial on , however, and , giving approximation error . Thus its degree of precision of a quadrature rule is exactly one.[ref]
5.8 Numerical Integration. §5.8, printed p. 223: midpoint rectangles, linear exactness and signed quadratic errors
For the polynomial on , four panels give composite midpoint quadrature rule value and composite trapezoidal rule value , bracketing the exact integral . Individual midpoint rectangles can cross the curve; it is their total signed area that underestimates the integral.
For , meaning that its first two derivatives exist and are continuous functions on the closed interval, the signed approximation error has the formHence a convex function with is underestimated, and a concave function with is overestimated. A short justification uses the Taylor formula with integral remainder: writing , it gives , where for and for . This nonnegative Peano kernel has integral , so the weighted mean value theorem for integrals gives the stated sign and coefficient.
Noise sensitivity of a quadrature rule 2026-10-14
If the observed samples are , the resulting quadrature rule changes by . Bounded sample perturbations therefore satisfyFor ordinary numerical integration with nonnegative quadrature weights exact on constant functions, the bound is , independent of panel refinement. A common bias attains it: the quadrature error due to the function approximation may vanish while this sample error persists. Interpolating a fixed data set onto a finer grid likewise does not create new observations or remove its uncertainty.
With new samples whose errors are independent random variables of zero expectation and common variance , a different model givesFor equal panels this is for the composite midpoint quadrature rule and for the composite trapezoidal rule. These variance reductions require the stated independence and unbiasedness assumptions; a common bias or correlated sample errors need not shrink. The two displayed perturbation formulas follow directly from the triangle inequality and the variance additivity for independent random variables, respectively.
Numerical integration Created 2026-10-03 Updated 2026-10-18
Numerical integration approximates a definite integral using finitely many sampled function values. For an integrand on a finite interval , , a quadrature rule has the formThe quadrature nodes tell us where to evaluate ; the quadrature weights turn those values into an approximation to the accumulated signed area. The exact definite integral depends on the integrand throughout the interval, whereas the quadrature rule sees only these samples. Integrating a chosen interpolant exactly still generally approximates the original integrand's integral.[ref]
5.6 Numerical integration. Fundamentals of Numerical Computation by Tobin A. Driscoll and others; Definition 5.6.1 and §5.6.1, equations 5.6.2–5.6.5: weighted samples and integration of an interpolant
The fundamental theorem of calculus evaluates as when an antiderivative is available. Numerical integration is useful when no convenient antiderivative is known, or each evaluation of the integrand requires an expensive computation. The task then becomes choosing informative quadrature nodes and controlling the quadrature error with as few evaluations as possible. Fixed data also permit a quadrature rule, but refinement cannot supply new information between observations.[ref]
5.6 Numerical integration. Fundamentals of Numerical Computation by Tobin A. Driscoll and others; Opening discussion, Example 5.6.1 and the paragraph following Definition 5.6.1: antiderivatives, numerical evaluation and fixed data
For an exact comparison, take the polynomial on . Its antiderivative gives . On a partition of an interval into equal panels, the composite midpoint quadrature rule uses midpoint samples, each with quadrature weight ; the composite trapezoidal rule uses endpoint samples, with outer quadrature weights and interior quadrature weights . The existing derivations under these two quadrature rules giveIn particular, and already bracket ; two panels give and . The convex function explains the opposite signs. A midpoint rectangle can cross the curve within its panel, so its total signed area, rather than pointwise ordering, determines the underestimate.
One and two panels for numerical integration of : midpoint and endpoint samples with their quadrature weights
. Details. Define the signed approximation error as . In this example the absolute errors are and : doubling reduces each by exactly four. A plot with both axes on a logarithmic scale therefore has slope , expressing order two with respect to panel refinement. This is an exact calculation for this polynomial, including , rather than an observed rate extrapolated from a few computed answers.
Exact absolute errors for midpoint and trapezoidal numerical integration of : slope and a factor-four reduction
. Details. For a general integrand, the composite midpoint quadrature rule and composite trapezoidal rule give second-order quadrature error bounds when has two continuous derivatives on and a known bound on . These hypotheses describe behavior between samples. A formal error formula containing an unknown derivative is not a numerical accuracy certificate or a justified sample count. Finite samples do not certify quadrature accuracy makes the missing information explicit. Errors in the evaluations and roundoff error must also be considered; noise sensitivity of a quadrature rule treats the former.
More elaborate choices exploit other information: Gaussian quadrature obtains high polynomial exactness from carefully chosen quadrature nodes, and Simpson's rule uses a quadratic interpolant. Adaptive numerical integration compares approximations and concentrates samples where they disagree, often saving evaluations. Such a difference is an error estimate, not a certified bound without further assumptions: both approximations can miss the same feature.[ref]
5.7 Adaptive integration. Fundamentals of Numerical Computation by Tobin A. Driscoll and others; §5.7.1, equation 5.7.4: a difference-based error estimate; §5.7.2: interval bisection; Example 5.7.2 and concluding discussion: requested accuracy is not guaranteed
Past exam of the numerical analysis course of the University of Oxford 2015 1 c ii Solution 2026-10-31
For every uniform partition of an interval with panels, the quadrature nodes satisfy . Their composite trapezoidal rule quadrature weights agree, so the two sampled sine values cancel. If there is a node at zero its sine value is already zero. The constant term is integrated exactly, givingThis is symmetric trapezoidal exactness for odd functions, applied after adding a constant function so that the resulting definite integral is nonzero. It is exactness for this particular integrand, rather than a claim that every nonpolynomial function is integrated exactly.
Past exam of the numerical analysis course of the University of Oxford 2015 1 c i Solution 2026-10-31
On a partition of an interval , apply the trapezoidal rule separately to each panel and add:For uniform spacing , this composite trapezoidal rule becomesEach interior sample occurs in two panels; their half-quadrature weights combine to . The endpoint quadrature weights are .
A linear spline is a continuous function whose restriction to every interval is a polynomial of polynomial degree at most one. With and , linear interpolation givesIntegrating the two linear polynomials and adding the contributions givesThis is the composite trapezoidal rule applied to the nodal values, and it is exact for the linear spline itself, including nonuniform spline knots.
A cubic spline on this partition of an interval is a function that restricts to a polynomial of polynomial degree at most three on every interval . Thus its second derivative is continuous and piecewise of polynomial degree at most one: is a linear spline on the same spline knots. Its third derivative is constant on each open interval and can jump across the spline knots; its fourth derivative vanishes inside each open interval.
Richardson extrapolation combines approximations with a known leading error power to cancel that error. If , then removes .
Let for an even number of equal subintervals, with . The composite trapezoidal rule isThe Simpson's rule isAssume an error expansion , with the same coefficient on refined uniform meshes; is sufficient for this form. The coarser rule is . Direct coefficient collection givesThe leading errors cancel, leaving . The identity of the numerical integration weights is exact; the error-order conclusion additionally uses the smoothness and even-power error assumptions.
For equal intervals, the composite trapezoidal rule isAdding the missing term therefore gives the exact relationSince is continuous, its Riemann sums, and hence its endpoint-averaged trapezoidal sums, converge to its definite integral. Thus and , givingNo pre-existing formula for the sum of squares is needed.
With step size , the composite trapezoidal rule gives half weight to the two endpoints:ThereforeIt exceeds the exact definite integral by , as expected because is a convex function and each trapezoid lies above the curve.
Write the sum in the question as the right Riemann sumRelative to the composite trapezoidal rule, the only change is in the two endpoint weights:The integrand is continuous on , so . Since an antiderivative is ,Thus
With step size and nodes , the composite trapezoidal rule givesThe endpoint weights are half the interior weights, and the endpoint values are and .
Let . The expression in part (ii) givesBecause is continuous on , the composite trapezoidal rule converges to its definite integral, which is by part (i). In fact its standard composite trapezoidal error bound is , since . Therefore
For the composite trapezoidal rule, the mesh width is and the nodes are . The endpoint weights are halves and the interior weights are ones, soThis formula is an approximation to the definite integral, not an exact equality with it for finite .
Put , , and . Under the endpoint-slope convention suggested by the requested connection, the recurrence is . Summing telescopes, soSince by the fundamental theorem of calculus, this recurrence gives exactly the composite trapezoidal rule. It replaces the average derivative over each strip by the arithmetic mean of its endpoint derivatives.
For the standard midpoint method, the literal endpoint-only request is not valid for general . Both the explicit and implicit one-step midpoint formulas here give insteadthe composite midpoint quadrature rule. It requires half-grid samples. These samples cannot be recovered exactly from for arbitrary smooth : the zero function and have identical grid values but different midpoint sums. For a smooth , replacing each half-grid sample by is an additional approximation, giving with an total difference, rather than an identity. A precise useful relation, obtained by splitting the finer trapezoidal sum into old nodes and midpoints, isHere uses the finer half-grid, so it does not eliminate the missing data.
If “Mid-Point Method” means the two-step explicit midpoint linear multistep method, the recurrence is . It gives and , so an odd final index additionally needs a starting value . For even , the result is the midpoint quadrature on double-width strips; equivalently . The question specifies neither even nor a starter. Thus the trapezoidal expression above is the natural endpoint-average interpretation, while the other common midpoint meanings require the qualifications just given. The ambiguity is present in the original PDF.
Divide into equal subintervals of width , with . Linear interpolation between adjacent values of gives a trapezoid of signed area . Adding these areas produces the composite trapezoidal ruleFor continuous , this tends to the integral as ; if has a bounded continuous second derivative, the error is at most .
The original PDF prints while using as the bound summation index and as the upper limit. Literally this does not specify a varying upper limit. Interpreting the intended limit as , and relabelling the summation index , gives the right Riemann sumFor , , and , the only difference from the composite trapezoidal rule is the endpoint weighting: . Hence
For , the composite trapezoidal rule isWith this becomesWrite the requested right Riemann sum as . The trapezoidal endpoint correction for a right Riemann sum givesThe integrand is continuous on , so the trapezoidal values converge to its definite integral; the endpoint correction tends to zero. Therefore





