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)
Result
h (width)
n
Sum f(x_i)
Approximation
Subinterval Table
| i | Subinterval [a_i, b_i] | Midpoint x_i | f(x_i) |
|---|
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
- Enter the function f(x) using standard math notation (e.g. x^2, sin(x), e^x).
- Set the lower bound a and upper bound b for the integration interval.
- Choose the number of subintervals n (more subintervals = better accuracy).
- Click Calculate — the tool divides [a, b] into n equal subintervals.
- For each subinterval, it evaluates f at the midpoint x_i = a + (i - 0.5) * h.
- 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