{"uid":"cap_q1cDYzoIKD58DqUuVLgsp","slug":"sampled-series-integration-via-composite-trapezoidal-rule-4c8d5a38","name":"Sampled-Series Integration via Composite Trapezoidal Rule","description":"Apply the composite trapezoidal rule to 2-128 equally spaced integer samples. Returns an exact rational arithmetic result, declared units and an integrity receipt. No quadrature-error estimate or claim of an exact underlying integral. New modular adapter: retained result recovery for 24 hours, minimal receipt metadata for 90 days. Existing live route unchanged.","url":"https://www.mahastrategies.com/api/v1/compute/numerics/integration?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"xUnit":{"type":"string","maxLength":32,"minLength":1},"yUnit":{"type":"string","maxLength":32,"minLength":1},"spacing":{"type":"string","maxLength":19},"dataClass":{"enum":["public","synthetic"],"type":"string"},"ordinates":{"type":"array","maxItems":128,"minItems":1}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.018501","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.018501/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.018501","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.018501","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_9Mkmqoi3Feo9AgbznRtT8","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.018501","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Numerically integrates 2–128 equally spaced integer samples using the composite trapezoidal rule, returning an exact rational result with declared units and an integrity receipt.","exampleAgentPrompt":"Integrate these 8 equally spaced samples — [0, 3, 7, 12, 10, 6, 4, 1] — with a spacing of 0.5 seconds (x-unit: seconds, y-unit: volts), classified as synthetic data, and give me the exact rational result with a receipt.","exampleUseCases":[{"title":"Sensor data area-under-curve computation","prompt":"I have 16 equally spaced voltage readings from a sensor: [0, 2, 5, 9, 14, 11, 8, 5, 3, 7, 10, 12, 9, 6, 3, 1]. The spacing between samples is 0.1 seconds. Integrate them using the trapezoidal rule with x-unit 'seconds' and y-unit 'volts', treat the data as public, and return the exact rational result and integrity receipt."},{"title":"Physics experiment integral with audit trail","prompt":"Can you apply the composite trapezoidal rule to these 32 integer force samples from my lab experiment, spaced 0.25 meters apart? The samples are [10, 15, 20, 18, 14, 11, 9, 8, 7, 6, 5, 4, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 13, 12, 11, 10, 9, 8, 7, 6]. Use x-unit 'meters', y-unit 'newtons', data class 'synthetic', and I need the exact rational answer plus receipt for our audit."},{"title":"Synthetic signal energy estimation","prompt":"Integrate this synthetic test signal of 64 equally spaced integer amplitude samples using the trapezoidal method — spacing is 1 millisecond, x-unit 'ms', y-unit 'mW'. I need an exact rational arithmetic result and the integrity receipt so I can verify the computation later."}],"resultDescription":"Returns an exact rational arithmetic integration result (not a floating-point approximation), accompanied by declared x and y units, and an integrity receipt. Results are retained for 24-hour recovery; minimal receipt metadata is stored for 90 days. No quadrature error estimate or claim of an exact underlying analytical integral is provided.","failureModes":["fewer than 2 or more than 128 samples provided — rejected with validation error","non-integer values in ordinates array — rejected","spacing value exceeds maximum length or is unparseable — rejected","invalid or missing dataClass enum value — rejected","missing required unit label fields — rejected","payment not received or insufficient — 402 response"],"whenToPreferThis":"Choose this endpoint when you need a fast, exact rational-arithmetic trapezoidal integration of a small-to-medium discrete integer sample set (2–128 points) with unit labeling and a tamper-evident integrity receipt. Prefer it over general-purpose quadrature libraries when auditability, receipt-based verification, or exact rational results (rather than floating-point) are required. Not appropriate for continuous function integration, non-integer samples, large datasets over 128 points, or when a quadrature error bound is needed.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-15T06:38:52.985Z","isFirstParty":false,"canonicalSlug":"sampled-series-integration-via-composite-trapezoidal-rule-4c8d5a38"}