Definite Integrals

High schoolMathematicsSigned definite integrals and uniform Riemann sums with analytic reference values

Unlock this lab with a pass

A pass opens every simulation on the site, including Present mode for class. The teaching notes below stay free for everyone.

One-time payment, no subscription.

About this experiment

Approximate a definite integral with rectangles and compare the sum against an exact antiderivative. Choose left, midpoint or right sampling, change the bounds, and increase the number of rectangles. Regions below the horizontal axis contribute negatively when bounds run from left to right. Reversing the bounds reverses the integral sign.

Learning goals

  • Construct a uniform Riemann sum with different sample positions
  • Compare numerical approximation error with an analytic integral
  • Distinguish signed accumulation from total geometric area

How to use it

  1. 1For x squared on [0, 2], compare left, midpoint and right sums with 8 rectangles.
  2. 2Double the rectangle count several times and record the absolute error.
  3. 3Choose y = x and bounds −2 and 2. Explain the cancellation of signed contributions.
  4. 4Swap the bounds and check the signs of both the exact integral and the Riemann sum. Set equal bounds and check the result.

The model

Uniform sum: c is 0 for left, 1/2 for midpoint and 1 for right sampling
Fundamental theorem of calculus, with F an antiderivative
Reversing the bound order reverses the sign

Assumptions

  • The selected functions are continuous. Exact reference values use their analytic antiderivatives.
  • All rectangles have equal signed width. Left and right refer to the start and end of each oriented subinterval, so their visual roles reverse when b is less than a.
  • The pale fill shows the geometric region, while the readouts include function sign and bound order. Sine uses radians.

Try this in class

  1. Q1Why does left sampling underestimate the integral of x squared on [0, 2]?
  2. Q2Can a nonzero shaded region have a zero definite integral? Give an example.
  3. Q3Does doubling the number of rectangles always halve the error? Compare midpoint and endpoint sampling.

Frequently asked questions

Why can the integral be negative?

For increasing bounds, values below the axis contribute negatively. Reversing the bounds changes the sign of every contribution. A definite integral measures signed accumulation, not necessarily geometric area.

Why does the midpoint sum for y = x have zero error?

A linear function has the same average value on each subinterval as its midpoint value. Midpoint rectangles therefore integrate a straight line exactly, apart from floating-point rounding.