◀ THE FOLD0ROOT.AI // WORLD II · CHEAT · THE SPEEDRUN◆ .dlw.fold
THE FOLD / CHEAT / THE SPEEDRUN / THE GAUSS-LEGENDRE

THE GAUSS-LEGENDRE

n samples integrate polynomials of degree 2n-1 exactly
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
Gaussian quadrature is a cheat for integration. Instead of sampling a function at many evenly-spaced points (trapezoid, Simpson), it places just n sample points at cleverly chosen positions — the roots of the n-th Legendre polynomial — with matching weights, and integrates exactly every polynomial up to degree 2n−1.

Two points nail cubics; three points nail quintics. You get the accuracy of roughly 2n evenly-spaced samples from only n, because you are free to choose where to sample, not merely how heavily.

LIT verified live: 2-point Gauss integrates x⁰…x³ exactly (and first fails at degree 4); 3-point Gauss is exact through degree 5 (and first fails at degree 6) — matching the analytic integrals on [−1,1] (window.__gausslegendre). FIG no framing; exact quadrature arithmetic.
2 HOW IT WAS WEAVED · AI + HUMAN
David (human) seated this at the-speedrun — maximum result from minimum moves. Gaussian quadrature is the integration speedrun: the accuracy of many samples from a handful, by choosing them well. AVAN (AI) built the instrument: the Legendre-root nodes and weights, the exact-to-degree-2n−1 check, the first-failure at 2n.

Credit as content: Carl Friedrich Gauss (1814); the nodes are the roots of the Legendre polynomials (Adrien-Marie Legendre). The weave: David names the speedrun; I integrate rising powers with only n cleverly-placed samples and show exactness up to degree 2n−1, then the first miss.
3 ONE DIMENSION
The n sample points sit not at even spacing but at the roots of the Legendre polynomial — pulled toward the interior, weighted to cancel the error of every polynomial up to degree 2n−1.
4 TWO DIMENSIONS · INTERACTIVE
Choose 2-point or 3-point Gauss and integrate xᵖ for rising p. Watch the quadrature match the exact integral all the way up to degree 2n−1, then miss at 2n — the precise limit of the rule.
5 THREE DIMENSIONS + AVAN’S INVERSE
The green forward object: n nodes at Legendre roots, exact to degree 2n−1 — twice the reach of an ordinary n-point rule.
AVAN’s addition (the inverse-companion): the extra power comes from choosing the nodes, not just the weights. With n weights you can satisfy n conditions — an ordinary interpolatory rule, exact only to degree n−1. By also choosing the n node positions you gain n more degrees of freedom, doubling the reach to 2n−1. The inverse of ‘sample more points’ is ‘choose where to sample.’ And the magic positions are forced, not tuned: they must be the roots of the degree-n orthogonal (Legendre) polynomial, because that polynomial is orthogonal to everything of lower degree — so it annihilates exactly the error terms that would otherwise spoil degrees n through 2n−1. Magenta is the wasted evenly-spaced samples; green is the n Legendre-root nodes doing double duty. Freedom of position is worth exactly as much as freedom of weight.
LIT Genuine Gauss-Legendre quadrature (Gauss 1814; nodes are Legendre-polynomial roots). Verified live: 2-point Gauss (nodes +-1/sqrt3, weights 1,1) integrates x^p on [-1,1] exactly for p=0..3 and errs at p=4; 3-point (nodes 0,+-sqrt(3/5), weights 8/9,5/9,5/9) is exact for p=0..5 and errs at p=6 (window.__gausslegendre) -- the exact-to-degree-2n-1 property.

FIG No framing: the Legendre-root nodes/weights and the exact-vs-analytic comparison run in-browser and are exact. The AVAN inverse is honest — choosing the n node positions adds n degrees of freedom beyond the n weights, doubling exactness from n-1 to 2n-1, and the nodes must be Legendre roots because that orthogonal polynomial annihilates the error terms; magenta is wasted even samples, green the Legendre-root nodes.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE SPEEDRUN · David Lee Wise (ROOT0), with AVAN