A robot model may need an integral of a function that can be evaluated at chosen coordinates. Choosing two evaluation points inside an interval can integrate every cubic polynomial exactly, even without reading the endpoints. That is the two-node Gauss-Legendre rule. Its precision depends on the integrand and on carrying the interval transformation correctly; it does not make two arbitrary sensor samples sufficient to determine every possible integral.

This article uses invented, dimensionless functions as numerical examples. They are not a recorded robot trajectory, force trace, or energy measurement. Stanford's MATH114 teaching module develops Gaussian quadrature through polynomial moments. NumPy's leggauss documentation, displaying manual version 2.5 when checked, describes nodes and weights for the constant-weight interval from -1 to 1. The examples below are independent arithmetic, and no numerical library was executed.

Begin with the reference interval [-1, 1]. Use nodes -r and +r with equal weights w. To integrate the constant function one correctly, the weighted sum must equal the interval's length: 2w = 2, so w = 1. Odd powers cancel between the two symmetric nodes. To integrate x squared correctly, require 2r squared = 2/3. Hence r = 1/sqrt(3), approximately 0.577350269.

The resulting rule is Q(f) = f(-1/sqrt(3)) + f(1/sqrt(3)). Check its four moments explicitly. For one the sum is 2; for x it is zero; for x squared it is 2/3; for x cubed it is zero. These match the exact integrals of the four monomials.

For comparison, two symmetric nodes at -1/2 and +1/2 with the same unit weights would still integrate constants and odd powers correctly. Their squared values sum to 1/2 instead of 2/3. Symmetry and the correct total weight do not alone establish the quadratic moment. Because every cubic is a linear combination of 1, x, x squared, and x cubed, the Gauss rule derived above reproduces the integral of every cubic in exact arithmetic.

For an original mixed example choose f(x) = 4 + 3x + 2x squared + x cubed. The exact integral is 8 + 4/3 = 28/3. In the two evaluations, the odd contributions cancel, while the constant contributions sum to 8 and the quadratic contributions to 4/3. The quadrature therefore gives 28/3, approximately 9.333333, without either endpoint being sampled.

Precision through degree three does not imply precision at degree four. For f(x) = x to the fourth power, each node produces 1/9, so Q = 2/9, approximately 0.222222. The exact integral is 2/5 = 0.4. Their difference is 8/45, approximately 0.177778. A smooth polynomial can therefore be a counterexample without any discontinuity or noisy input.

Next move to an interval [2, 6]. Its midpoint is 4 and its half-width is 2. Set x = 4 + 2t, with t between -1 and 1. The differential changes as well: dx = 2dt. Consequently the transformed integral is twice the integral of f(4 + 2t). The two physical nodes become 4 - 2/sqrt(3) and 4 + 2/sqrt(3), approximately 2.845299462 and 5.154700538.

Each transformed weight is 2. A constant integrand of one therefore returns 2 + 2 = 4, the length of the new interval. Omitting the differential's factor would return 2 instead. This constant-function check isolates an interval-mapping error before it becomes hidden inside a more complicated function evaluation. Moving the nodes alone is not a complete change of variables.

Use a second invented cubic g(x) = 1 + 2x + x squared + x cubed on [2, 6]. Its antiderivative is x + x squared + x cubed/3 + x to the fourth power/4. At 6 that expression is 438; at 2 it is 38/3. The exact difference is 1276/3, approximately 425.333333. Evaluating g at the two transformed nodes and multiplying each result by 2 gives the same value.

A two-point rule still cannot infer an arbitrary unsampled shape. Consider h(x) = (x squared - 1/3) squared on the reference interval. It is nonnegative everywhere and exactly zero at both Gauss nodes. The quadrature returns zero. Expanding gives x to the fourth power minus two thirds x squared plus 1/9, whose exact integral is 2/5 - 4/9 + 2/9 = 8/45, a positive number.

The last example has a practical interpretation for model evaluation: two zero function values do not establish that the function vanishes between or around the nodes. The rule is exact on a declared polynomial class, not an observation that everything else is absent. An error assessment for a nonpolynomial model needs additional information about the function or a separate numerical comparison.

There is also a distinction between an evaluable model and a fixed record. If a robot log contains values only at its original timestamps, the Gauss nodes may not coincide with those timestamps. Producing values there requires a reconstruction assumption. Quadrature exactness then concerns the reconstructed function, while the reconstruction's agreement with an unknown physical signal remains another question. It would be inaccurate to describe the two evaluations as additional measurements.

For a reproducible calculation, retain the integration interval, coordinate units or normalization, function definition, node locations, and weights together. Check a constant to validate total weight, then a chosen polynomial to validate the intended precision. The calculations here establish two-node cubic exactness and specific failure cases; they do not establish a universal error bound, a robot sampling requirement, or the performance of an integration package.

Concept illustration: an existing site-library robot-and-laptop workspace represents numerical modeling. It is not a plot of these invented functions, a robot log, or an integration benchmark.

Sources checked October 24, 2026: Stanford MATH114, Gaussian quadrature, https://web.stanford.edu/class/math114/decks/quadrature/gauss_quad.html ; NumPy v2.5 Manual, leggauss, https://numpy.org/doc/stable/reference/generated/numpy.polynomial.legendre.leggauss.html .