Riemann Sum Convergence: Watching n → ∞

April 12, 2026

Problem

Show how the area approximation under y = x² from 0 to 4 converges as n increases from 4 to 100.

Explanation

The whole point of the integral is to take the limit of Riemann sums as the number of rectangles goes to infinity. This visualization makes the limit feel real: as you crank up nn, the rectangles fill in the curve perfectly and the approximation converges to the exact value 64/364/3.

The Limit Definition

∫abf(x) dx=lim⁡n→∞∑i=1nf(xi∗) Δx\int_{a}^{b} f(x)\,dx = \lim_{n \to \infty} \sum_{i=1}^{n} f(x_i^{*})\,\Delta x

where Δx=(b−a)/n\Delta x = (b - a)/n and xi∗x_i^{*} is any sample point in the ii-th subinterval. As n→∞n \to \infty the partition becomes so fine that the sum converges to a single number — the definite integral.

Step-by-Step Solution

Given: f(x)=x2f(x) = x^{2}, a=0a = 0, b=4b = 4. Find: how the right-endpoint Riemann sum behaves as nn grows, and confirm the limit.


Step 1 — Use the closed-form for the right Riemann sum.

For the partition xi=i⋅4nx_i = i \cdot \dfrac{4}{n}, the right Riemann sum is:

Rn=∑i=1n(4in)2⋅4n=64n3∑i=1ni2R_n = \sum_{i=1}^{n} \left(\dfrac{4i}{n}\right)^{2} \cdot \dfrac{4}{n} = \dfrac{64}{n^{3}}\sum_{i=1}^{n} i^{2}

Step 2 — Apply the famous formula ∑i=1ni2=n(n+1)(2n+1)6\sum_{i=1}^{n} i^{2} = \dfrac{n(n + 1)(2n + 1)}{6}.

Rn=64n3⋅n(n+1)(2n+1)6=64 (n+1)(2n+1)6n2R_n = \dfrac{64}{n^{3}} \cdot \dfrac{n(n + 1)(2n + 1)}{6} = \dfrac{64\,(n + 1)(2n + 1)}{6 n^{2}}

Step 3 — Tabulate RnR_n for several nn.

  • n=4n = 4: R4=64⋅5⋅96⋅16=288096=30.000R_4 = \dfrac{64 \cdot 5 \cdot 9}{6 \cdot 16} = \dfrac{2880}{96} = 30.000
  • n=8n = 8: R8=64⋅9⋅176⋅64=9792384=25.500R_8 = \dfrac{64 \cdot 9 \cdot 17}{6 \cdot 64} = \dfrac{9792}{384} = 25.500
  • n=16n = 16: R16=64⋅17⋅336⋅256≈23.375R_{16} = \dfrac{64 \cdot 17 \cdot 33}{6 \cdot 256} \approx 23.375
  • n=32n = 32: R32≈22.344R_{32} \approx 22.344
  • n=100n = 100: R100≈21.547R_{100} \approx 21.547
  • n=1000n = 1000: R1000≈21.355R_{1000} \approx 21.355
  • n=10000n = 10000: R10000≈21.336R_{10000} \approx 21.336

The sums are converging to 64/3≈21.33364/3 \approx 21.333.

Step 4 — Take the formal limit.

lim⁡n→∞Rn=lim⁡n→∞64 (n+1)(2n+1)6n2=64⋅26=1286=643\lim_{n \to \infty} R_n = \lim_{n \to \infty} \dfrac{64\,(n + 1)(2n + 1)}{6 n^{2}} = \dfrac{64 \cdot 2}{6} = \dfrac{128}{6} = \dfrac{64}{3}

(In the limit, (n+1)/n→1(n + 1)/n \to 1 and (2n+1)/n→2(2n + 1)/n \to 2, so the whole expression goes to 64⋅1⋅2/6=64/364 \cdot 1 \cdot 2 / 6 = 64/3.)

Step 5 — Verify using the antiderivative.

By the Fundamental Theorem of Calculus:

∫04x2 dx=x33∣04=643−0=643≈21.333\int_{0}^{4} x^{2}\,dx = \dfrac{x^{3}}{3}\bigg|_{0}^{4} = \dfrac{64}{3} - 0 = \dfrac{64}{3} \approx 21.333

Both methods agree. ✓


Answer: The Riemann sums for ∫04x2 dx\int_{0}^{4} x^{2}\,dx converge to 643≈21.333\dfrac{64}{3} \approx 21.333. The convergence rate for the right-endpoint sum is O(1/n)O(1/n) — error halves when you double nn. The midpoint sum converges at O(1/n2)O(1/n^{2}) — much faster.

Try It

  • Slide n from 4 up to 100 — watch the error counter in the HUD shrink as the rectangles fill the area more snugly.
  • The bottom plot tracks the approximation against nn — it homes in on the green dashed line at 64/364/3 as nn grows.
  • At n=100n = 100, the sum is within ~1% of the exact value. At n=1000n = 1000 it'd be within 0.1%.

Interactive Visualization

Parameters

16.00
right
Your turn

Got your own math or physics problem?

Turn any problem into an interactive visualization like this one — powered by AI, generated in seconds. Free to try, no credit card required.

Sign Up Free to Try It30 free visualizations every day
Riemann Sum Convergence: Watching n → ∞ | MathSpin