Investigation 2: Numerical Integration | 探究二:数值积分

📚 Investigation 2: Numerical Integration | 探究二:数值积分

Numerical integration is a cornerstone technique used when an integral cannot be expressed in terms of elementary functions, or when only discrete data points are available. In IB Mathematics, you are expected to understand, apply, and compare methods such as the trapezoidal rule and Simpson’s rule, and to appreciate the role of error bounds. This investigation guides you through the derivation, geometric interpretation, error analysis, and practical implementation of these methods.

数值积分是一项基础技术,用于被积函数无法用初等函数表达,或仅有离散数据点的情况。在IB数学中,你需要理解、应用并比较梯形法则和辛普森法则等方法,并领会误差界的作用。本探究将引导你掌握这些方法的推导、几何解释、误差分析和实际实现。

1. Why Numerical Integration? | 为何需要数值积分?

Many definite integrals arising in physics, engineering, and statistics have no closed-form antiderivative. Examples include ∫₀¹ e-x² dx and ∫₀π sin(x²) dx. Even when a formula exists, evaluating it may be impractical. Numerical integration approximates the signed area under a curve by dividing the interval into subintervals and summing the areas of simple geometric shapes.

物理学、工程学和统计学中许多定积分没有封闭形式的原函数,例如 ∫₀¹ e-x² dx 和 ∫₀π sin(x²) dx。即使存在公式,计算也可能不切实际。数值积分通过将区间划分为子区间,并用简单几何图形的面积之和来近似曲线下的有向面积。

The accuracy of a numerical method depends on the number of subintervals n and the behaviour of the integrand. A central goal of this investigation is to understand how the error decreases as n increases, and to choose a method that balances simplicity and precision.

数值方法的精度取决于子区间数 n 和被积函数的性态。本探究的一个核心目标,就是理解误差如何随 n 增大而减小,并选择一种平衡简单性与精度的方法。


2. Riemann Sums: Left, Right, and Midpoint | 黎曼和:左端点、右端点与中点

The simplest approach begins with a regular partition of [a, b] into n subintervals of width Δx = (b − a)/n. Sample points xi* can be chosen at the left endpoint, right endpoint, or midpoint of each subinterval. The corresponding Riemann sums are:

最简单的方法是将区间 [a, b] 均匀分成 n 个子区间,宽度为 Δx = (b − a)/n。在每个子区间内,可以在左端点、右端点或中点选取样本点 xi*。相应的黎曼和如下:

Left: Ln = Δx Σi=1n f(xi−1)   |   Right: Rn = Δx Σi=1n f(xi)   |   Midpoint: Mn = Δx Σi=1n f(ximid)

Geometrically, left and right sums approximate the area using rectangles that touch the curve at one corner, whereas the midpoint rule uses the function value at the centre of each subinterval, often yielding a much better approximation for the same n.

从几何上看,左端点和右端点黎曼和使用在某个角点接触曲线的矩形来近似面积,而中点法则使用每个子区间中心处的函数值,通常在相同 n 下能得到更好的近似结果。


3. The Trapezoidal Rule | 梯形法则

The trapezoidal rule replaces each subinterval’s curve segment with a straight line connecting the endpoints, forming trapezoids. It can be derived by averaging the left and right Riemann sums, and its formula for a uniform partition is:

梯形法则将每个子区间内的弧段替换为连接端点的直线,构成梯形。它可以通过对左、右黎曼和取平均得到,对于等距划分,其公式为:

Tn = (Δx/2) [ f(x0) + 2f(x1) + 2f(x2) + … + 2f(xn−1) + f(xn) ]

Here x0=a, xn=b, and all interior points carry a coefficient of 2. This rule is exact for polynomials of degree ≤ 1 and often outperforms left or right Riemann sums for smooth functions.

这里 x0=a,xn=b,所有内点系数为 2。该法则对次数不超过 1 的多项式精确成立,对于光滑函数通常优于左、右黎曼和。


4. Simpson’s Rule | 辛普森法则

Simpson’s rule fits a quadratic polynomial through three consecutive points and requires an even number of subintervals n. The composite formula is:

辛普森法则通过三个连续点构造二次多项式,并要求子区间数 n 为偶数。复合辛普森公式为:

Sn = (Δx/3) [ f(x0) + 4f(x1) + 2f(x2) + 4f(x3) + … + 2f(xn−2) + 4f(xn−1) + f(xn) ]

