YYnotesYYNotes

学习目标Learning Objectives - Note

#学习目标#关键概念#定义与公式#推导

第1周:单变量非线性方程求解Week 1 - Solving Single Nonlinear Equations

在已知变号区间时应用二分法。Bilingual notes on bisection and Newton tangent methods.

These notes are polished from raw lecture text and formatted for direct MDX website use.

本笔记由原始课堂文本整理而成,并已格式化为可直接用于网站的 MDX 内容。

学习目标

Learning Objectives

  • 理解用数值方法求解非线性方程 f(x)=0f(x)=0 的基本含义。

  • Understand what it means to solve a nonlinear equation f(x)=0f(x)=0 numerically.

  • 在已知变号区间时应用二分法(Bisection Method)

  • Apply bisection when a sign-changing interval is available.

  • 推导并使用牛顿切线法实现局部快速收敛(Convergence)

  • Derive and use Newton's tangent method for fast local convergence.

  • 比较二分法(Bisection Method)牛顿法(Newton's Method)在稳定性和收敛(Convergence)速度上的差异。

  • Compare robustness and convergence speed of bisection and Newton methods.

关键概念

Key Concepts

  • 根是满足 f(x)=0f(x^*)=0 的数值 xx^*

  • A root is a value xx^* such that f(x)=0f(x^*)=0.

  • 二分法(Bisection Method)要求函数连续且满足端点变号 f(a)f(b)<0f(a)f(b)<0

  • Bisection requires continuity and a sign change f(a)f(b)<0f(a)f(b)<0.

  • 牛顿迭代(Iteration)使用导数信息:xn+1=xnf(xn)f(xn)x_{n+1}=x_n-\dfrac{f(x_n)}{f'(x_n)}

  • Newton iteration uses derivative information: xn+1=xnf(xn)f(xn)x_{n+1}=x_n-\dfrac{f(x_n)}{f'(x_n)}.

  • 记号统一:迭代(Iteration)值记为 xnx_n,真根记为 α\alpha误差(Error)记为 en=xnαe_n=x_n-\alpha

  • Notation standardization: iterate xnx_n, true root α\alpha, error en=xnαe_n=x_n-\alpha.

定义与公式

Definitions and Formulas

定义模块:介值定理

Definition Block: Intermediate Value Theorem

fC[a,b]f\in C[a,b]f(a)f(b)<0f(a)f(b)<0,则存在 α(a,b)\alpha\in(a,b) 使得 f(α)=0f(\alpha)=0

If fC[a,b]f\in C[a,b] and f(a)f(b)<0f(a)f(b)<0, then there exists α(a,b)\alpha\in(a,b) with f(α)=0f(\alpha)=0.

二分中点:mn=an+bn2m_n=\dfrac{a_n+b_n}{2}

Bisection midpoint: mn=an+bn2m_n=\dfrac{a_n+b_n}{2}.

二分法(Bisection Method)误差(Error)界:mnαb0a02n+1|m_n-\alpha|\le \dfrac{b_0-a_0}{2^{n+1}}

Bisection error bound: mnαb0a02n+1|m_n-\alpha|\le \dfrac{b_0-a_0}{2^{n+1}}.

平方根问题的牛顿更新:若 f(x)=x2cf(x)=x^2-c,则 xn+1=12(xn+cxn)x_{n+1}=\dfrac{1}{2}\left(x_n+\dfrac{c}{x_n}\right)

Newton update for square roots: if f(x)=x2cf(x)=x^2-c, then xn+1=12(xn+cxn)x_{n+1}=\dfrac{1}{2}\left(x_n+\dfrac{c}{x_n}\right).

停止准则:xn+1xn<ε|x_{n+1}-x_n|<\varepsilonf(xn)<ε|f(x_n)|<\varepsilon

Stopping criteria: xn+1xn<ε|x_{n+1}-x_n|<\varepsilon or f(xn)<ε|f(x_n)|<\varepsilon.

推导

Derivations

由切线线性化推导牛顿公式

Newton Formula from Tangent Linearization

Linearize ff at xnx_n: f(x)f(xn)+f(xn)(xxn)f(x)\approx f(x_n)+f'(x_n)(x-x_n).

xnx_n 处线性化:f(x)f(xn)+f(xn)(xxn)f(x)\approx f(x_n)+f'(x_n)(x-x_n)

令线性近似等于零并求下一次迭代(Iteration)值。

Set approximation to zero and solve for the next iterate.

Thus xn+1=xnf(xn)f(xn)x_{n+1}=x_n-\dfrac{f(x_n)}{f'(x_n)}.

得到 xn+1=xnf(xn)f(xn)x_{n+1}=x_n-\dfrac{f(x_n)}{f'(x_n)}

二分法(Bisection Method)区间收缩

Bisection Contraction

每次迭代(Iteration)将区间长度减半:In=I02n|I_n|=\dfrac{|I_0|}{2^n}

Each iteration halves interval length: In=I02n|I_n|=\dfrac{|I_0|}{2^n}.

中点误差(Error)不超过区间长度的一半。

Midpoint error is at most half interval length.

因此在满足条件时,二分法(Bisection Method)线性收敛(Convergence)且全局可靠。

Therefore bisection is linearly convergent and globally reliable under assumptions.

例题精讲

Worked Examples

例题模块1:二分法(Bisection Method)求解 x3x+1=0x^3-x+1=0

Example Block 1: Bisection for x3x+1=0x^3-x+1=0

由课堂表可得 f(2)=5f(-2)=-5f(1)=1f(-1)=1,因此根位于 [2,1][-2,-1]

From the lecture table, f(2)=5f(-2)=-5 and f(1)=1f(-1)=1, so a root lies in [2,1][-2,-1].

前三个中点为 1.5-1.51.25-1.251.375-1.375,函数值符号交替。

First three midpoints are 1.5-1.5, 1.25-1.25, and 1.375-1.375 with alternating signs.

由此可将根定位在 α1.3247\alpha\approx -1.3247 附近。

This brackets a root near α1.3247\alpha\approx -1.3247.

例题模块2:牛顿法(Newton's Method)2\sqrt{2}

Example Block 2: Newton for 2\sqrt{2}

f(x)=x22f(x)=x^2-2,初值 x0=1.5x_0=1.5

Set f(x)=x22f(x)=x^2-2 and choose x0=1.5x_0=1.5.

Iterates: x1=1.4166666667x_1=1.4166666667, x2=1.4142156863x_2=1.4142156863, x3=1.4142135624x_3=1.4142135624.

迭代(Iteration)结果:x1=1.4166666667x_1=1.4166666667x2=1.4142156863x_2=1.4142156863x3=1.4142135624x_3=1.4142135624

该方法快速收敛(Convergence)2\sqrt{2}

The method converges rapidly to 2\sqrt{2}.

例题模块3:牛顿法(Newton's Method)求解 x3x+2=0x^3-x+2=0

Example Block 3: Newton for x3x+2=0x^3-x+2=0

由变号检验 f(1)=2f(-1)=2f(2)=4f(-2)=-4,取初值 x0=1x_0=-1

Choose x0=1x_0=-1 from the sign test with f(1)=2f(-1)=2, f(2)=4f(-2)=-4.

With f(x)=3x21f'(x)=3x^2-1, we get x1=2x_1=-2 and x2=1.6363636364x_2=-1.6363636364.

f(x)=3x21f'(x)=3x^2-1,得到 x1=2x_1=-2x2=1.6363636364x_2=-1.6363636364

误差(Error)分析

Error Analysis

  • 二分法(Bisection Method)具有有保证的线性收敛(Convergence):近似满足 en+112ene_{n+1}\approx \dfrac{1}{2}e_n

  • Bisection has guaranteed linear convergence: roughly en+112ene_{n+1}\approx \dfrac{1}{2}e_n.

  • 牛顿法(Newton's Method)在简单根附近具有局部二次收敛(Convergence)en+1Cen2e_{n+1}\approx C e_n^2

  • Newton has local quadratic convergence near simple roots: en+1Cen2e_{n+1}\approx C e_n^2.

  • f(xn)f'(x_n) 接近零或初值较差时,牛顿法(Newton's Method)可能失败。

  • Newton may fail if f(xn)f'(x_n) is close to zero or if the initial guess is poor.

常见错误

Common Mistakes

警示模块

Warning Block

  • 未检查端点变号就直接使用二分法(Bisection Method)

  • Applying bisection without checking endpoint sign change.

  • 在浮点计算中用 f(x)==0 作为停止条件。

  • Using exact equality f(x)==0 as stopping logic in floating-point arithmetic.

  • 导数写错,例如把 f(x)=3x21f'(x)=3x^2-1 写错。

  • Using wrong derivative, such as miswriting f(x)=3x21f'(x)=3x^2-1.

  • 没有基于容差的准则而过早停止。

  • Stopping too early without tolerance-based criteria.

总结

Summary

总结模块

Summary Block

  • 第1周建立了求根的核心框架:区间法与切线法。

  • Week 1 established the core root-finding framework: bracketing methods and tangent-based methods.

  • 二分法(Bisection Method)稳健;在导数可用且初值较好时牛顿法(Newton's Method)更快。

  • Bisection is robust; Newton is fast when derivative information and good initial guesses are available.

  • 这两类方法为后续插值、数值微分与数值积分(Numerical Integration)算法奠定基础。

  • Both methods are foundational for later interpolation, differentiation, and integration algorithms.

练习题

Practice Questions

  • [2,1][-2,-1] 上对 x3x+1=0x^3-x+1=0 进行 8 步二分,并给出最终误差(Error)上界。

  • Use bisection on x3x+1=0x^3-x+1=0 over [2,1][-2,-1] for 8 steps and report the final error bound.

  • x0=1.8x_0=1.8 为初值,用牛顿法(Newton's Method)3\sqrt{3},直到 xn+1xn<1010|x_{n+1}-x_n|<10^{-10}

  • Apply Newton's method to compute 3\sqrt{3} from x0=1.8x_0=1.8 until xn+1xn<1010|x_{n+1}-x_n|<10^{-10}.

  • 说明在实际计算中何时应优先选择二分法(Bisection Method)而不是牛顿法(Newton's Method)

  • Explain when bisection is preferred over Newton in practical computation.