Mathematics · Simulator 042
Fill the area under a curve with rectangles or trapezoids. Change the number of strips, the bounds and the method, and compare each approximation with the exact integral. Watch how fast each method's error shrinks as the strips get thinner.
The definite integral ∫ₐᵇ f(x) dx is the signed area between the curve and the x-axis (area below the axis counts as negative). Splitting [a, b] into n strips of width Δx = (b − a)/n gives Riemann sums:
The exact value comes from an antiderivative, by the Fundamental Theorem of Calculus ∫ₐᵇ f dx = F(b) − F(a). The lower chart shows the error against n on log–log axes; the slope of each line is the order of the method.
Simpson's rule needs an even n; odd n is rounded up for that method.
Using the trapezoid rule with n = 4 on ∫₀¹ x² dx, is the estimate too big or too small? Why, without calculating?
Too big. x² curves upward (convex), so each straight trapezoid top lies above the curve. The trapezoid value is 0.34375, against an exact 1/3. The midpoint rule errs the other way for convex functions (0.328125).