English (unofficial) translations of posts at kexue.fm
Source

``Unsolved Mystery'': Why is the Midpoint Rule Not Taught?

Translated by DeepSeek V4 Pro. Translations can be inaccurate, please refer to the original post for important stuff.

Preface

In some previous articles, we have pointed out some problems with current textbooks. For example, improper prioritization (most obvious in those Linear Algebra tutorials that start with systems of linear equations), lack of intuition, and lack of guidance. I think the main reason might be following the crowd too much; we compile books the way others do, lacking our own perspectives and logic, which leads to some common flaws being passed down. Perhaps because of this, a strange phenomenon occurs—there is clearly a method with less calculation and higher accuracy that textbooks almost never mention, while another method with slightly more calculation and lower accuracy is taught in every similar textbook. It must be said that this is an “unsolved mystery”...

This article discusses two such methods: the “Midpoint Rule” and the “Trapezoidal Rule” for approximating definite integrals. I believe most friends who have studied calculus will remember the latter, as it appears in almost every calculus textbook. However, I believe many readers have never heard of the former, yet surprisingly, it has slightly less calculation and slightly higher accuracy. This article will briefly introduce these two methods and compare their precision. The unique aspect of this article is that the proof process follows the ideas of “Visual Complex Analysis,” using geometric methods to beautifully estimate the error!

Our goal is to find the approximate value of \int_a^b f(x)dx when exact calculation is difficult. These methods are basically based on the idea that the integral is the area.

Two Different Methods

The idea of the Trapezoidal Rule is quite simple. As shown in the figure, we divide the interval [a,b] into n equal parts, each of length h. Of course, equal division is not mandatory, but it simplifies the calculation. Then we connect each point f(a), f(x_1), \dots, f(x_{n-1}), f(b) sequentially to obtain n trapezoids. Summing the areas of these n trapezoids gives the approximate value of \int_a^b f(x)dx. Thus, we obtain the following result:

Trapezoidal Rule

\begin{aligned} \int_a^b f(x)dx &\approx \frac{f(a)+f(x_1)}{2}\cdot h+\frac{f(x_1)+f(x_2)}{2}\cdot h+\dots+\frac{f(x_{n-1})+f(b)}{2}\cdot h \\ &= \left[\frac{f(a)+f(b)}{2}+\sum_{i=1}^{n-1}f(x_i)\right]\cdot h \end{aligned} \tag{1}

Intuition tells us that the larger the number of divisions n (i.e., the smaller h), the smaller the error will be. We will discuss the specific accuracy analysis later. Now let’s look at another method for approximating definite integrals—the Midpoint Rule.

Its logic seems even more obvious. We similarly divide the interval [a,b] into n equal parts, each of length h. Then we take the midpoint of each part to calculate f(x), and create a rectangle with height f(x) and width h in each sub-interval. Finally, we sum the areas of each rectangle. Thus, we obtain the following formula:

Midpoint Rule

\begin{aligned} \int_a^b f(x)dx &\approx f\left(\frac{a+x_1}{2}\right)\cdot h+f\left(\frac{x_1+x_2}{2}\right)\cdot h+\dots+f\left(\frac{x_{n-1}+b}{2}\right)\cdot h \\ &= \left[f\left(\frac{a+x_1}{2}\right)+f\left(\frac{x_1+x_2}{2}\right)+\dots+f\left(\frac{x_{n-1}+b}{2}\right)\right]h \end{aligned} \tag{2}

In terms of calculation volume, formula (1) requires calculating the values of (n+1) nodes (i.e., f(x)), while formula (2) only requires calculating n nodes. Clearly, from this point alone, formula (2) is slightly superior. So, what about their respective accuracies? A wonderful geometric approach comes into play...

Error Analysis

Error Analysis

We need to “break the whole into parts” and first study the error in one small sub-interval. We choose a sufficiently small h so that the small part of the curve within the interval has a single convexity (either convex up or concave down). The figure illustrates the ideas of the Trapezoidal Rule and the Midpoint Rule.

