📚 The Trapezoidal Rule for Numerical Integration | 梯形法则求数值积分
In IB Mathematics, we often need to evaluate definite integrals. However, many integrals cannot be expressed using elementary functions, or the antiderivative is too difficult to find. Numerical integration provides a practical way to approximate the value of a definite integral. The trapezoidal rule is one of the simplest and most commonly taught methods.
在国际文凭(IB)数学课程中,我们经常需要计算定积分。然而,许多积分无法用基本函数表示,或者求原函数过于困难。数值积分为估算定积分值提供了一种实用的方法。梯形法则(梯形法)是最简单且最常用的方法之一。
1. Why Numerical Integration? | 为什么需要数值积分?
When you can find an antiderivative, use the Fundamental Theorem of Calculus. But when you cannot – or when the function is only known at discrete points – numerical integration comes into play. The trapezoidal rule approximates the area under a curve by summing the areas of trapezia (trapezoids) formed by the curve and the x-axis.
当你能够找到原函数时,可以使用微积分基本定理。但当无法找到原函数,或者函数仅在离散点上已知时,就需要使用数值积分。梯形法则通过将曲线与 x 轴之间区域划分为若干个梯形,并累加这些梯形面积来近似曲线下的面积。
2. The Trapezoidal Rule Formula | 梯形法则公式
Suppose we want to approximate ∫ab , b] into n equal sub-intervals of width h = (b − a)/n. The approximate value is given by:
假设我们要近似计算 ∫ab f(x) dx。将区间 [a, b] 等分为 n 个宽度为 h = (b − a)/n 的子区间,近似值由下式给出:
∫ab f(x) dx ≈ (h/2) [ f(x₀) + 2f(x₁) + 2f(x₂) + … + 2f(xₙ₋₁) + f(xₙ) ]
Here x₀ = a, xₙ = b, and xᵢ = a + i·h for i = 0, 1, 2, … the first and last terms appear once, while all interior terms appear with a factor of 2.
其中 x₀ = a,xₙ = b,xᵢ = a + i·h(i = 0, 1, 2, …, n)。注意首尾两项只出现一次,而所有中间项都要乘以 2。
3. Deriving the Formula | 公式的推导
Each pair of consecutive points (xᵢ, f(xᵢ)) and (xᵢ₊₁, f(xᵢ₊₁)) forms a trapezium. The area of this trapezium is the average of its parallel sides multiplied by the width:
每对相邻点 (xᵢ, f(xᵢ)) 和 (xᵢ₊₁, f(xᵢ₊₁)) 构成一个梯形。这个梯形的面积等于其平行边的平均值乘以其宽度:
Aᵢ = (h/2) × (f(xᵢ) + f(xᵢ₊₁))
nd simplifying, gives the trapezoidal rule. This is why the endpoints appear once and interior points twice.
将 i = 0 到 n − 1 的这些面积相加并化简,就得到梯形法则。这正是首尾出现一次、中间点出现两次的原因。
4. Overestimate vs Underestimate | 高估与低估
The trapezoidal rule produces an overestimate when the curve is concave up (f''(x) > 0), because the trapezium lies above the curve. It produces an underestimate when the curve is concave down (f''(x) < 0). Moving from left to right, the error depends on the curvature of the function.
当曲线是凹向上的(f''(x) > 0)时,梯形位于曲线上方,因此梯形法则会高估积分值;当曲线是凹向下的(f''(x) < 0)时,会低估积分值。从左到右移动时,误差取决于函数的凹凸性。
5. Worked Example: ∫₁² (1/x) dx | 例题:∫₁² (1/x) dx
Use the trapezoidal rule with n = 4 to approximate ∫₁² (1/x) dx.
用 n = 4 的梯形法则近似计算 ∫₁² (1/x) dx。
unction values are f(1) = 1, f(1.25) = 0.8, f(1.5) ≈ 0.6667, f(1.75) ≈ 0.5714, f(2) = 0.5.
这里 a = 1,b = 2,n = 4,因此 h = (2 − 1)/4 = 0.25。x 值为 1, 1.25, 1.5, 1.75, 2。对应函数值为 f(1) = 1,f(1.25) = 0.8,f(1.5) ≈ 0.6667,f(1.75) ≈ 0.5714,f(2) = 0.5。
Approx = (0.25/2) × [1 + 2(0.8 + 0.6667 + 0.5714) + 0.5]
= 0.125 × [1 + 2(2.0381) + 0.5] = 0.125 × 5.5762 ≈ 0.6970
≈ 0.6931, so the approximation is close. With more strips, it becomes even more accurate.
真实值为 ln 2 ≈ 0.6931,因此这个近似值已经相当接近。若增加等分数目,结果会更加精确。
6. Increasing Accuracy | 提高精度
As n increases, h decreases, and the trapezoidal rule generally becomes more accurate. The error is proportional to h², so doubling n reduces the error by a factor of about 4. You should always consider whether the given number of sub-intervals is adequate for the required accuracy.
随着 n 增大,h 减小,梯形法则通常越来越精确。误差与 h² 成正比,因此将 n 加倍可使误差大约变为原来的四分之一。应始终考虑给定子区间数量是否满足所需精度。
7. Comparing with Simpson's Rule | 与辛普森法则的比较
Simpson's rule uses quadratic approximations over pairs of sub-intervals. It is generally more accurate than the trapezoidal rule for smooth functions, but it requires n to be even and uses coefficients 1, 4, 2, 4, 2, …, 2, 4, 1. In IB, you may be asked to know both methods, but the trapezoidal rule is often the starting point.
辛普森法则在一对子区间上使用二次函数进行近似。对于光滑函数,它通常比梯形法则更精确,但要求 n 为偶数,且系数为 1, 4, 2, 4, 2, …, 2, 4, 1。在 IB 中,你可能需要掌握这两种方法,但梯形法则通常是基础。
8. Common Mistakes | 常见错误
Forgetting to multiply interior terms by 2. | 忘记将中间项乘以 2。
Using h instead of h/2 in the formula. | 在公式中使用 h 而不是 h/2。
Miscounting the number of strips (n) or the number of function values (n + 1). | 数错子区间的数量 n 或函数值的数量(n + 1)。
Using left or right endpoints only; the trapezoidal rule needs all endpoints. | 只使用左端点或右端点;梯形法则需要所有端点。
9. Practice Problem | 练习问题
Use the trapezoidal rule with n = 4 to approximate ∫₀¹ √1 + x dx. Give your answer to three decimal places.
用 n = 4 的梯形法则近似计算 ∫₀¹ √1 + x dx,结果保留三位小数。
25, 0.5, 0.75, 1. The function values are approximately 1, 1.1180, 1.2247, 1.3229, 1.4142 (using a calculator).
解答:h = 0.25,x 值为 0, 0.25, 0.5, 0.75, 1。函数值约为 1, 1.1180, 1.2247, 1.3229, 1.4142(使用计算器计算)。
Approx = (0.25/2) × [1 + 2(1.1180 + 1.2247 + 1.3229) + 1.4142] ≈ 1.218
This is very close to the exact value (2/3)(2√2 − 1) ≈ 1.219.
这与精确值 (2/3)(2√2 − 1) ≈ 1.219 非常接近。
10. Key Takeaways | 要点总结
The trapezoidal rule is a reliable method for approximating definite integrals. The formula is easy to apply, and the accuracy improves as n increases. Remember to identify whether your approximation is an overestimate or underestimate by examining concavity, and always show your working clearly in exams.
梯形法则是一种可靠的计算定积分近似值的方法。公式易于应用,且随着 n 增大精度会提高。请记住通过凹凸性判断近似结果是高估还是低估,并在考试中清晰地展示你的计算过程。
Published by TutorHao | IB Maths Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

或截图后用「扫一扫 → 相册」选择本图