The repeating coefficient pattern 4, 2, 4, 2, …, 4 gives surprising accuracy: Simpson’s rule integrates cubic polynomials exactly, even though it is constructed from quadratics. This makes it a powerful tool in the IB toolkit.

系数按 4, 2, 4, 2, … 重复出现,带来了惊人的精度:辛普森法则虽然由二次函数构造,却对三次多项式精确成立。这使其成为IB工具箱中的强大工具。


5. Derivation and Geometric Insight | 推导与几何洞察

The trapezoidal rule can be viewed as approximating the integral of the linear Lagrange interpolant on each subinterval. For a single panel [xi−1, xi], the area is Δx·[f(xi−1) + f(xi)]/2. Summing over all panels yields the composite rule.

梯形法则可看作在每个子区间上对线性拉格朗日插值多项式进行积分。对于单个面板 [xi−1, xi],面积为 Δx·[f(xi−1) + f(xi)]/2。对所有面板求和即得复合法则。

Simpson’s rule arises from fitting a quadratic p(x) through (xi−1, fi−1), (xi, fi), (xi+1, fi+1) and integrating exactly: ∫ p(x) dx. The symmetrical weighting 1-4-1 emerges naturally. The composite form extends this across the entire interval, producing high accuracy with relatively few function evaluations.

辛普森法则源于通过三点构造二次函数 p(x),并精确积分 ∫ p(x) dx。对称权重 1-4-1 自然出现。复合形式将这一思想推广至整个区间,用较少的函数求值次数实现了高精度。


6. Error Analysis for the Trapezoidal Rule | 梯形法则的误差分析

If f has a continuous second derivative on [a,b], the error in the composite trapezoidal rule satisfies:

若 f 在 [a,b] 上具有连续的二阶导数,复合梯形法则的误差满足:

|ET| ≤ (b − a)³/(12 n²) maxξ∈[a,b] |f”(ξ)|

This bound shows that doubling n reduces the error by approximately a factor of four, provided the second derivative does not change drastically. Notice that the error depends on the concavity of the function: highly oscillatory or sharply curved regions require more subintervals.

这个误差界表明,只要二阶导数不发生剧烈变化,将 n 加倍可使误差减小为原来的约四分之一。注意误差依赖于函数的凹性:高度振荡或急剧弯曲的区域需要更多子区间。


7. Error Analysis for Simpson’s Rule | 辛普森法则的误差分析

When f possesses a continuous fourth derivative, the Simpson’s rule error is bounded by:

当 f 具有连续的四阶导数时,辛普森法则的误差界为:

|ES| ≤ (b − a)⁵/(180 n⁴) maxξ∈[a,b] |f⁽⁴⁾(ξ)|

The presence of n⁴ in the denominator means that doubling n can reduce the error by a factor of about 16. For functions whose fourth derivative is moderate, Simpson’s method quickly delivers excellent precision, often with far fewer intervals than required by the trapezoidal rule.

分母中的 n⁴ 意味着将 n 加倍可使误差减小为原来的约 1/16。对于四阶导数适中的函数,辛普森方法可快速达到优异精度,通常所需区间数远少于梯形法则。


8. Practical Considerations: Choosing the Step Size | 实际考量:步长选择

Given a desired tolerance ε, you can invert the error bounds to estimate the required n. For the trapezoidal rule, choose

给定目标容差 ε,可以通过反推误差界来估计所需的 n。对梯形法则,选择

n ≥ √[ (b−a)³ M₂ / (12 ε) ]

where M₂ = max|f”(x)|. For Simpson’s rule,

其中 M₂ = max|f”(x)|。对于辛普森法则,

n ≥ ⁿ√[ (b−a)⁵ M₄ / (180 ε) ]

with M₄ = max|f⁽⁴⁾(x)|. In practice, you may not know the exact maximum, so you can overestimate M. Many calculators and computer programs adaptively refine the mesh until consecutive approximations agree to the required tolerance.

其中 M₄ = max|f⁽⁴⁾(x)|。实际应用中可能无法确知最大值的精确值,因此可以高估 M。许多计算器和计算机程序会自适应地加密网格,直到连续近似值在所需容差内一致。


9. Programming Numerical Integration (Pseudocode) | 数值积分编程实现(伪代码)

Implementing these methods sharpens understanding. Below is pseudocode for the composite trapezoidal rule:

通过编程实现这些方法可以加深理解。以下是复合梯形法则的伪代码:

Input: a, b, n, function f
dx = (b - a) / n
sum = 0.5 * ( f(a) + f(b) )
for i = 1 to n-1
    x = a + i * dx
    sum = sum + f(x)
