Interactive visualiser

Riemann sums

Split [a,b][a, b] into nn strips of width Δx\Delta x and add up f(xi) Δxf(x_i)\,\Delta x. As nn grows, the sum closes in on ∫abf(x) dx\int_a^b f(x)\,dx, and a small graph shows how quickly.

Loading the visualiser…

Works on a phone, tablet or computer — nothing to install, no account.

What you are looking at

A Riemann sum approximates ∫abf(x) dx\int_a^b f(x)\,dx with rectangles. Each strip has width Δx=b−an\Delta x = \dfrac{b-a}{n} and a height f(xi)f(x_i) taken at its left edge, its right edge or its midpoint; with 40 strips or fewer, the sample points are marked on the curve. The working panel shows Δx\Delta x, the sum ∑i=1nf(xi) Δx\sum_{i=1}^{n} f(x_i)\,\Delta x and its value, and the exact integral from an antiderivative, [F(x)]ab\big[F(x)\big]_a^b, so the two numbers sit side by side.

The definite integral is the limit of these sums as n→∞n \to \infty. Press Increase nn and nn steps up towards 100 while the rectangles hug the curve more closely. The Difference section plots the size of the gap between the sum and the integral for every nn from 1 to 100, with a marker at the current nn. Rectangles below the xx-axis count as negative, so the sums approach the signed integral, not the area.

Try this

  1. 1Leave f(x)=x2f(x) = x^2 on [0,2][0, 2] and press Increase nn: the left sum climbs from about 2.042.04 at n=6n = 6 towards 83≈2.667\dfrac{8}{3} \approx 2.667.
  2. 2Switch between Left, Right and Midpoint at the same nn: for this increasing curve the left sum is too small, the right sum too big, and the midpoint sum far closer than either.
  3. 3Choose sin⁡x\sin x, where [0,π][0, \pi] gives an exact value of 2, then drag bb to 2π2\pi: the exact value drops to 0, because the part below the axis counts as negative.
  4. 4Press Hide formulas, decide whether right rectangles overestimate or underestimate the integral, then show the formulas again and check the Difference section.

Mistakes students make

  • Believing left sums always underestimate. That holds only when ff is increasing on [a,b][a, b]; where ff decreases the left sum is too big, and on a curve that rises and falls it can go either way.
  • Getting the sample points wrong. With Δx=b−an\Delta x = \dfrac{b-a}{n}, left sums use xi=a+(i−1)Δxx_i = a + (i-1)\Delta x and right sums xi=a+i Δxx_i = a + i\,\Delta x for i=1,…,ni = 1, \dots, n: nn heights, not n+1n + 1.
  • Treating a Riemann sum as an area. Rectangles below the xx-axis contribute negative amounts, so the sums approach the signed integral: for sin⁡x\sin x on [0,2π][0, 2\pi] that is 0, although the area is 4.

Where it is taught

  • IB Maths AA SL/HL 5.5 · 5.11
  • AP Calculus AB/BC Unit 6
  • Edexcel A-Level Pure Year 2 · Integration as the limit of a sum
  • Greek Lykeio year 3 (Γ΄ Λυκείου) · §3.4

Teaching this?

Put this visualiser on your lesson board with one tap. Your student sees every drag, live, on their own screen — and Owlileo marks the homework, runs the tests and keeps the parents informed.

Start free →