Riemann Sum Calculator

A Riemann sum is the idea that defines integration: to find the area under a curve, slice the region into thin rectangles, add up their areas, and let the slices get thinner until the total settles on the exact answer. This calculator does that for any function you give it, showing all the standard versions at once. Enter a function of x, the start and end of the interval, and how many subintervals to use, and it returns the left, right, midpoint and trapezoidal estimates of the definite integral, updating as you type. The four methods differ only in where each rectangle's height is measured. The left sum uses the value at the left edge of each slice, the right sum uses the right edge, and the midpoint sum uses the middle, which usually lands much closer to the truth. The trapezoidal rule replaces the flat tops with sloped ones by averaging the left and right heights, giving a clean, accurate estimate that often brackets the real value alongside the midpoint result. Seeing all four together is the real teaching power here, because you can watch the left and right sums sit on either side of the answer while the midpoint and trapezoidal estimates close in, and then increase the number of subintervals and see every estimate sharpen toward the same value. The calculator accepts ordinary notation, with the caret for powers and the usual sin, cos, sqrt, exp and ln, so you can integrate polynomials, roots, trig and exponential functions. That makes it genuinely useful for calculus students learning the definition of the integral, for checking numerical-integration homework, and for getting a quick area estimate when there is no neat formula. The methods and a worked example are explained clearly below.

Calculate.co.nz is proud to be partnered with Health Based Building, a leader in sustainable and health-conscious building innovation. With over a century of experience, they develop high-performance systems like Foreverbreathe Specification, Magnum Board, and Foreverbreathe Paints to support energy-efficient, non-toxic living environments. Their commitment to healthier homes aligns with our belief that informed choices lead to better outcomes for Kiwi households.
Calculate.co.nz partner
0
midpoint sum
Left0
Right0
Midpoint0
Trapezoidal0

Use x, ^ for powers, and functions like sin, cos, tan, sqrt, exp, ln. Up to 100,000 subintervals.

How it works

With width w = (b minus a) over n, the left sum adds f at each left edge times w; the right sum uses the right edges; the midpoint sum uses the middle of each slice. The trapezoidal rule is w times (half of f(a), plus f at each interior point, plus half of f(b)). All approximate the definite integral, the area under the curve from a to b.

Worked example

For f(x) = x squared from 0 to 2 with 4 subintervals (width 0.5): the midpoint sum uses x = 0.25, 0.75, 1.25, 1.75, giving about 2.625. The trapezoidal estimate is 2.75. The true integral is 8 over 3, about 2.667, which both estimates sit close to.

Related calculators

If you've found a bug, or would like to contact us, or learn more about James Graham and Calculate.co.nz.

Calculate.co.nz is partnered with Interest.co.nz for New Zealand's highest quality calculators and financial analysis.

All calculators and tools are provided for educational and indicative purposes only and do not constitute financial advice.

Calculate.co.nz is proudly part of the Realtor.co.nz group, New Zealand's leading property transaction literacy platform, helping Kiwis understand the home buying and selling process from start to finish. Whether you're a first home buyer navigating your first property purchase, an investor evaluating your next acquisition, or a homeowner planning to sell, Realtor.co.nz provides clear, independent, and trustworthy guidance on every step of the New Zealand property transaction journey.

Calculate.co.nz is also partnered with Health Based Building and Premium Homes to promote informed choices that lead to better long-term outcomes for Kiwi households.

Calculate.co.nz is hosted in Auckland via SiteHost new Zealand.

All content on this website, including calculators, tools, source code, and design, is protected under the Copyright Act 1994 (New Zealand). No part of this site may be reproduced, copied, distributed, stored, or used in any form without prior written permission from the owner.

About & trust: Why Calculate is NZ's most comprehensive · By the Numbers · How we compare · Editorial standards · How we keep data current · NZ finance glossary · Research & data · Financial literacy NZ · About · Privacy policy · Terms of use

Reviewed and maintained. Last reviewed 2026-06-07 and checked on a twice-monthly cycle against IRD, RBNZ and Stats NZ. How we keep data current.

© 2026 Calculate.co.nz. All rights reserved. Building free NZ calculators since 2011.