end for
return dx * sum

The Simpson’s rule algorithm is similar but uses a weighted accumulator:

辛普森法则算法类似,但使用了加权累加器:

Input: a, b, n (n even), function f
dx = (b - a) / n
sum = f(a) + f(b)
for i = 1 to n-1
    x = a + i * dx
    w = 4 if i is odd, else 2
    sum = sum + w * f(x)
end for
return (dx/3) * sum

These loops can be easily translated into any programming language. Experimenting with different n reveals the convergence behaviour predicted by the error bounds.

这些循环可以轻松转换成任何编程语言。用不同的 n 进行实验,就能揭示误差界所预测的收敛行为。


10. Comparative Example with Graphical Insight | 比较实例与图形洞察

Consider the integral I = ∫₀¹ e-x² dx, which has no elementary antiderivative. The exact value (via the error function) is approximately 0.7468241328. The table below shows approximations with n = 4 and n = 8.

考虑积分 I = ∫₀¹ e-x² dx,它没有初等原函数。精确值(通过误差函数)约为 0.7468241328。下表给出了 n = 4 和 n = 8 时的近似结果。

Method n=4 approx. |Error| n=8 approx. |Error|
Midpoint 0.7487 1.9×10⁻³ 0.7473 4.8×10⁻⁴
Trapezoidal 0.7428 4.1×10⁻³ 0.7458 1.0×10⁻³
Simpson 0.7469 6.1×10⁻⁵ 0.74683 5.4×10⁻⁶

Notice that Simpson’s rule with n = 4 already achieves five-decimal accuracy, while the trapezoidal rule with n = 8 still has an error around 10⁻³. Graphing the function together with the approximating shapes illustrates why parabolic arcs capture the curve’s smooth peak much better than straight lines.

注意到 n = 4 的辛普森法则已能达到五位小数精度,而 n = 8 的梯形法则误差仍在 10⁻³ 量级。将函数图像与近似形状叠加绘制,可以清楚看出抛物线弧比直线段更能捕捉曲线的平滑峰。


11. Beyond Simpson: Romberg Integration (Brief) | 超越辛普森:龙贝格积分简述

Romberg integration applies Richardson extrapolation to the trapezoidal rule. By computing a sequence of trapezoidal approximations T(1), T(2), T(4), … and eliminating powers of the step size, you can accelerate convergence. The first extrapolation step recovers Simpson’s rule; further steps yield even higher-order methods.

龙贝格积分将理查森外推应用于梯形法则。通过计算一系列梯形近似 T(1), T(2), T(4), … 并消除步长的幂次项,可以加速收敛。第一步外推就恢复了辛普森法则;继续外推可得到更高阶方法。

This technique underpins many numerical integration routines in software. Although not a formal IB requirement, understanding it deepens your appreciation of error terms and efficiency.

这一技术是许多软件中数值积分程序的基础。虽然并非IB的正式要求,但理解它能加深你对误差项和效率的认识。


12. Summary and Key Takeaways | 总结与要点

Numerical integration empowers you to evaluate integrals that resist exact methods. The midpoint, trapezoidal, and Simpson’s rules each provide a balance of simplicity and accuracy. The error bounds depend on the interval length and a derivative of the integrand: second derivative for trapezoidal, fourth for Simpson. By selecting an appropriate n, you can meet any predetermined tolerance.

数值积分使我们能计算那些无法用精确方法求解的积分。中点法则、梯形法则和辛普森法则各自在简单性与精度之间取得了平衡。误差界取决于区间长度和被积函数的某阶导数:梯形法则取决于二阶导数,辛普森法则取决于四阶导数。通过选择合适的 n,可以满足任意预设的容差。

Key concepts to revisit for IB investigations include the geometric derivation, the impact of convexity/concavity on error sign, and the remarkable fact that doubling n reduces trapezoidal error by ~4× and Simpson error by ~16×. Whenever you encounter a daunting integral in your IA or exams, these tools turn a seemingly impossible task into a straightforward computation.

IB探究中需要重温的关键概念包括几何推导、凹凸性对误差符号的影响,以及将 n 加倍可使梯形误差缩小约 4 倍、辛普森误差缩小约 16 倍这一显著事实。当你在内部评估或考试中遇到棘手的积分时,这些工具可将看似无法完成的任务变成直接的计算。

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课程辅导,国外大学本科硕士研究生博士课程论文辅导

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