Numerical integration Created 2026-10-03 Updated 2026-10-14
Numerical integration approximates a definite integral using finitely many sampled function values. For an integrand on a finite interval , , a quadrature rule has the form
The 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]
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]
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 give
In 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.
Figure 1.
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.
Figure 2.
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]
The dispersion relation has two additional arguments with the same value. Indeed,
Thus use the cubic Stokes dispersion symmetry
Both roots are in the lower half-plane for . At , , their imaginary parts are . A root cannot cross the real axis in , since a real root would make . Continuity therefore proves the claim throughout this connected domain. The branch points are outside ; interchanging the two root labels does not change the formula below.
Evaluate the global relation at each , where its analyticity requirement holds:
The left side is linear in . Interpolate it to the argument with weights
They satisfy and . Hence
For the last coefficient, use
adding and subtracting the interpolated gives .
The remaining solution-transform contribution is . Its integrand is holomorphic in : the transformed arguments remain in the lower half-plane. The weights are bounded at infinity, and supplies decay on the upper closing arc for . The Cauchy integral theorem therefore makes this integral zero. Put
The Dirichlet spectral representation for the linear dispersive Stokes equation is now
All quantities in this expression are transforms of the prescribed initial and boundary values. Neither derivative trace remains.
Fix . In the representation from (c), the finite-horizon extension of a boundary transform allows to be replaced by . To see this directly, their difference contributes
It has an holomorphic integrand inside ; there , and the factors and allow the contour to be closed. Its integral is zero for . This replacement puts the observation-time dependence entirely in .
Every such exponential satisfies the linear dispersive Stokes equation, because
Consequently the representation satisfies the partial differential equation. The stipulated smoothness and decay justify the differentiated oscillatory integrals, or equivalently their regularized limits. The fixed horizon is useful here: no artificial source term arises from differentiating the endpoint of a time transform.
At , use the original version. The integral vanishes after closing inside , since is holomorphic there and . Fourier inversion of the initial half-line transform therefore gives
For the boundary trace use the fixed-horizon version, with . First consider the initial-data terms at . Differentiating gives
Thus changing variables separately in the two pieces of the integral gives
where goes from lower-left infinity to , across to , and then to lower-right infinity along . For completeness, on the upper-right curved edge one root maps onto the real ray and the other onto the lower-right curved edge. On the upper-left edge the corresponding images are and the lower-left edge. The middle segment maps to the remaining real intervals and . These real images cancel the outer pieces of the original real-axis integral, leaving exactly with the stated orientation.
This contour bounds the lower-central region , . The spatial transform is holomorphic there and decays on its closing arcs for . Its integral is therefore zero by the Cauchy integral theorem. The initial-data part of the boundary trace vanishes.
In the remaining boundary integral, use . Along the oriented , traverses the imaginary axis once from to . On its real segment, the imaginary part runs from to ; the two curved edges supply the complementary intervals. It follows that
The last equality is ordinary temporal Fourier inversion, after . Because is strictly inside it gives the full value, not a truncated-transform endpoint half-value. Thus
Compatibility makes the two traces agree at the corner. Spatial decay follows from the upper-contour exponential and nonstationary oscillatory estimates on the real integral as , under the assumed data decay.
The decaying smooth solution is also unique. For a zero-data difference , integration by parts in the linear dispersive Stokes equation gives
using and decay at infinity. The initial norm is zero, so . This completes verification of the initial value, boundary value and governing equation.
Use the Wirtinger derivatives and . The Laplace equation gives , so write
where is holomorphic in the first quadrant and is holomorphic in the fourth quadrant. They are independent functions: the data may be complex, so a complex-conjugation relation between them cannot be assumed.
Let , where . The oblique derivative boundary conditions become
The hinted complementary traces would give
Here is a function of on the horizontal side; the printed range in that hint is a variable typo. We shall eliminate the same unknown traces by reflection of the holomorphic derivatives.
The polygonal ray formula can first be viewed as the Cauchy integral formula. For an oriented edge point , choose its spectral ray so that decays for interior . Then
Interchanging the edge and ray integrals in the supplied formula gives , with counterclockwise edge orientation. Thus a quadrant limit of that formula can be evaluated by the corresponding holomorphic boundary jumps, provided the additional arcs at infinity and at the corner give no contribution.
Define an holomorphic function separately in the four quadrants by
The angle condition gives . It makes the reflected definitions consistent, with parity . On each axis oriented outward from zero, let . The two known boundary equations give all four jumps:
For example the vertical equation gives ; reversing the jump order on the upward axis accounts for its displayed sign. The horizontal equation similarly supplies the positive real-axis jump, and reflection supplies the other two.
Apply the Cauchy integral formula in the four quadrants and combine their common edges. The edge contributions are exactly the known jumps of this scalar Riemann-Hilbert problem. If the corner and large-arc integrals vanish, the representation in the first quadrant is
This is the rational-angle oblique derivative problem on a quadrant representation, with all unknown traces removed. The Cauchy integrals have precisely the displayed jumps by the Sokhotski–Plemelj formula. Their reflection parity then reconstructs from the fourth-quadrant value of , so the two original boundary equations hold. Integrating and gives a harmonic function up to an additive constant.
To put the answer back on the spectral rays of the question, define
Use , , and the same identities with replaced by and the ray . The spectral representation is
All transforms used on these rays are ordinary boundary values of convergent half-line transforms. For with , the real-ray integrand decays through and the imaginary-ray integrand through .
There is an admissibility qualification in passing from a bounded polygon to this unbounded quadrant. Sufficient conditions are at infinity uniformly away from the axes, with the corresponding large-arc integral tending to zero, and uniformly on small corner arcs. The latter allows logarithmic gradient singularities but excludes a pole with nonzero corner contribution. Smooth decaying data alone, as printed, do not impose these conditions on .
For a concrete homogeneous corner ambiguity in a quadrant Laplace problem, with and zero data, satisfies both prescribed tangential derivative conditions but has , while the displayed particular representation is zero. With , the zero-data solution has : it decays at infinity but has an excluded corner pole. Thus no unique representation of every unrestricted solution follows from the printed data alone. Without the arc conditions, one must add a homogeneous holomorphic term to the displayed , with reflected parity ; permitted corner singularities are included if the admissible class allows them. With the stated decay and corner conditions that term vanishes, giving the boxed formulas. This identifies the missing solution-class conditions without assuming real-valued data.
Take the negative-exponential Half-range Fourier transform and set
The advection-diffusion equation has the local relation with flux . Integration over the half-line gives the half-line drift global relation
For the upper decay domain
write . It is the region above , in particular above . Its boundary is oriented from upper-left infinity through to upper-right infinity, with the domain on the left. Fourier inversion and deformation of the boundary terms give
Use the dispersion symmetry elimination of a boundary trace . It preserves and maps into the lower half-plane. Because , the global relation at implies
The last term contributes an holomorphic upper-domain integral multiplied by , so it vanishes upon closing the contour for . The solution representation with only known data is consequently
For the boundary value , direct integration gives
This quotient is an entire function of when its apparent singularities at are filled by their limits. Those points are not genuine forcing poles of the finite-time transform.
To obtain an exponentially decaying spectral integrand, choose and the exponential-decay contour for half-line drift diffusion
Deform to . No pole is crossed: the initial-data denominator in that boundary integral has its only pole at , which lies below since . The apparent singularities of the forcing transform are removable. In the swept outer sectors, has the appropriate bounded growth for the deformation. The contour formula becomes
Evaluate the second quotient as a removable expression at , rather than splitting it into artificial residue terms. On either ray,
Since , the transient factors have Gaussian decay as . The nontransient forcing term is and thus also decays exponentially for every . The real-axis integral has the Gaussian factor . These estimates provide the requested improvement over integration along .
Figure 1.
Upper cubic-dispersion contour and exponentially decaying drift-diffusion contour, with their orientations
. Details.
The first panel shows the cubic domain from Question 1. The second uses and ; its marked initial-data pole corresponds to and lies below both boundary contours.
An independent real-kernel form also makes the initial and boundary traces explicit. Apply the Dirichlet gauge transform for constant drift, , and then multiply by to obtain the heat equation. The odd-reflected heat kernel for initial data and its Dirichlet boundary-forcing heat-kernel formula yield
The first kernel tends to the initial delta kernel on as and vanishes at . For the second kernel, the substitution gives the unit-mass approximate boundary delta as , so its trace is ; it vanishes initially for fixed . Differentiating the kernels for verifies the advection-diffusion equation. The integrals converge for every positive , even when the exponentially weighted initial datum grows, because the spatial Gaussian controls that growth. Thus this gives the same decaying solution without introducing an additional restriction on .
For a general decaying initial datum, an unweighted Fourier sine transform does not directly diagonalize the drift operator. Define
Two integrations by parts for and one for give
The cosine transform remains unknown, so this is not a closed sine-transform evolution. In contrast, the weighted sine transform for half-line drift diffusion of is closed:
When the weighted initial transform exists, Fourier sine inversion gives . This method requires suitable decay of , not merely decay of . For the exponential datum it is an ordinary integrable sine transform only when . At one would need a generalized or regularized transform instead; the contour and real-kernel formulas above already work without that restriction. Therefore the ordinary sine transform of is not a closed solution method; a weighted sine transform works under the stated extra weighted-decay condition.
Put . The nonnegative integrand allows Tonelli's theorem to write the square as a double integral:
In polar coordinates, , , and the Jacobian determinant supplies the area factor :
Since , take the positive square root to get . The computation proves finiteness as well as the value. For an explicit limiting argument, first integrate over disks of radius ; their integrals are , which increase to as . [ref]
Figure 1.
Gaussian height times the circumference of a ring gives its radial contribution
. Left: is constant around each circle; the marked annulus illustrates a finite-width shell. Right: the radial contribution includes the circumference factor and integrates to . The shell in the picture has finite width; is the infinitesimal area element. Details.
The geometric surprise is that radial shells get longer as increases, even while the Gaussian function gets smaller. Its central height is largest at zero, but the radial contribution vanishes there and peaks at . Differentiating gives , which changes sign at that radius. Keeping the Jacobian determinant is what makes the one-dimensional integral and the plane geometry agree.
Quadrature node 2026-10-14
A quadrature node is a point at which the integrand is sampled by a quadrature rule. Under the affine map from to , a reference quadrature node becomes ; for ordinary numerical integration, the corresponding quadrature weight is multiplied by .
Quadrature rule Created 2026-09-24 Updated 2026-10-14
A quadrature rule approximates an integral by a finite weighted sum of sampled function values:
The quadrature nodes specify where to sample, and the quadrature weights specify how much each sample contributes. The density specifies the target integral, whereas the discrete quadrature weights belong to the approximation. Ordinary numerical integration has . Gaussian quadrature and the midpoint quadrature rule choose interior quadrature nodes; the trapezoidal rule includes endpoints.[ref]
For ordinary numerical integration, exactness on the constant function requires ; exactness on additionally requires . These two checks make the quadrature rule exact for every affine function. For example, both the midpoint quadrature rule and trapezoidal rule give for . Testing progressively higher polynomial degrees defines the degree of precision of a quadrature rule. Exactness describes a class of integrands, rather than promising exact results for every function.
Composite midpoint quadrature rules and composite trapezoidal rules apply a simple quadrature rule on every panel of a partition of an interval. This buys accuracy by shrinking the panels while keeping the elementary formula fixed. For continuous functions sampled exactly, their quadrature errors tend to zero as the largest panel width tends to zero. The familiar second-order bounds require stronger assumptions about derivatives. The signed approximation error used here is ; some sources define quadrature error with the opposite sign, so the convention must accompany any formula.
Quadrature weight 2026-10-14
A quadrature weight multiplies a sampled integrand value in a quadrature rule. For ordinary numerical integration, its units match those of the integration variable. Positive quadrature weights that sum to make a weighted average of the samples; signed quadrature weights can magnify sample perturbations, as quantified by noise sensitivity of a quadrature rule.
Signed area under a graph 2026-10-14
For and a real-valued function with a finite Riemann integral or Lebesgue integral on , the signed area under a graph is its definite integral: geometric area above the horizontal axis contributes positively, and geometric area below it contributes negatively. If these two nonnegative areas are and , then
The second expression is the total geometric area under a graph. Taking the absolute value of the first expression does not usually give the second: cancellation has already removed information about how much area lies on each side.[ref]
For an exact example, take the polynomial function on . Its polynomial roots are and : it is negative between them and positive on the two outer intervals. An antiderivative is , so the fundamental theorem of calculus gives
Thus and . The signed area under a graph is , whereas the total geometric area under a graph is . To compute the latter with antiderivatives, split at each sign-changing polynomial root and reverse the sign of the negative contribution.
Figure 1.
The polynomial x squared minus one has signed integral 4/3 and total geometric area 4 on the interval from minus two to two
. Details.
Cancellation is useful information when the integrand represents a signed contribution. For the polynomial function on , the two triangular areas give , although . Zero net signed area therefore means balanced positive and negative contributions, rather than an empty region.
The short algebraic justification uses the positive part and negative part : and . Their integrals give and , and linearity of integration gives the difference and sum formulas. For Lebesgue integration, require both contributions to be finite to avoid the undefined subtraction .[ref]
Trapezoidal rule Created 2026-09-24 Updated 2026-10-14
As a quadrature rule, the trapezoidal rule replaces an integrand by the linear interpolation joining its two endpoint values:
For nonnegative endpoint values, this is the area of a trapezoid; in general it is a signed area. The quadrature nodes are , each with quadrature weight . Unlike the midpoint quadrature rule, it uses endpoint samples, which can be reused between adjacent panels.
Every affine function agrees with its linear interpolation, so the trapezoidal rule integrates it exactly. On , gives . On , the polynomial instead gives , exceeding by . Its degree of precision of a quadrature rule is exactly one.
If , its signed approximation error satisfies
A convex function lies below its endpoint chord, so the trapezoidal rule overestimates its integral; a concave function gives the reverse inequality. The error formula assumes that the second derivative exists and is a continuous function throughout the closed interval.[ref] A short derivation is the identity
obtained by two integrations by parts. The nonnegative Peano kernel has integral , and the weighted mean value theorem for integrals gives the formula.
This time-stepping use applies the same trapezoidal rule to the integral of the derivative in an ordinary differential equation. That connection explains its place under implicit Runge-Kutta methods; its quadrature behavior and the nonlinear issue in trapezoidal rule fails B-stability concern different uses of the same endpoint averaging.