Trapezoidal Rule for Numerical Integration | IB数学:梯形法则近似计算方法

📚 Trapezoidal Rule for Numerical Integration | IB数学:梯形法则近似计算方法

The trapezoidal rule is a standard numerical method for approximating the value of a definite integral. It works by dividing the area under a curve into trapezoids rather than rectangles, often giving a more accurate estimate than simple rectangular methods.

梯形法则是估算定积分近似值的标准数值方法。它将曲线下方的面积划分为若干梯形,而非矩形,因此通常比简单的矩形法更精确。


1. The Basic Formula | 基本公式

Suppose we wish to approximate \(\int_a^b f(x)\,dx\). We split the interval \([a,b]\) into \(n\) equal subintervals, each of width \(h = \frac{b-a}{n}\). The approximate integral is given by:

假设我们要近似计算 \(\int_a^b f(x)\,dx\)。将区间 \([a,b]\) 等分为 \(n\) 个子区间,每个宽度为 \(h = \frac{b-a}{n}\)。近似积分为:

\[ \int_a^b f(x)\,dx \approx \frac{h}{2} \left( f(x_0) + 2f(x_1) + 2f(x_2) + \cdots + 2f(x_{n-1}) + f(x_n) \right) \]

Here \(x_0 = a\), \(x_n = b\), and \(x_i = a + ih\) for \(i = 0, 1, \dots, n\).

其中 \(x_0 = a\),\(x_n = b\),且 \(x_i = a + ih\)(\(i = 0, 1, \dots, n\))。


2. Why Trapezoids? | 为什么用梯形?

Each subinterval \([x_{i-1}, x_i]\) is treated as a straight line segment connecting the points \((x_{i-1}, f(x_{i-1}))\) and \((x_i, f(x_i))\). The area of one such trapezoid is \(\frac{h}{2}(f(x_{i-1}) + f(x_i))\).

每个子区间 \([x_{i-1}, x_i]\) 被看作连接两点 \((x_{i-1}, f(x_{i-1}))\) 和 \((x_i, f(x_i))\) 的直线段。一个这样梯形的面积为 \(\frac{h}{2}(f(x_{i-1}) + f(x_i))\)。

Summing all trapezoids gives the rule above. In the formula, interior points appear twice because they belong to two adjacent trapezoids.

将所有梯形求和便得到上述法则。在公式中,内部点出现两次,因为它们同时属于两个相邻的梯形。


3. Comparison with Rectangular Methods | 与矩形法比较

The trapezoidal rule usually gives a more accurate approximation than the left or right rectangle rule for the same number of subintervals, because the slanted tops of trapezoids better follow the actual curve.

在相同子区间数量下,梯形法则通常比左矩形法或右矩形法更精确,因为梯形的斜边能更好地贴合实际曲线。

  • Left rectangle: \(\sum_{i=0}^{n-1} h f(x_i)\) systematically underestimates an increasing function.
  • 左矩形法:\(\sum_{i=0}^{n-1} h f(x_i)\) 对递增函数会系统性低估。
  • Right rectangle: \(\sum_{i=1}^{n} h f(x_i)\) systematically overestimates an increasing function.
  • 右矩形法:\(\sum_{i=1}^{n} h f(x_i)\) 对递增函数会系统性高估。
  • Trapezoidal rule: averages the left and right heights, reducing bias.
  • 梯形法则:取左右高度的平均,从而减小偏差。

4. Geometric Interpretation | 几何意义

For a positive function on \([a,b]\), the trapezoidal rule approximates the signed area between the curve and the x-axis using straight-line segments instead of the actual curve. If the function is linear, the approximation is exact.

对于 \([a,b]\) 上的正函数,梯形法则用直线段代替实际曲线,来近似曲线与 x 轴之间的有向面积。若函数本身是线性的,则近似值精确。

When the curve is concave down, as in \(f(x) = \sqrt{x}\), the trapezoids usually give an underestimate; when concave up, they usually give an overestimate.

当曲线下凹(如 \(f(x) = \sqrt{x}\))时,梯形通常给出低估;当曲线上凸时,梯形通常给出高估。


5. Error Bound | 误差界

The error in the trapezoidal rule is related to the second derivative of the function. If \(|f”(x)| \le K\) on \([a,b]\), then the absolute error satisfies:

梯形法则的误差与函数的二阶导数有关。若在 \([a,b]\) 上 \(|f”(x)| \le K\),则绝对误差满足:

\[ \left| \int_a^b f(x)\,dx – T_n \right| \le \frac{K (b-a)^3}{12 n^2} \]

where \(T_n\) is the trapezoidal approximation with \(n\) subintervals.

其中 \(T_n\) 是使用 \(n\) 个子区间的梯形近似值。

This bound shows that doubling \(n\) reduces the error by a factor of about 4, provided the second derivative does not change dramatically.

该误差界表明,在二阶导数变化不大的情况下,将 \(n\) 加倍可使误差大约缩小为原来的四分之一。


6. Worked Example | 例题示范

Approximate \(\int_0^1 e^x\,dx\) using the trapezoidal rule with \(n=4\).

用梯形法则取 \(n=4\) 近似计算 \(\int_0^1 e^x\,dx\)。

Here \(a=0\), \(b=1\), \(h = \frac{1-0}{4} = 0.25\). The required function values are:

这里 \(a=0\),\(b=1\),\(h = \frac{1-0}{4} = 0.25\)。所需函数值为:

