Recall we learned about three methods to approximate the area under the curve back in SectionΒ 5.1: left-endpoint approximation, right-endpoint approximation, and midpoint approximation. Letβs quickly review the left- and right- endpoint approximations.
In this section, we will learn three more numerical methods to approximate the area under the curve, the midpoint rule, the trapezoidal rule, and the Simpsonβs rule. We will use the same function as the example to explore both the rules and the relation between the rules.
We have seen the midpoint rule before. This is the same thing as the midpoint approximation we learned back in SectionΒ 5.1, that we want to construct the rectangles whose height is the function value of the midpoint of each subinterval.
In case you donβt recall how the midpoint rule (aka the midpoint approximation) works, below is the diagram with the rectangles for this approximation method.
Observe that we first find the midpoint of each sub-interval, then find the function outputs of these midpoints as the heights of the rectangles. So we are really finding the midpoints of the inputs, not the outputs.
where \(\Delta x = \dfrac{b - a}{N}\) and \(c_i = a + \left(i + \frac{1}{2}\right)\Delta\) is the midpoint of the sub-interval \([x_{i-1}, x_i]\text{.}\)
You may be wondering why we always approximate the area under the curve using rectangles. That is because the area of rectangles can be easily calculated. But the tradeoff here is that the approximation may not be accurate.
If you donβt oppose using another shape to approximate the area under the curve, we can approximate the area using trapezoids. This approximation method will give us a slightly better result compared to the left- and the right- endpoint approximation, but the tradeoff here is that the area of the trapezoids is a bit more complicated to calculate compared to the area of rectangles.
We can summarize the pattern and make it a fancy formula out of it (so we donβt need to keep on drawing trapezoids). Observe that we need to divide \(\Delta x\) by \(2\text{.}\) In addition, we need to multiply all the function values in the middle by \(2\text{,}\) but not to the first and the last function values.
This is the most fanciest type of approximation we will learn in this class. In fact, this method is kind of complicated to demonstrate algebraically (not hard, just a lot of work) so Richard will not explain the theorem but just to state the rule below. If you really want to figure out why this rule works the way it does, your textbook includes the derivation.
Simpsonβs rule uses parabolas to approximate the area under the curve, providing a more accurate approximation of the area under the curve (but again, the tradeoff is the more complicated formula). We can determine a parabola using three points, so technically we will be constructing back-to-back parabolas to approximate the area.
There are patterns we can observe from Simpsonβs rule: we need to divide \(\Delta x\) by \(3\text{.}\) In addition, the coefficient for the first and the last function values is \(1\text{.}\) The coefficients for the middle function values alternate between \(4\) and \(2\text{.}\)
P.S.: Richard will not code the parabolas on the graph as he sucks at coding. He will draw the diagram in class on the board. The goal here is for you to know how to use the formula AND what the output represents.
There are certain more relations between the approximation methods we can explore. Given that we are short in time this term, this is where I like to leave it.
What you should get out of this section is to be able to approximate the area under the curve using the midpoint rule, the trapezoidal rule, and Simpsonβs rule.