Midpoint Rule Calculator for a Function

Approximate an integral (given by a function) using the midpoint rule step by step

An online calculator for approximating the 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 contact us.

Your Input

Approximate the integral 13sin4(x)+7dx\int\limits_{1}^{3} \sqrt{\sin^{4}{\left(x \right)} + 7}\, dx with n=4n = 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:

abf(x)dxΔx(f(x0+x12)+f(x1+x22)+f(x2+x32)++f(xn2+xn12)+f(xn1+xn2))\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 Δx=ban\Delta x = \frac{b - a}{n}.

We have that f(x)=sin4(x)+7f{\left(x \right)} = \sqrt{\sin^{4}{\left(x \right)} + 7}, a=1a = 1, b=3b = 3, and n=4n = 4.

Therefore, Δx=314=12\Delta x = \frac{3 - 1}{4} = \frac{1}{2}.

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

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

f(x0+x12)=f(1+322)=f(54)=sin4(54)+72.794821922941848f{\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.794821922941848

f(x1+x22)=f(32+22)=f(74)=sin4(74)+72.817350905627184f{\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.817350905627184

f(x2+x32)=f(2+522)=f(94)=sin4(94)+72.714130913751178f{\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.714130913751178

f(x3+x42)=f(52+32)=f(114)=sin4(114)+72.649758163512828f{\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.649758163512828

Finally, just sum up the above values and multiply by Δx=12\Delta x = \frac{1}{2}: 12(2.794821922941848+2.817350905627184+2.714130913751178+2.649758163512828)=5.488030952916519.\frac{1}{2} \left(2.794821922941848 + 2.817350905627184 + 2.714130913751178 + 2.649758163512828\right) = 5.488030952916519.

Answer

13sin4(x)+7dx5.488030952916519\int\limits_{1}^{3} \sqrt{\sin^{4}{\left(x \right)} + 7}\, dx\approx 5.488030952916519A