Here's a video by patrickJMT where he shows you how to approximate a definite integral using rectangles.
It is important to know that there are three types of rectangles we can take when approximating: left, right, and midpoint. As you will see in the following examples, they do give different results.
The left rectangle approximation is when you make the left hand points of the pieces the height of the rectangles.
The right rectangle approximation is when you make the right hand points of the pieces the height of the rectangles.
Finally, a midpoint rectangle approximation is when you make the midpoints of the pieces the height of the rectangles.
The first problem he looks at is:
Approximate
∫02(16−x2)dx
using n=4 rectangles and left endpoints.
To start, we should draw the graph on the interval [0,2].
Next, it tells us to use n=4 rectangles. To determine the spacing we can use the formula:
ΔxΔx=nb−a=42−0=21
Finally, it wants the rectangles to be left endpoints. This means the rectangles' height is based off the left point.
Finally we just sum up the area of each rectangle.
AAAAAA≈R1+R2+R3+R4≈0.5f(0)+0.5f(0.5)+0.5f(1)+0.5f(1.5)≈0.5[f(0)+f(0.5)+f(1)+f(1.5)]≈0.5[(16−02)+(16−0.52)+(16−12)+(16−1.52)]≈0.5[16+15.75+15+13.75]≈30.25
Because our rectangles are containing area above the curve, we know that our answer is an overestimate.
This part is not in the video but let's see what happens when we use right endpoints.
Approximate
∫02(16−x2)dx
using n=4 rectangles and right endpoints.
Since everything else is staying the same, the graph and the pieces will be the same as before.
Because these rectangles leave out some area under the graph, we expect this approximation to be less than the one above.
AAAAAA≈R1+R2+R3+R4≈0.5f(0.5)+0.5f(1)+0.5f(1.5)+0.5f(2)≈0.5[f(0.5)+f(1)+f(1.5)+f(2)]≈0.5[(16−0.52)+(16−12)+(16−1.52)+(16−22)]≈0.5[15.75+15+13.75+12]≈28.25
Now let's take the same problem but use the midpoints. Do you expect this approximation to be the most accurate?
Approximate
∫02(16−x2)dx
using n=4 rectangles and right endpoints.
The left side is missing area under the curve but the right side has area above the curve. Because of this, we expect the two to balance each other, giving us an approximation somewhere in-between the left endpoint and right endpoint.
AAAAAA≈R1+R2+R3+R4≈0.5f(0.25)+0.5f(0.75)+0.5f(1.25)+0.5f(1.75)≈0.5[f(0.25)+f(0.75)+f(1.25)+f(1.75)]≈0.5[(16−0.252)+(16−0.752)+(16−1.252)+(16−1.752)]≈0.5[15.9375+15.4375+14.4375+12.9375]≈29.375
Accuracy
The smaller the error, the better the approximation of the actual value of the integral (which can't always be computed explicitly)
TypeActualLeftRightMidpointValue29.3ˉ30.2528.2529.375Error0.916ˉ1.083ˉ0.0416ˉAccuracy96.88%96.31%99.86%