Patrick B. answered 12/08/20
Math and computer tutor/teacher
You did not say which tool to use, nor any specific instructions on how to implement
or write code for these numerical methods, so I used online calculators per google search...
the step size h = (3-1)/8 = 2/8 = 1/4 = 0.25
the partition is then {1,1.25, 1.5,1.75,2,2.25,2.5,2.75,3} which contain the endpoints
of each base-width for each of these 8 rectangles
For the midpoint rule,
the midpoints of each of these is _X_={9/8,11/8,13/8,15/8,17/8,19/8,21/8,23/8}
the function is then evaluated for each t in _X_ at each of these midpoints
the online calculator at emath help dot net does all of this for you....
the approximation is 1/4 [ f(9/8) + f(11/8) + f(13/8) + .... + f(21/8) + f(23/8) ]
= 10.65625 is the approximation via midpoint rule
Likewise, for the Trapezoial rule, the ORIGINAL partition is used for 8 trapezoids, not the midpoints.
the function values get DOUBLED per formula except at the endpoints f(1) and f(3)
that is 1/4 [ f(1) + 2* f(5/4) + 2*f(3/2) + .... + 2f(11/4) + f(3) ]
the Trapezoidal rule calculator at the same web-site gives an approximation of 10.6875
Just for the fun of it, Simpson's 3/8 rule gives an approximation of 10.056 at easy calculations dot com
and 10+2/3 = 32/3 at planet calc dot com; However, the latter allowed me to specify 8 rectangles
as prescribed, while the former did not. So I have no idea how it partitioned.
the EXACT answer , as you know, is [x^3/3+x], x=1...3
which as x->3 is 12 and as x->1 is 4/3. Subtracting
these limits gives an EXACT answer of 12-4/3 = 36/3-4/3 = 32/3
As customary, though your mileage may vary
depending on your machine epsilon, the relative error percentages are,
courtesy of the windows calculator
midpoint: Error( 32/3, 10.65625) = .09765625-%
trapezoidal: Error( 32/3, 10.6875) = -0.1953125-%
simpson's 3/8 (unknown partition) : Error(32/3,10.056) = 5.725- &
simpson's 3/8 (8 rectangles) : Error(32/3,32/3)=0
I pushed the 6s until the calculator griped at me......
Winner and STILL your champion: Simpson's 3/8