Approximate $$$\int\limits_{0}^{4} x^{2}\, dx$$$ with $$$n = 4$$$ using the midpoint rule

The calculator will approximate the integral of $$$x^{2}$$$ from $$$0$$$ to $$$4$$$ with $$$n = 4$$$ subintervals using the midpoint rule, with steps shown.

Related calculator: Midpoint Rule Calculator for a Table

If the calculator did not compute something or you have identified an error, or you have a suggestion/feedback, please write it in the comments below.

Your Input

Approximate the integral $$$\int\limits_{0}^{4} x^{2}\, dx$$$ with $$$n = 4$$$ using the midpoint rule.

Solution

The midpoint rule (also known as the midpoint approximation) uses the midpoint of a subinterval for computing the height of the approximating rectangle:

$$$\int\limits_{a}^{b} f{\left(x \right)}\, dx\approx \Delta x \left(f{\left(\frac{x_{0} + x_{1}}{2} \right)} + f{\left(\frac{x_{1} + x_{2}}{2} \right)} + f{\left(\frac{x_{2} + x_{3}}{2} \right)}+\dots+f{\left(\frac{x_{n-2} + x_{n-1}}{2} \right)} + f{\left(\frac{x_{n-1} + x_{n}}{2} \right)}\right)$$$

where $$$\Delta x = \frac{b - a}{n}$$$.

We have that $$$f{\left(x \right)} = x^{2}$$$, $$$a = 0$$$, $$$b = 4$$$, and $$$n = 4$$$.

Therefore, $$$\Delta x = \frac{4 - 0}{4} = 1$$$.

Divide the interval $$$\left[0, 4\right]$$$ into $$$n = 4$$$ subintervals of the length $$$\Delta x = 1$$$ with the following endpoints: $$$a = 0$$$, $$$1$$$, $$$2$$$, $$$3$$$, $$$4 = b$$$.

Now, just evaluate the function at the midpoints of the subintervals.

$$$f{\left(\frac{x_{0} + x_{1}}{2} \right)} = f{\left(\frac{0 + 1}{2} \right)} = f{\left(\frac{1}{2} \right)} = \frac{1}{4} = 0.25$$$

$$$f{\left(\frac{x_{1} + x_{2}}{2} \right)} = f{\left(\frac{1 + 2}{2} \right)} = f{\left(\frac{3}{2} \right)} = \frac{9}{4} = 2.25$$$

$$$f{\left(\frac{x_{2} + x_{3}}{2} \right)} = f{\left(\frac{2 + 3}{2} \right)} = f{\left(\frac{5}{2} \right)} = \frac{25}{4} = 6.25$$$

$$$f{\left(\frac{x_{3} + x_{4}}{2} \right)} = f{\left(\frac{3 + 4}{2} \right)} = f{\left(\frac{7}{2} \right)} = \frac{49}{4} = 12.25$$$

Finally, just sum up the above values and multiply by $$$\Delta x = 1$$$: $$$1 \left(0.25 + 2.25 + 6.25 + 12.25\right) = 21$$$.

Answer

$$$\int\limits_{0}^{4} x^{2}\, dx\approx 21$$$A