This demo compares two approaches to computing a definite integral — the area trapped between a function and the x-axis over an interval.
On the left, a SymbolicMathGate uses pattern-matching to rewrite the integral into its antiderivative. One transform, exact answer, zero error.
On the right, a NumericalGate approximates the same area by slicing it into rectangles. The fewer the slices, the worse the fit.
Key Interaction
Drag the Rectangles (n) slider from 2 to 128 and watch the numerical approximation converge toward the exact symbolic answer. At low n the rectangles are chunky and the error is huge; at high n they hug the curve and the error nearly vanishes. This is the core insight — the symbolic gate knows the answer instantly; the numerical gate has to earn it rectangle by rectangle.
1Pick a function — x², x³, sin(x), or eˣ
2Choose a numerical method — left, right, midpoint, trapezoidal, or Simpson's
3Drag the slider and compare the results side by side
SISO — Area Under a Curve
Symbolic gate vs. Numerical gate — same event, two transforms