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.
Class 11–12Class 12 Maths: Integrals; Application of Integrals
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).
Area under f(x) = x² from 0 to 2, exact value 2³/3 = 8/3 ≈ 2.667, with n = 4 strips of width 0.5.
Left sum: 0.5 × (0 + 0.25 + 1 + 2.25) = 1.75, too small because the curve rises. Right sum: 0.5 × (0.25 + 1 + 2.25 + 4) = 3.75, too large.
Midpoint: heights at 0.25, 0.75, 1.25, 1.75: 0.5 × (0.0625 + 0.5625 + 1.5625 + 3.0625) = 2.625, error −0.042.
Trapezoid: the average of left and right, 2.75, error +0.083, twice the midpoint error with the opposite sign.
Simpson: exactly 8/3, because it is exact for any cubic or simpler polynomial. Set a = 0, b = 2 and n = 4 and switch between the methods.
The signed area between the curve and the x-axis from a to b. Area above the axis counts as positive and area below as negative.
An approximation of the integral by adding up the areas of thin rectangles. As the strips get thinner, the sum approaches the exact integral.
For smooth functions, Simpson's rule: doubling the strips cuts its error by 16. The midpoint and trapezoid rules cut it by 4, and left and right sums only by 2.