\(x_i\) 0 0.25 0.5 0.75 1
\(e^{x_i}\) 1 1.2840 1.6487 2.1170 2.7183

Applying the formula:

代入公式:

\[ T_4 = \frac{0.25}{2} \left( 1 + 2(1.2840) + 2(1.6487) + 2(2.1170) + 2.7183 \right) \approx 1.7272 \]

The true value is \(e – 1 \approx 1.7183\), so the approximation is quite close.

真实值为 \(e – 1 \approx 1.7183\),因此该近似值相当接近。


7. Increasing Accuracy | 提高精度

To improve the estimate, increase the number of subintervals \(n\). More trapezoids mean smaller \(h\), which reduces the error because the straight-line segments better match the curve on smaller intervals.

要提高估算精度,可增加子区间数量 \(n\)。梯形越多,\(h\) 越小,误差就越小,因为在更小区间上直线段更贴近曲线。

For IB examinations, common values of \(n\) are 4, 6, or 8. Always show the values of \(h\) and the function values in a table to demonstrate method.

在 IB 考试中,常见的 \(n\) 值为 4、6 或 8。务必在表格中列出 \(h\) 和函数值,以清晰展示步骤。

Check whether your final answer is an overestimate or underestimate by considering the concavity of the function on the interval.

通过考察函数在区间上的凹凸性,判断最终答案是高估还是低估。


8. Using a GDC | 使用图形计算器

Many GDC models can compute definite integrals directly. However, IB exams often require the trapezoidal rule explicitly, so you must be able to apply it manually as well as verify with technology.

许多图形计算器可以直接计算定积分。但 IB 考试常常明确要求使用梯形法则,因此你必须既能手动计算,也能用技术工具验证。

  • Set the function and interval carefully.
  • 仔细设置函数和积分区间。
  • Use the integral / numerical integration menu.
  • 使用积分/数值积分菜单。
  • Compare the calculator’s answer with your trapezoidal result.
  • 将计算器结果与你的梯形结果进行比较。

9. Overestimate vs Underestimate | 高估还是低估

If the function is concave up on \([a,b]\), the trapezoids lie above the curve, producing an overestimate. If the function is concave down, the trapezoids lie below the curve, producing an underestimate.

若函数在 \([a,b]\) 上是上凸的,梯形位于曲线上方,结果会高估;若函数是下凹的,梯形位于曲线下方,结果会低估。

For example, \(f(x)=x^2\) is concave up everywhere, so every trapezoidal approximation with finite \(n\) is an overestimate of \(\int x^2\,dx\) on a positive interval.

例如,\(f(x)=x^2\) 处处上凸,因此任意有限 \(n\) 的梯形近似对正区间上的 \(\int x^2\,dx\) 都是高估。

Knowing whether the estimate is too high or too low helps you interpret the result and check for errors.

判断估算值偏高还是偏低,有助于解读结果并检查错误。


10. Relationship to the Midpoint Rule | 与中点法则的关系

The midpoint rule approximates each subinterval using a rectangle whose height is the function value at the midpoint. It often has the opposite concavity bias compared to the trapezoidal rule.

中点法则在每个子区间上使用中点的函数值作为矩形高度。它通常与梯形法则具有相反的凹凸性偏差。

In fact, the trapezoidal rule and the midpoint rule can be combined to create Simpson’s rule, which is even more accurate.

事实上,梯形法则和中点法则可以结合成辛普森法则,该方法更为精确。

\[ S_{2n} = \frac{1}{3} T_n + \frac{2}{3} M_n \]

where \(M_n\) is the midpoint rule approximation using \(n\) subintervals.

其中 \(M_n\) 是使用 \(n\) 个子区间的中点法则近似值。


11. Common Pitfalls | 常见错误

  • Forgetting to multiply interior values by 2.
  • 忘记将内部值乘以 2。
  • Using \(h\) instead of \(h/2\) at the front of the formula.
  • 在公式前面使用 \(h\) 而不是 \(h/2\)。
  • Miscounting the number of intervals: there are always \(n+1\) function values for \(n\) intervals.
  • 数错区间数量:\(n\) 个区间对应 \(n+1\) 个函数值。
  • Forgetting to include both endpoints \(a\) and \(b\).
  • 忘记包含两个端点 \(a\) 和 \(b\)。
  • Rounding intermediate values too early, which can accumulate errors.
  • 过早四舍五入中间值,导致误差累积。

12. Summary | 总结

The trapezoidal rule is a fundamental numerical integration tool in IB Mathematics. It provides a simple and systematic way to approximate definite integrals when an antiderivative is difficult or impossible to find.

梯形法则是 IB 数学中基本的数值积分工具。当原函数难以或无法求出时,它提供了一种简单而系统的方法来近似计算定积分。

Remember the formula, understand its geometric meaning, and always check whether your approximation makes sense by considering concavity and the error bound.

记住公式,理解其几何意义,并通过凹凸性和误差界判断近似值是否合理。

With practice, you will be able to apply the trapezoidal rule quickly and accurately in exams and real-world applications.

通过练习,你将在考试和实际问题中快速而准确地运用梯形法则。


Published by TutorHao | Mathematics Revision Series | aleveler.com

更多咨询请联系16621398022(同微信)

Comments

屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from aleveler.com

Subscribe now to keep reading and get access to the full archive.

Continue reading

Exit mobile version