The error given by the Trapezoidal Rule is the area enclosed by the line DC and the curve (blue part), and the error given by the Midpoint Rule is the area enclosed by the line EF and the curve (yellow part). At a glance, we can feel that the blue area will be larger than the yellow area, which intuitively tells us that the Trapezoidal Rule has a larger error. Of course, we cannot rely solely on feeling; we need further proof. It is easy to see from the figure that the estimate of the Trapezoidal Rule is larger than the exact value (only in the case shown in this figure), but the Midpoint Rule is not as intuitive (the horizontal line EF at the midpoint is not necessarily a tangent; it may intersect the original curve). A brilliant trick is to use the midpoint as the center of rotation and rotate EF until it becomes the line GH tangent to the original curve. After rotation, the rectangle ABEF becomes the trapezoid ABGH, but clearly the area remains unchanged. Thus, we can also easily see that the area of trapezoid ABGH is smaller than the area under the original curve, meaning the estimate of the Midpoint Rule is larger than the exact value.

In fact, generally speaking, the exact value of the definite integral lies between the results given by the Trapezoidal Rule and the Midpoint Rule.

This tells us that the maximum error of both methods will not exceed the area of the quadrilateral CDHG. What we need to do is find its relationship with h. When h is very small, we might as well treat the original curve as a circular arc and rotate the figure so that the line GH is horizontal. Let |GH|=a; since h and |GH| are proportional, they are interchangeable to some extent.

Approximate Circular Arc

At this point, the quadrilateral CDHG can be approximated as a rectangle. Its area is \Delta S = |GH| \cdot |PQ|, and |DP|^2 = |OP| \cdot |PQ|.

So \Delta S = \frac{|GH|^3}{4|OP|} \propto |GH|^3 \propto h^3.

This only calculates the error for each part. Since the total error is the accumulation of errors from each part, the total error is \Delta \propto h^2.

In fact, theoretical analysis tells us that the errors of both are indeed on the order of h^2. But what is their relative error? We need to calculate the ratio of the blue area (S_1) to the yellow area (S_2).

\begin{aligned} S_1 &= r^2 \theta - r \cos\theta \cdot r \sin\theta = r^2 \theta - \frac{1}{2} r^2 \sin 2\theta \\ S_2 &= 2r \sin\theta \cdot r(1-\cos\theta) - (r^2 \theta - \frac{1}{2} r^2 \sin 2\theta) = 2r^2 \sin\theta - r^2 \theta - \frac{1}{2} r^2 \sin 2\theta \end{aligned}

Using Taylor series expansion to the third order, we get: \begin{aligned} S_1 &\approx \frac{4\theta^3}{3} \\ S_2 &\approx \frac{2\theta^3}{3} \end{aligned}

In other words, the error of the Trapezoidal Rule is twice that of the Midpoint Rule!

Afterword

Actually, the main purpose of this article is to introduce the Midpoint Rule to the readers and share the beautiful geometric proof method from “Visual Complex Analysis,” rather than to criticize textbooks. In my view, the Midpoint Rule is a very good method; it is puzzling that textbooks do not mention it. I only learned this thanks to that complex analysis textbook. However, this also reminds us to think more about “why” and “what else” when reading. We should not completely believe in the authority of books, because only knowledge is the hard truth. Just as after reading this article, you should also re-read it with a critical eye. ^_^

Additionally, it is worth praising the book “Visual Complex Analysis.” It explains complex analysis in a way that is completely different from common textbooks. It emphasizes geometric applications, intuition, and connections with physics, which is what a complex analysis textbook should do. Reading it carefully has benefited me greatly. Although I have only read a few pages, I have already decided to use it as my standard complex analysis textbook!

When reposting, please include the address of this article: https://kexue.fm/archives/1668

For more detailed reposting matters, please refer to: Scientific Space FAQ