Midpoint Rule Calculator for a Function

An online calculator for approximating a definite integral using the midpoint (mid-ordinate) 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_{1}^{3} \sqrt{\sin^{4}{\left(x \right)} + 7}\, dx$$$ with $$$n = 4$$$ using the midpoint rule.

Solution

The midpoint rule (also known as the midpoint approximation) uses the midpoints of a subinterval:

$$$\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 $$$a = 1$$$, $$$b = 3$$$, $$$n = 4$$$.

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

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

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

$$$f{\left(\frac{x_{0} + x_{1}}{2} \right)} = f{\left(\frac{1 + \frac{3}{2}}{2} \right)} = f{\left(\frac{5}{4} \right)} = \sqrt{\sin^{4}{\left(\frac{5}{4} \right)} + 7}\approx 2.79482192294185$$$

$$$f{\left(\frac{x_{1} + x_{2}}{2} \right)} = f{\left(\frac{\frac{3}{2} + 2}{2} \right)} = f{\left(\frac{7}{4} \right)} = \sqrt{\sin^{4}{\left(\frac{7}{4} \right)} + 7}\approx 2.81735090562718$$$

$$$f{\left(\frac{x_{2} + x_{3}}{2} \right)} = f{\left(\frac{2 + \frac{5}{2}}{2} \right)} = f{\left(\frac{9}{4} \right)} = \sqrt{\sin^{4}{\left(\frac{9}{4} \right)} + 7}\approx 2.71413091375118$$$

$$$f{\left(\frac{x_{3} + x_{4}}{2} \right)} = f{\left(\frac{\frac{5}{2} + 3}{2} \right)} = f{\left(\frac{11}{4} \right)} = \sqrt{\sin^{4}{\left(\frac{11}{4} \right)} + 7}\approx 2.64975816351283$$$

Finally, just sum up the above values and multiply by $$$\Delta x = \frac{1}{2}$$$: $$$\frac{1}{2} \left(2.79482192294185 + 2.81735090562718 + 2.71413091375118 + 2.64975816351283\right) = 5.48803095291652.$$$

Answer

$$$\int\limits_{1}^{3} \sqrt{\sin^{4}{\left(x \right)} + 7}\, dx\approx 5.48803095291652$$$A