The midpoint rule basically estimates the area under a
curve by sampling it a n-1 points, and using the rectangle with height f(Xn) and width
(b-a)/n at each point to give the area under that portion of the
curve.
So,
f(x) = 3x^3 e^-2x ,
x = [1,5]
dx = 5-1 / 4 =
1
The first point is the midpoint between a and a + dx : a
+ dx/2, or 1.5. Each point after that is spaced at dx =
1.
f(1.5) = 0.68
f(2.5)
= 5.29
f(3.5) = 20.3
f(4.5)
= 55.5
So,
Int( f(x) ) , x =
[1,5] ~~ dx*(0.68 + 5.29 + 20.3 + 55.5) =
81.77
You can compare this with the exact
answer,
3124/(5 e^2) ~~ 84.5575
No comments:
Post a Comment