Math With AmarA C A D E M Y
All math animations

University · Integration

Build an integral with rectangles

Refine a right-endpoint sum and measure its error against an exact integral.

Predict what will happen, press Play, then pause and explain what changed. Every control also works without playback.

Watch the relationship

Paused
Build an integral with rectangles. Rectangles n: 1. Right-endpoint sum: 8. Exact integral: 2.667. Overestimate: 5.333f(x) = x² · n = 1 right rectangles01230510xWidth = b/n = 2 · b = 2
The function is x² and b is positive. Only equal-width right-endpoint sums are shown. The fixed graph uses x from 0 to 3.3 and y from 0 to 10; area values are mathematical square units. Rectangle count changes in whole steps.

Starts paused. Play once, pause anywhere, or use Step to inspect the mathematics. Playback stops when this panel leaves the screen.

Make it your experiment

Change one value. Notice what follows.

The controls adjust the model. Numbers below describe the current frame. Decimals are rounded.

Rectangles n
1
Right-endpoint sum
8
Exact integral
2.667
Overestimate
5.333

HD animation studio

From experiment to screen.

Present a crisp Canvas scene, save a full-HD image, or capture your model as a silent video.

Understand what you are seeing

The idea behind the motion.

Accumulation can be approximated by adding narrow rectangular strips. For the increasing function f(x) = x² on [0, b], right-endpoint rectangles lie above the curve and overestimate the integral. More equal-width rectangles reduce this error, while every finite displayed sum is still an approximation.

A relationship to keep

Rₙ = Σ (ib/n)²(b/n); ∫₀ᵇ x² dx = b³/3

Read the symbols alongside the explanation. A diagram shows the relationship; the assumptions tell you when it applies.

  1. STEP 1

    Divide the interval

    The interval [0, b] is divided into n equal pieces, each with width b/n. Playback starts with one rectangle and increases to your selected final count.

  2. STEP 2

    Sample the right edge

    Each amber rectangle takes its height from the curve at the right endpoint of its piece. Since x² increases on this interval, the top-right corner touches the curve and the rectangle covers excess area.

  3. STEP 3

    Measure the approximation error

    Compare the sum with the exact value b³/3 beneath the animation. Increasing n decreases the excess area. The limit as n tends to infinity is the integral, not any one finite frame.

Your turn to explain

Make a prediction. Test your reasoning.

For b = 2 and n = 2, find the right-endpoint sum and the exact integral.

Use the values specified in the question. Reset restores the initial values for this investigation.

Compare your explanation

The width is 1 and the heights are 1² and 2², so R₂ = 5. The exact integral is 8/3, leaving an overestimate of 7/3.

Connect the animation to a worked example and practice questions.