Riemann sums

See the area under a curve filled with strips. Pick left, right, midpoint or trapezium sums, slide the number of strips n and watch the sum close in on the exact integral, with the error. Then see why ∫ f dx has a + C, and shade the area between two curves with the crossing points found for you.

Keep it one tap away for everyday use.

Bookmark Riemann sums?

Press Ctrl + D now. Your browser opens its own bookmark box, where you choose the name and folder.

  1. Pick f(x)
  2. Strips n
  3. Sum
  4. Integral
Nothing is uploadedWorks offline once open

More strips, smaller error

nLeftRightMidTrap

Try this

  • With x² from 0 to 2, slide n from 1 to 100. The left sum creeps up and the right sum creeps down towards 8/3 ≈ 2.667.
  • Compare Midpoint and Trapezium: the midpoint error is about half the trapezium error, on the other side.
  • Take sin x from 0 to 6.283 (2π): the blue strips above the axis and the orange ones below cancel to 0.
  • In Antiderivative + C, move C: the curve slides up and down but the tangents at x stay parallel. That is why ∫ f dx has a + C.
  • In Area between curves, try f = 4 − x² and g = x: the curves cross at −2.56 and 1.56 and the area between them is about 11.68.

Check yourself

Fresh numbers every time. Type a number or a fraction such as 3/4; nothing is saved or sent.

    What it shows

    A definite integral is the area under a curve, counted as positive above the x-axis and negative below it. Nobody can measure a curved area directly, so we fill it with thin strips whose areas are easy, add them up, and see what the total settles on as the strips get thinner. That total is a Riemann sum, and the number it settles on is the integral.

    This page draws the strips for you, gives the sum and the exact integral side by side, and shows the error shrinking as you add strips. Two more views go with it: the antiderivative family (why every indefinite integral ends in + C) and the area between two curves.

    It follows the school topics of integrals and the application of integrals in Class 12 maths. Before it, the derivative slope page shows what a derivative is (integration undoes it); for any curve you like, the graphing calculator draws it, and symbolic algebra finds antiderivatives with working.

    How to use it

    1. Riemann sums. Pick a function, type the start a and end b, then choose Left, Right, Midpoint or Trapezium and slide the number of strips n (1 to 100). Blue strips sit above the axis, orange strips below it (they count as negative).
    2. Antiderivative + C. Pick a function. The page draws a whole family of antiderivatives F(x) + C in grey and one of them in blue. Slide C to move it up or down, and slide x to see the tangents there: every curve in the family has the same slope, f(x).
    3. Area between curves. Type two curves f and g. With the box ticked, the page finds where they cross and uses the first and last crossing as a and b; untick it to type your own. The area is split into pieces wherever the curves cross, so it always counts as positive.

    What each number means

    • Δx = (b − a) / n is the width of every strip.
    • Left / right sum: each strip is as tall as the curve at its left or right edge.
    • Midpoint sum: each strip is as tall as the curve at its middle.
    • Trapezium sum: each strip is a trapezium joining the curve at both edges.
    • ∫ from a to b: the exact value from the antiderivative, F(b) − F(a), for the ready-made functions; for a function you type, Simpson’s rule with 4000 strips, which is accurate to many decimal places for smooth curves.
    • Error is the sum minus the integral. The table shows the sums for n = 4, 8, 16, 32, 64 and 128: doubling n roughly halves the left and right errors and quarters the midpoint and trapezium errors.

    Worked example

    Take f(x) = x² from 0 to 2 with n = 4, so Δx = 0.5. The left ends are 0, 0.5, 1 and 1.5, so the left sum is 0.5 × (0 + 0.25 + 1 + 2.25) = 1.75. The right sum is 0.5 × (0.25 + 1 + 2.25 + 4) = 3.75, the midpoint sum 2.625 and the trapezium sum 2.75. The exact integral is [x³/3] from 0 to 2 = 8/3 ≈ 2.6667. With n = 100 the left sum is 2.6268 and the right sum 2.7068, closing in from both sides.

    For the area between y = 4 − x² and y = x, the curves cross at x ≈ −2.5616 and x ≈ 1.5616, and the area between them is about 11.682.

    Check yourself

    Five questions with fresh numbers: a small left sum to do by hand, two definite integrals, an area between a parabola and a line, and which sum is exact for a straight line. Type an answer (3/4 or 8/3 is fine) and press Check; open the working to see each step. Nothing is saved.

    FAQ

    Why is my integral negative? The part of the curve below the x-axis counts as negative area. The “area between curves” view always counts area as positive.

    Why does sin x from 0 to 2π give 0? The hump above the axis and the dip below it are the same size, so they cancel.

    Is this from my textbook? It covers the standard topics that school maths teaches everywhere, with its own examples and pictures. It is an independent study aid.

    Where the numbers come from

    • Standard calculus: Riemann sums, the trapezium rule, Simpson's rule, the fundamental theorem of calculus and the area between two curves. Written for fibub; no textbook text, figures or exercises are used.
    • Checked against NumPy (sums on linspace grids and numpy.trapezoid) and SciPy (integrate.quad for integrals and areas, optimize.brentq for crossing points).

    Standard scientific values, such as constants, atomic weights and melting points, are facts found in every textbook; we name where ours were checked. If you are an author or publisher and want a value, a credit or a table changed or removed, tell us and we will act quickly.

    Last updated 2026-11-09.

    Change log for Riemann sums

    1. Add #1182 Riemann sums to integral Details on GitHub

    Every change to fibub

    Related tools

    Graphing calculator #T369 Plot y = f(x), any equation in x and y, polar r(θ) and parametric (x(t), y(t)) curves together, with sliders, zoom, tap-to-trace, roots, turning points and crossings, plus 3D surfaces z = f(x, y). Download PNG, SVG or CSV. Runs in your browser. Symbolic algebra #T370 Type an expression and simplify, expand or factor it, differentiate it, integrate it (with definite integrals), or substitute values. Exact fractions, answers you can copy as SymPy or LaTeX, and an honest 'could not integrate' when it is out of reach. Checked against sympy. Numerical methods teacher #T378 See numerical methods work step by step: root finding by bisection, false position, Newton and secant with iteration tables; integration by the trapezoid, Simpson, Gauss-Legendre and Romberg rules with error plots; and Lagrange, Newton divided-difference and cubic spline interpolation. Checked against scipy. Derivative slope #L84 Drag two points on a curve and shrink the gap h: the secant line turns into the tangent and its slope settles on f′(x). See the slope graph f′(x) drawn under f(x), a table of slopes from both sides, first-principles working for xⁿ and sin x, corners where there is no derivative, and fresh practice questions. Unit circle #L86 Drag a point round the unit circle and watch sin, cos and tan drawn as waves. Angles in degrees and radians, exact values at 30°, 45° and 60°, the ASTC quadrant signs, sliders for y = a sin(bx + c) + d, and the inverse trig functions as the mirror image of the principal branch. Maxima and minima #L87 See a function, its slope f′ and its bending f″ stacked one above the other, with every turning point found and tested by the first and second derivative tests, the absolute maximum and minimum on an interval, and three optimisation stories (open box, fence by a river, closed can) with the working. Limit zoom #L88 Zoom in on a function near a point and watch where it heads from the left and from the right, with tables of values closing in, the sector picture behind sin x / x → 1, and a Class 12 view that sorts each point as continuous, a hole, a jump, an infinite break or an endless wobble. Variable force work #L196 Shape a force-displacement graph with your finger, or start from a steady force, a spring or a fading push, pick where the motion starts and stops, and see the work as the shaded area, with the parts above and below the axis, the formula with your numbers, and the speed it gives a cart. Definite integral properties #L307 See each property of definite integrals as a picture with the numbers worked out: swapping the limits flips the sign, splitting at any c adds up, f(a + b − x) is the same area flipped, ∫₀²ᵏ in two halves, even functions double and odd functions cancel, and the area function A(x) whose slope is f(x). Integration technique coach #L308 Type a school integral and the coach says which method fits and why: power rule, standard form, substitution, integration by parts with ILATE, partial fractions, or parts twice for eˣ sin x. Then it writes the steps, checks the answer by differentiating it back, and draws f with its antiderivative. Slope field #L309 See dy/dx = f(x, y) as a field of little slopes and tap anywhere to draw the solution through that point. Growth and decay, Newton's cooling and a mixing tank as stories, plus linear and separable examples with the hand working (separating variables or the integrating factor) and the particular solution for your point.