Use the Midpoint Rule to approximate the integral (–10x+7x^2) from 10 to 17 with n=3

Hint:

Integration of f(x) by the mid-point rule for the interval [a,b].
1. subdivide [a,b] into n sub-intervals, each of length h=(b-a)/n.
2. Evaluate the value qi of the function f(x) at the mid-point of each sub-interval i, where i=1,n. That is,
qi = f(a+(i-1/2)h).
3. Calculate the sum:
h∑qi for i=1 to n.

Example:
If f(x)=x²
We would like to approximate
I=∫f(x)dx for x= [20,28] with n=4.
h=(28-20)/4=2
q1=f(20+h/2)=f(21)=441
q2=f(20+3h/2)=f(23)=529
q3=f(20+5h/2)=f(25)=625
q4=f(20+7h/2)=f(27)=729
I=(441+529+625+729)*2=4648 (approx.)

Check by exact calculations:
∫x²dx
= (28³-20³)/3
= 13952/3
= 4650.7 (approx.)
So the answer by the mid-point rule is quite close to the analytic value.