Midpoint Rule Calculator

Type a function, an interval and a number of rectangles to use the midpoint rule.

Use x. Type powers with ^, and functions with brackets: sin(x), e^(2x), ln(x), sqrt(x).

A number such as 0 or 1/2, pi, e, inf or -inf.

A number larger than the lower limit, pi, e, inf or -inf.

A whole number of equal intervals, 1 or more.

Try

Result

You entered∫02x2 dx≈M4\int_{0}^{2} x^{2}\,dx \approx M_{4}

S≈2.625\displaystyle S \approx 2.625

Exact integral

83≈2.666667\displaystyle \frac{8}{3} \approx 2.666667
Show the work
  1. Midpoint Riemann sum

    Cut [0,2][0, 2] into 4 equal intervals and add up the areas of 4 rectangles; each rectangle is as tall as the curve at the middle of its interval.

    Using Δx=b−an\Delta x = \frac{b - a}{n}

    Sn=Δx∑f(xi)xi=a+(i+12)Δx, i=0,…,n−1\begin{gathered} S_n = \Delta x \sum f(x_i) \\ x_i = a + \left(i + \tfrac{1}{2}\right)\Delta x,\ i = 0, \ldots, n-1 \end{gathered}
  2. Width of each interval

    Divide the length of the interval by the number of rectangles.

    Δx=2−04=0.5\begin{aligned} \Delta x &= \frac{2 - 0}{4} \\ &= 0.5 \end{aligned}
  3. Heights

    Evaluate ff at each of the 4 points.

    xi: 0.25, 0.75, 1.25, 1.75f(xi): 0.0625, 0.5625, 1.5625, 3.0625\begin{gathered} x_i:\ 0.25,\ 0.75,\ 1.25,\ 1.75 \\ f(x_i):\ 0.0625,\ 0.5625,\ 1.5625,\ 3.0625 \end{gathered}
  4. Add up

    Multiply the sum of the heights by the width.

    S=0.5(0.0625+0.5625+1.5625+3.0625)=2.625\begin{aligned} S &= 0.5\left(0.0625 + 0.5625 + 1.5625 + 3.0625\right) \\ &= 2.625 \end{aligned}
  5. Result

    The midpoint Riemann sum with 4 intervals.

    S≈2.625S \approx 2.625
02
Midpoint Riemann sum of y = x^2 with 4 rectangles

Worked examples