Midpoint Rule Calculator

Approximate a definite integral using the midpoint rule — enter your function, bounds, and number of subintervals to get the sum table and result.

Parameters

Supports: +, -, *, /, ^, sin, cos, tan, exp, ln, sqrt, abs

1 – 1000. Table shows first 200 rows.

Function reference

x^2    x*sin(x) sqrt(x) sin(x) cos(x) tan(x) exp(x)   e^x ln(x) log(x) abs(x) 1/(1+x^2)

Enter a function and click Calculate to see the approximation.

Copied!

Summary

Approximate a definite integral using the midpoint rule — enter your function, bounds, and number of subintervals to get the sum table and result.

How it works

  1. Enter the function f(x) using standard math notation (e.g. x^2, sin(x), e^x).
  2. Set the lower bound a and upper bound b for the integration interval.
  3. Choose the number of subintervals n (more subintervals = better accuracy).
  4. Click Calculate — the tool divides [a, b] into n equal subintervals.
  5. For each subinterval, it evaluates f at the midpoint x_i = a + (i - 0.5) * h.
  6. The result is h * sum of all f(x_i) values, shown in a detailed table.

Use cases

  • Verify calculus homework on definite integrals.
  • Estimate areas under curves when antiderivatives are hard to find.
  • Compare midpoint rule accuracy against trapezoidal and Simpson methods.
  • Demonstrate numerical integration concepts in class.
  • Quickly check integration approximations before writing full code.
  • Explore how increasing n improves approximation accuracy.

Frequently Asked Questions

Last updated: 2026-06-13 · Reviewed by Nham Vu