SimuVeda/ Mathematics

Mathematics · Simulator 042

Integral Explorer

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

Experiments 0 of 0 Challenge not tried

How the model works

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:

  • Left / right: rectangle height from the left or right edge of each strip. Error ∝ 1/n.
  • Midpoint: height at the strip centre. Error ∝ 1/n².
  • Trapezoid: straight line across each strip. Error ∝ 1/n², about twice the midpoint error with opposite sign.
  • Simpson: parabolas through pairs of strips. Error ∝ 1/n⁴.

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.

Guided experiments

  1. x² from 0 to 1. Left sum with n = 4. Prediction: the left sum 0.21875 is too small for an increasing function; the exact area is 1/3.
  2. Double the strips. Watch the error chart while n doubles. Prediction: left/right errors halve each doubling; midpoint and trapezoid errors quarter; Simpson's drops 16×.
  3. Signed area. sin x from 0 to 2π. Prediction: the exact integral is 0. The positive and negative lobes cancel.

Challenge

Using the trapezoid rule with n = 4 on ∫₀¹ x² dx, is the estimate too big or too small? Why, without calculating?

Reveal the explanation

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).

References

  • OpenStax, Calculus Volume 1, §5.1 “Approximating Areas” and §3.6 of Volume 2, “Numerical Integration”.

Related simulators

Worked example

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.

Common questions

What does a definite integral mean?

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.

What is a Riemann sum?

An approximation of the integral by adding up the areas of thin rectangles. As the strips get thinner, the sum approaches the exact integral.

Which numerical integration method is most accurate?

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.

Keyboard shortcuts

Space
Play or pause
S
Step
R
Reset
F
Full screen
?
Show this list