一杯茶从80°C冷却到60°C时,会经过中间的所有温度,因为温度逐渐变化。但停车场的收费则不然。假设(假设性地)停车场按每小时或每小时部分收费:59分钟收费3英镑,61分钟收费6英镑,而任何停留时间都不超过4.50英镑。收费会出现跳跃。
模块2讨论了极限不存在的三种方式:跳跃、无穷大和震荡。本模块则提出相反的问题:何时在每一点的极限等于该点的函数值?这样的函数是 连续 的,并且在区间内其图像可以不抬笔连续画出。连续性保证了方程有解(第3.3节),并且可以精确到任意程度(第3.4节),还保证了最大值和最小值存在(第3.5节)。第3.6至3.8节则追踪函数趋向无穷大的过程。
以下两个函数在2的左侧是相同的,而在2的右侧则不同:
h ( x ) = { x 2 if x < 2 , 6 − x if x ≥ 2 , h(x) = \begin{cases} x^2 & \text{if } x < 2, \\ 6 - x & \text{if } x \ge 2, \end{cases} h ( x ) = { x 2 6 − x if x < 2 , if x ≥ 2 ,
k ( x ) = { x 2 if x < 2 , 5 − x if x ≥ 2. k(x) = \begin{cases} x^2 & \text{if } x < 2, \\ 5 - x & \text{if } x \ge 2. \end{cases} k ( x ) = { x 2 5 − x if x < 2 , if x ≥ 2.
x x x h ( x ) h(x) h ( x ) k ( x ) k(x) k ( x ) 1.9 1.9 1.9 3.61 3.61 3.61 3.61 3.61 3.61 1.99 1.99 1.99 3.9601 3.9601 3.9601 3.9601 3.9601 3.9601 1.999 1.999 1.999 3.996001 3.996001 3.996001 3.996001 3.996001 3.996001 2 2 2 4 4 4 3 3 3 2.001 2.001 2.001 3.999 3.999 3.999 2.999 2.999 2.999 2.01 2.01 2.01 3.99 3.99 3.99 2.99 2.99 2.99 2.1 2.1 2.1 3.9 3.9 3.9 2.9 2.9 2.9
在 2 附近,h h h 的值从两侧趋近于 4,而 h ( 2 ) = 4 : h(2) = 4\mathclose{\text{:}} h ( 2 ) = 4 : 该值与其邻近值一致。k k k 的值从左侧趋近于 4,从右侧趋近于 3:它们不一致,没有在 2 处的单一值能同时符合两者。
对于一个多项式 p , p\mathclose{\text{,}} p , 模块 2 发现 lim x → a p ( x ) = p ( a ) : \lim_{x\to a} p(x) = p(a)\mathclose{\text{:}} lim x → a p ( x ) = p ( a ) : 极限等于该值。在某一点具有该性质的函数称为在该点连续。
定义 3.1一点连续性
设 f f f 在包含 a a a 的开区间上定义,可能在 a a a 本身处未定义。那么 f f f 在 a a a 处 连续,如果
lim x → a f ( x ) = f ( a ) . \lim_{x\to a} f(x) = f(a). x → a lim f ( x ) = f ( a ) .
这要求满足三个条件:
f ( a ) f(a) f ( a ) 有定义;
lim x → a f ( x ) \lim_{x\to a} f(x) lim x → a f ( x ) 存在;
极限等于该值。
如果 f f f 在 a a a 处不连续,那么 f f f 在 a a a 处 不连续 ,而 a a a 是 不连续点 于 f 。 f\mathclose{\text{。}} f 。
用文字表达:接近 a a a 的输入给出接近 f ( a ) f(a) f ( a ) 的输出,且图像在 ( a , f ( a ) ) (a, f(a)) ( a , f ( a )) 处不中断。在模块2的ε–δ语言中:对于每一个 ε > 0 , \varepsilon > 0\mathclose{\text{,}} ε > 0 , 存在一个 δ > 0 , \delta > 0\mathclose{\text{,}} δ > 0 , 使得
∣ f ( x ) − f ( a ) ∣ < ε whenever ∣ x − a ∣ < δ . \abs{f(x) - f(a)} < \varepsilon \quad\text{whenever}\quad \abs{x - a} < \delta. ∣ f ( x ) − f ( a ) ∣ < ε whenever ∣ x − a ∣ < δ .
(极限只关注 x ≠ a , x \ne a\mathclose{\text{,}} x = a , 但 x = a x = a x = a 这里没有害处,因为 ∣ f ( a ) − f ( a ) ∣ = 0 。) \abs{f(a) - f(a)} = 0\mathclose{\text{。)}} ∣ f ( a ) − f ( a ) ∣ = 0 。)
例 3.1检验三个条件 ✓ 已检验
判断每个函数在2处是否连续。如果不连续,说明哪个条件不满足。
(a) f ( x ) = x 2 − 4 x − 2 f(x) = \dfrac{x^2 - 4}{x - 2} f ( x ) = x − 2 x 2 − 4
(b) g ( x ) = x 2 − 4 x − 2 g(x) = \dfrac{x^2 - 4}{x - 2} g ( x ) = x − 2 x 2 − 4 对于 x ≠ 2 , x \ne 2\mathclose{\text{,}} x = 2 , 并且 g ( 2 ) = 1 g(2) = 1 g ( 2 ) = 1
(c)上面的函数 h h h
(d)上面的函数 k k k
(a) 条件1不满足:f ( 2 ) = 0 / 0 f(2) = 0/0 f ( 2 ) = 0/0 未定义。因此 f f f 在2处不连续,尽管其在该点的极限存在:对于 x ≠ 2 , x \ne 2\mathclose{\text{,}} x = 2 , f ( x ) = ( x − 2 ) ( x + 2 ) x − 2 = x + 2 , f(x) = \dfrac{(x - 2)(x + 2)}{x - 2} = x + 2\mathclose{\text{,}} f ( x ) = x − 2 ( x − 2 ) ( x + 2 ) = x + 2 , 所以 lim x → 2 f ( x ) = 4 。 \lim_{x\to 2} f(x) = 4\mathclose{\text{。}} lim x → 2 f ( x ) = 4 。
(b) 现在 g ( 2 ) = 1 g(2) = 1 g ( 2 ) = 1 有定义,且极限存在且为4,如(a)所示:条件1和2成立。条件3不成立,因为 4 ≠ 1 。 4 \ne 1\mathclose{\text{。}} 4 = 1 。 因此 g g g 在2处不连续。
(c) h ( 2 ) = 6 − 2 = 4 . h(2) = 6 - 2 = 4\mathclose{\text{.}} h ( 2 ) = 6 − 2 = 4 . 公式在2处发生变化,因此使用单侧极限(模块2):从左侧 lim x → 2 − x 2 = 4 , \lim_{x\to 2^-} x^2 = 4\mathclose{\text{,}} lim x → 2 − x 2 = 4 , 从右侧 lim x → 2 + ( 6 − x ) = 4 。 \lim_{x\to2^+} (6 - x) = 4\mathclose{\text{。}} lim x → 2 + ( 6 − x ) = 4 。 它们一致,因此 lim x → 2 h ( x ) = 4 = h ( 2 ) : \lim_{x\to2} h(x) = 4 = h(2)\mathclose{\text{:}} lim x → 2 h ( x ) = 4 = h ( 2 ) : 所有三个条件成立,且 h h h 在2处连续,尽管它由两个公式给出。
(d) 从左侧的极限再次为4;从右侧的极限是 lim x → 2 + ( 5 − x ) = 3 。 \lim_{x\to2^+}(5 - x) = 3\mathclose{\text{。}} lim x → 2 + ( 5 − x ) = 3 。 单侧极限不同,因此条件2不满足:k k k 在2处不连续,尽管 k ( 2 ) = 3 k(2) = 3 k ( 2 ) = 3 有定义。
注意
两个相反的错误。在 a a a 处有定义且在 a a a 处有极限并不足够:极限必须等于函数值,如(b)所示。并且一个分段定义的公式并不表示不连续:(c)中的 h h h 在2处连续,因为其分段在该点相接。检查三个条件;不要仅凭公式的外观来判断。
单侧连续性
一些函数会出现跳跃,但它们在跳跃点的函数值符合左右两边中的一个,例如地板函数。floor 函数 x , x\mathclose{\text{,}} x , 写作 ⌊ x ⌋ , \lfloor x\rfloor\mathclose{\text{,}} ⌊ x ⌋ , 读作 “floor x x x ”,是指小于或等于 x x x 的最大整数:⌊ 2.7 ⌋ = 2 , \lfloor 2.7\rfloor = 2\mathclose{\text{,}} ⌊ 2.7 ⌋ = 2 , ⌊ 3 ⌋ = 3 \lfloor 3\rfloor = 3 ⌊ 3 ⌋ = 3 和 ⌊ − 2.7 ⌋ = − 3 。 \lfloor -2.7\rfloor = -3\mathclose{\text{。}} ⌊ − 2.7 ⌋ = − 3 。 在 Python 中它表示为 math.floor,整数除法 7 // 2 会得到 ⌊ 7 / 2 ⌋ = 3 。 \lfloor 7/2\rfloor = 3\mathclose{\text{。}} ⌊ 7/2 ⌋ = 3 。 其图像是一条阶梯线。在 x = 3 : x = 3\mathclose{\text{:}} x = 3 : 对于 x x x 略小于 3 的值,⌊ x ⌋ = 2 , \lfloor x\rfloor = 2\mathclose{\text{,}} ⌊ x ⌋ = 2 , 而对于 3 ≤ x < 4 , 3 \le x < 4\mathclose{\text{,}} 3 ≤ x < 4 , ⌊ x ⌋ = 3 。 \lfloor x\rfloor = 3\mathclose{\text{。}} ⌊ x ⌋ = 3 。 因此
lim x → 3 − ⌊ x ⌋ = 2 , lim x → 3 + ⌊ x ⌋ = 3 = ⌊ 3 ⌋ . \lim_{x\to3^-}\lfloor x\rfloor = 2, \qquad \lim_{x\to3^+}\lfloor x\rfloor = 3 = \lfloor 3\rfloor. x → 3 − lim ⌊ x ⌋ = 2 , x → 3 + lim ⌊ x ⌋ = 3 = ⌊ 3 ⌋ .
在 3 处的极限不存在,因此地板函数在 3 处不连续;但其函数值与从右侧的极限一致。
定义 3.2一侧连续性和区间上的连续性
若 lim x → a + f ( x ) = f ( a ) , \lim_{x\to a^+} f(x) = f(a)\mathclose{\text{,}} lim x → a + f ( x ) = f ( a ) , 则函数 f f f 在 a a a 处右连续 ;若 lim x → a − f ( x ) = f ( a ) , \lim_{x\to a^-} f(x) = f(a)\mathclose{\text{,}} lim x → a − f ( x ) = f ( a ) , 则它在 a a a 处左连续 。
如果 f f f 在 I I I 的每个点连续,就说它在区间 I I I 上连续。若端点属于 I , I\mathclose{\text{,}} I , 在该点只需从 I I I 所在的一侧连续:左端点只要求右连续,右端点只要求左连续。
因此 ⌊ x ⌋ \lfloor x\rfloor ⌊ x ⌋ 在每一个整数处都是右连续的,并且在每个区间 [ n , n + 1 ) [n, n + 1) [ n , n + 1 ) 上连续,但在 [ n , n + 1 ] [n, n + 1] [ n , n + 1 ] 上不连续:在 n + 1 n + 1 n + 1 处它不是左连续的。平方根函数只在 x ≥ 0 x \ge 0 x ≥ 0 上有定义,因此在 0 处只有一个方向有效:lim x → 0 + x = 0 = 0 , \lim_{x\to0^+}\sqrt x = 0 = \sqrt0\mathclose{\text{,}} lim x → 0 + x = 0 = 0 , 并且 x \sqrt x x 在 [ 0 , ∞ ) [0, \infty) [ 0 , ∞ ) 上连续(第 3.2 节)。由于极限存在的充要条件是左右极限都存在且相等(模块 2),f f f 在 a a a 处连续当且仅当它在该点处左右都连续。
阶梯函数在计算中无处不在:一个显示整数度数的数字温度计,向下取整,当真实温度为 T T T 时显示 ⌊ T ⌋ , \lfloor T\rfloor\mathclose{\text{,}} ⌊ T ⌋ , 并且在每一个整数度数处都会跳跃。
注意
从图中读出单侧连续性。每个步骤 y = ⌊ x ⌋ y = \lfloor x\rfloor y = ⌊ x ⌋ 在其左端都有实心点,( n , n ) , (n, n)\mathclose{\text{,}} ( n , n ) , 并且从那里向右延伸:因此 ⌊ x ⌋ \lfloor x\rfloor ⌊ x ⌋ 是右连续的。称其为“左连续”是因为点在左边是常见的错误。
不连续性的种类
不连续性有几种类型(图 3.1),名称来源于图像在该点附近的行为。
图 3.1 在 x = 2 x = 2 x = 2 处有四种不连续性。可去的:g g g (例 3.1)的图像趋向于 ( 2 , 4 ) , (2, 4)\mathclose{\text{,}} ( 2 , 4 ) , 但 g ( 2 ) = 1 ; g(2) = 1\mathclose{\text{;}} g ( 2 ) = 1 ; 移动一个点可以填补空洞。跳跃的:k k k 从两侧不同的高度到达。无限的:1 / ( x − 2 ) 2 1/(x - 2)^2 1/ ( x − 2 ) 2 在虚线附近无界增长。振荡的:sin ( 1 / ( x − 2 ) ) \sin\big(1/(x - 2)\big) sin ( 1/ ( x − 2 ) ) 在接近 2 的地方无限次地在 − 1 -1 − 1 和 1 之间摆动。
定义 3.3不连续性的种类
设 a a a 是 f f f 的一个不连续点。该不连续性
是 可去的 如果 lim x → a f ( x ) \lim_{x\to a} f(x) lim x → a f ( x ) 存在;
是一个 跳跃的 如果两个单侧极限都存在但不同;
无穷间断 :当 x x x 至少从一侧趋近 a a a 时,f ( x ) f(x) f ( x ) 会最终超过任何指定的数,或最终小于任何指定的数(第 3.6 节用 lim x → a + f ( x ) = ∞ 、 \lim_{x\to a^+} f(x) = \infty\mathclose{\text{、}} lim x → a + f ( x ) = ∞ 、 lim x → a − f ( x ) = − ∞ \lim_{x\to a^-} f(x) = -\infty lim x → a − f ( x ) = − ∞ 等记号表示);
摆动 在所有其他情况下:此时至少有一个单侧极限不存在,但不趋于无穷,例如当 f f f 在值之间不断摆动时;
可去间断点可以通过在单点 a a a 处定义或重新定义 f f f 来消除:设 f ( a ) = lim x → a f ( x ) 。 f(a) = \lim_{x\to a} f(x)\mathclose{\text{。}} f ( a ) = lim x → a f ( x ) 。 这修复了例3.1中的 g : g\mathclose{\text{:}} g : 在2处给它赋值4。没有单个值能够修复其他三种类型,因为在那些点 lim x → a f ( x ) \lim_{x\to a} f(x) lim x → a f ( x ) 不存在;
例 3.2分类间断点 ✓ 已检验
找出并分类以下函数的间断点
(a) r ( x ) = x 2 − 4 x 2 − x − 2 , r(x) = \dfrac{x^2 - 4}{x^2 - x - 2}\mathclose{\text{,}} r ( x ) = x 2 − x − 2 x 2 − 4 , 即例 1.5 中的有理函数;
(b) s ( x ) = ∣ x ∣ x ; s(x) = \dfrac{\abs{x}}{x}\mathclose{\text{;}} s ( x ) = x ∣ x ∣ ;
(c) q ( x ) = sin x x . q(x) = \dfrac{\sin x}{x}\mathclose{\text{.}} q ( x ) = x sin x .
(a) 模块 1 已将分子和分母分解因式,得 r ( x ) = ( x − 2 ) ( x + 2 ) ( x − 2 ) ( x + 1 ) 。 r(x) = \dfrac{(x - 2)(x + 2)}{(x - 2)(x + 1)}\mathclose{\text{。}} r ( x ) = ( x − 2 ) ( x + 1 ) ( x − 2 ) ( x + 2 ) 。 所以 r r r 在 2 和 − 1 -1 − 1 处无定义,在其他每个 x x x 处都有 r ( x ) = x + 2 x + 1 。 r(x) = \dfrac{x + 2}{x + 1}\mathclose{\text{。}} r ( x ) = x + 1 x + 2 。 第 3.2 节说明 r r r 在除此两点之外的各点都连续。在 2 处,把 2 代入约分后的式子,得到
lim x → 2 r ( x ) = lim x → 2 x + 2 x + 1 = 4 3 , \lim_{x\to2} r(x) = \lim_{x\to2}\frac{x + 2}{x + 1} = \frac43, x → 2 lim r ( x ) = x → 2 lim x + 1 x + 2 = 3 4 ,
所以间断点是可去的:模块 1 找到的即是该点的“空洞”( 2 , 4 3 ) 。 \big(2, \tfrac43\big)\mathclose{\text{。}} ( 2 , 3 4 ) 。 在 − 1 -1 − 1 处,分子 x + 2 x + 2 x + 2 趋近于 1,分母 x + 1 x + 1 x + 1 趋近于 0,因此 r r r 的值无界增长:无限间断点(第 3.6 节找出单侧极限)。
(b) s s s 在 0 处未定义。它在 x < 0 x < 0 x < 0 处为 − 1 , -1\mathclose{\text{,}} − 1 , 在 x > 0 x > 0 x > 0 处为 1 , 1\mathclose{\text{,}} 1 , 因此,如模块 2 所示,lim x → 0 − s ( x ) = − 1 \lim_{x\to0^-} s(x) = -1 lim x → 0 − s ( x ) = − 1 和 lim x → 0 + s ( x ) = 1 : \lim_{x\to0^+} s(x) = 1\mathclose{\text{:}} lim x → 0 + s ( x ) = 1 : 0 是跳跃间断点。
(c) q q q 在 0 处未定义,且模块 2 证明了 lim x → 0 sin x x = 1 。 \lim_{x\to0}\dfrac{\sin x}{x} = 1\mathclose{\text{。}} lim x → 0 x sin x = 1 。 因此 0 是一个可去间断点:sin x x , \dfrac{\sin x}{x}\mathclose{\text{,}} x sin x , 在 0 处给定值 1,函数在 0 处连续。这个修复后的函数是信号处理中的sinc 函数(一些书将 π x \pi x π x 替换为 x )。 x\mathclose{\text{)。}} x )。
注意
分母为零并不总是意味着无穷间断点:r r r 的分母在 2 处为零,但分子也为零,因子 x − 2 x - 2 x − 2 可约去,因此间断点是可去的。先因式分解并约去,再判断。间断点的类型取决于 a a a 附近的极限,而不是 f ( a ) : f(a)\mathclose{\text{:}} f ( a ) : s s s 和 q q q 在 0 处都未定义,但类型不同。
检查每个点的三个条件将永远不会结束。一些定理可以一次性确定由模块 1 中函数库构建的所有函数的连续性。
和、积与商
定理 3.1连续性法则
如果 f f f 和 g g g 在 a a a 处连续,且 c c c 是常数,那么函数
f + g , f − g , c f , f g f + g, \qquad f - g, \qquad cf, \qquad fg f + g , f − g , c f , f g
函数在 a a a 处连续,如果 f / g f/g f / g 在 g ( a ) ≠ 0 g(a) \ne 0 g ( a ) = 0 处也连续。单侧连续同样成立,区间上的连续也是如此。
证明
每个陈述都是 模块 2 中极限法则的另一种表达方式。对于乘积法则:由于 lim x → a f ( x ) = f ( a ) \lim_{x\to a} f(x) = f(a) lim x → a f ( x ) = f ( a ) 和 lim x → a g ( x ) = g ( a ) \lim_{x\to a} g(x) = g(a) lim x → a g ( x ) = g ( a ) 都连续,乘积法则给出
lim x → a f ( x ) g ( x ) = lim x → a f ( x ) ⋅ lim x → a g ( x ) = f ( a ) g ( a ) , \begin{aligned} \lim_{x\to a} f(x)\,g(x) &= \lim_{x\to a} f(x) \cdot \lim_{x\to a} g(x) \\ &= f(a)\,g(a), \end{aligned} x → a lim f ( x ) g ( x ) = x → a lim f ( x ) ⋅ x → a lim g ( x ) = f ( a ) g ( a ) ,
说明 f g fg f g 在 a a a 处连续。和、差以及常数倍的法则同样适用。商法则要求分母的极限不为零,而这里分母的极限是 lim x → a g ( x ) = g ( a ) ≠ 0 。 \lim_{x\to a} g(x) = g(a) \ne 0\mathclose{\text{。}} lim x → a g ( x ) = g ( a ) = 0 。 (因此 g ( x ) ≠ 0 g(x) \ne 0 g ( x ) = 0 在 x x x 接近 a a a 时成立,且 f / g f/g f / g 在 a a a 的一个开区间内有定义。)单侧极限同样遵循这些法则,从而得到单侧结论。
∎
定理 3.2多项式和有理函数
每个多项式在 R \R R 上都是连续的。每个有理函数在其定义域内的每个点都是连续的。
证明
这是 模块 2 中直接代入定理的新说法。对于多项式 p p p 和每个数 a , a\mathclose{\text{,}} a , lim x → a p ( x ) = p ( a ) 。 \lim_{x\to a} p(x) = p(a)\mathclose{\text{。}} lim x → a p ( x ) = p ( a ) 。 对于有理函数 p / q p/q p / q 和其定义域中的某个数 a , a\mathclose{\text{,}} a , q ( a ) ≠ 0 , q(a) \ne 0\mathclose{\text{,}} q ( a ) = 0 , 并且 lim x → a p ( x ) / q ( x ) = p ( a ) / q ( a ) 。 \lim_{x\to a} p(x)/q(x) = p(a)/q(a)\mathclose{\text{。}} lim x → a p ( x ) / q ( x ) = p ( a ) / q ( a ) 。 每个陈述都表示极限等于函数值:在 a a a 处连续。
∎
这完成了例3.2:r r r 在除了2和− 1 -1 − 1 以外的所有数处都是连续的。
目录是连续的
定理 3.3标准函数的连续性
这些函数在其定义域内的每个数(在偶次根函数的定义域的端点0处,从右边)都是连续的:
根 x n , \sqrt[n]{x}\mathclose{\text{,}} n x , 对于整数 n ≥ 2 ; n \ge 2\mathclose{\text{;}} n ≥ 2 ;
三角函数 sin x , \sin x\mathclose{\text{,}} sin x , cos x , \cos x\mathclose{\text{,}} cos x , tan x , \tan x\mathclose{\text{,}} tan x , cot x , \cot x\mathclose{\text{,}} cot x , sec x \sec x sec x 和 csc x ; \csc x\mathclose{\text{;}} csc x ;
指数函数 a x , a^x\mathclose{\text{,}} a x , 对于 a > 0 ; a > 0\mathclose{\text{;}} a > 0 ;
对数 log a x , \log_a x\mathclose{\text{,}} log a x , 对于 a > 0 a > 0 a > 0 且 a ≠ 1 ; a \ne 1\mathclose{\text{;}} a = 1 ; 特别是 ln x 。 \ln x\mathclose{\text{。}} ln x 。
这里解释了每个函数族的连续性原因:正弦、余弦和根函数的证明,以及指数和对数函数证明的思路。初次阅读时,您可以信任这个定理。
正弦和余弦。 模块 2 已证明,当 h → 0 h \to 0 h → 0 时 sin h → 0 = sin 0 、 \sin h \to 0 = \sin 0\mathclose{\text{、}} sin h → 0 = sin 0 、 cos h → 1 = cos 0 , \cos h \to 1 = \cos 0\mathclose{\text{,}} cos h → 1 = cos 0 , 所以正弦和余弦在 0 处连续。对于任意其他数 a , a\mathclose{\text{,}} a , 写成 x = a + h , x = a + h\mathclose{\text{,}} x = a + h , 于是当 x → a x \to a x → a 时 h → 0 。 h \to 0\mathclose{\text{。}} h → 0 。 用第 1.4 节 的加法公式和这两个极限,可得
sin ( a + h ) = sin a cos h + cos a sin h → sin a ⋅ 1 + cos a ⋅ 0 = sin a . \begin{aligned} \sin(a + h) &= \sin a\cos h + \cos a\sin h \\ &\to \sin a \cdot 1 + \cos a \cdot 0 = \sin a. \end{aligned} sin ( a + h ) = sin a cos h + cos a sin h → sin a ⋅ 1 + cos a ⋅ 0 = sin a .
用同样的方式 cos ( a + h ) = cos a cos h − sin a sin h → cos a 。 \cos(a + h) = \cos a\cos h - \sin a\sin h \to \cos a\mathclose{\text{。}} cos ( a + h ) = cos a cos h − sin a sin h → cos a 。 因此,正弦和余弦在 R \R R 上连续,其余四个函数,由这两个函数构造的商函数,在分母不为 0 的地方连续(定理 3.1):在其定义域上。
根。 根据模块 2 的根法则,lim x → a x n = a n \lim_{x\to a}\sqrt[n]{x} = \sqrt[n]{a} lim x → a n x = n a 对于每个 a > 0 , a > 0\mathclose{\text{,}} a > 0 , 并且对于每个 a a a 当 n n n 为奇数时。在 0 处,偶次根从右边连续:x n < ε \sqrt[n]{x} < \varepsilon n x < ε 当 0 ≤ x < ε n 0 \le x < \varepsilon^n 0 ≤ x < ε n 时,这即是 ε–δ 条件,其中 δ = ε n 。 \delta = \varepsilon^n\mathclose{\text{。}} δ = ε n 。
指数和对数。 对于无理数 x x x 如 2 , \sqrt2\mathclose{\text{,}} 2 , 模块 1 定义 a x a^x a x 为 a 1.4 , a 1.41 , a 1.414 , … a^{1.4}, a^{1.41}, a^{1.414}, \dots a 1.4 , a 1.41 , a 1.414 , … 趋近于某个数。使这个定义精确化,就显示出 a x a^x a x 是连续的;这属于分析课程的内容,本系列将其作为已知。对数 log a \log_a log a 是 a x a^x a x 的反函数,因此其图像为 a x a^x a x 在直线 y = x y = x y = x (定理 1.2 ) 中的镜像图像,而镜像图像保持连续性。这是分析课程中一个事实的证明思路:严格递增或递减区间上的连续函数的反函数也是连续的 (练习 1.10 )。
要点
由模块 1 中的函数目录,使用 + 、 +\mathclose{\text{、}} + 、 − 、 -\mathclose{\text{、}} − 、 × 、 \times\mathclose{\text{、}} × 、 ÷ \div ÷ 以及复合运算(如下)构造的每一个函数在其定义域内的每一个区间上都是连续的。不连续性只能出现在公式失效的地方(如分母为零、对数为 0)或在分段定义改变表达式的地方。
注意
“在定义域上连续” 不等于 “在整个定义域上连续”。1 / x 1/x 1/ x 和 tan x \tan x tan x 在它们定义域内的每个数处都是连续的,书籍称它们为连续函数;然而它们在 0 和 π / 2 \pi/2 π /2 处有无穷间断点,这些点不在它们的定义域内,图像是断裂的。被问到一个函数在何处连续,应给出区间:1 / x 1/x 1/ x 在 ( − ∞ , 0 ) (-\infty, 0) ( − ∞ , 0 ) 和 ( 0 , ∞ ) (0, \infty) ( 0 , ∞ ) 上连续,但在 [ − 1 , 1 ] [-1, 1] [ − 1 , 1 ] 上不连续。
复合
大多数公式是将一个函数嵌套在另一个函数内部:9 − x 2 , \sqrt{9 - x^2}\mathclose{\text{,}} 9 − x 2 , ln ( 1 + cos x ) , \ln(1 + \cos x)\mathclose{\text{,}} ln ( 1 + cos x ) , e ( sin x ) / x 。 e^{(\sin x)/x}\mathclose{\text{。}} e ( s i n x ) / x 。 只要外层函数是连续的,极限就可以被移到这样的嵌套结构内部。
定理 3.4复合函数的极限
如果 lim x → a g ( x ) = b \lim_{x\to a} g(x) = b lim x → a g ( x ) = b 并且 f f f 在 b b b 处连续,那么
lim x → a f ( g ( x ) ) = f ( b ) = f ( lim x → a g ( x ) ) . \lim_{x\to a} f\big(g(x)\big) = f(b) = f\Big(\lim_{x\to a} g(x)\Big). x → a lim f ( g ( x ) ) = f ( b ) = f ( x → a lim g ( x ) ) .
一阶极限的情况也适用,以及当 x → ∞ x \to \infty x → ∞ 或 x → − ∞ x \to -\infty x → − ∞ 趋近于无穷时的极限(第 3.7 节)。
用文字来说:如果内层函数趋近于 b , b\mathclose{\text{,}} b , 并且外层函数在 b b b 处连续,那么复合函数就趋近于 f ( b ) 。 f(b)\mathclose{\text{。}} f ( b ) 。 证明见下方“深入理解”框中的内容。使用 b = g ( a ) , b = g(a)\mathclose{\text{,}} b = g ( a ) , 该定理给出了复合函数的规则:
定理 3.5复合函数的连续性
如果 g g g 在 a a a 处连续,且 f f f 在 g ( a ) g(a) g ( a ) 处连续,那么 f ∘ g f \circ g f ∘ g 在 a a a 处连续。
证明
由于 g g g 在 a a a 处连续,lim x → a g ( x ) = g ( a ) 。 \lim_{x\to a} g(x) = g(a)\mathclose{\text{。}} lim x → a g ( x ) = g ( a ) 。 由于 f f f 在 g ( a ) g(a) g ( a ) 处连续,定理 3.4 与 b = g ( a ) b = g(a) b = g ( a ) 给出
lim x → a f ( g ( x ) ) = f ( g ( a ) ) , \lim_{x\to a} f\big(g(x)\big) = f\big(g(a)\big), x → a lim f ( g ( x ) ) = f ( g ( a ) ) ,
这说明 f ∘ g f \circ g f ∘ g 在 a a a 处连续。
∎
例如,∣ x ∣ = x 2 , \abs{x} = \sqrt{x^2}\mathclose{\text{,}} ∣ x ∣ = x 2 , 将 x 2 x^2 x 2 与平方根函数的复合函数,在每一个 x ≠ 0 x \ne 0 x = 0 处连续,其中 x 2 > 0 x^2 > 0 x 2 > 0 与平方根函数连续。在 0 处定理不适用,因为平方根函数仅在该点右侧连续;但 lim x → 0 ∣ x ∣ = 0 = ∣ 0 ∣ , \lim_{x\to0}\abs{x} = 0 = \abs{0}\mathclose{\text{,}} lim x → 0 ∣ x ∣ = 0 = ∣ 0 ∣ , 如 例 2.9 所示。因此 ∣ x ∣ \abs{x} ∣ x ∣ 在 R \R R 上连续。
深入一步为什么极限可以进入连续函数
这里是定理 3.4 的证明,使用模块 2 中的 ε–δ 定义。设 ε > 0 。 \varepsilon > 0\mathclose{\text{。}} ε > 0 。 由于 f f f 在 b b b 处连续,存在一个数 η > 0 \eta > 0 η > 0 (η \eta η 是希腊字母 eta)使得
∣ u − b ∣ < η implies ∣ f ( u ) − f ( b ) ∣ < ε . \abs{u - b} < \eta \ \text{implies}\ \abs{f(u) - f(b)} < \varepsilon. ∣ u − b ∣ < η implies ∣ f ( u ) − f ( b ) ∣ < ε .
因为 g ( x ) → b g(x) \to b g ( x ) → b 作为 x → a , x \to a\mathclose{\text{,}} x → a , 应用该极限的定义,以 η \eta η 的角色扮演 ε , \varepsilon\mathclose{\text{,}} ε , 得到一个 δ > 0 , \delta > 0\mathclose{\text{,}} δ > 0 , 使得
0 < ∣ x − a ∣ < δ implies ∣ g ( x ) − b ∣ < η . 0 < \abs{x - a} < \delta \ \text{implies}\ \abs{g(x) - b} < \eta. 0 < ∣ x − a ∣ < δ implies ∣ g ( x ) − b ∣ < η .
连接这两个:如果 0 < ∣ x − a ∣ < δ , 0 < \abs{x - a} < \delta\mathclose{\text{,}} 0 < ∣ x − a ∣ < δ , 则 u = g ( x ) u = g(x) u = g ( x ) 满足 ∣ u − b ∣ < η , \abs{u - b} < \eta\mathclose{\text{,}} ∣ u − b ∣ < η , 所以 ∣ f ( g ( x ) ) − f ( b ) ∣ < ε 。 \abs{f(g(x)) - f(b)} < \varepsilon\mathclose{\text{。}} ∣ f ( g ( x )) − f ( b ) ∣ < ε 。 这就是 lim x → a f ( g ( x ) ) = f ( b ) \lim_{x\to a} f(g(x)) = f(b) lim x → a f ( g ( x )) = f ( b ) 的定义。
f f f 在 b b b 处的连续性,而不仅仅是 f f f 在 b b b 处的极限,是需要的。令 f ( u ) = 0 f(u) = 0 f ( u ) = 0 对于 u ≠ 0 u \ne 0 u = 0 和 f ( 0 ) = 1 , f(0) = 1\mathclose{\text{,}} f ( 0 ) = 1 , 并且令 g ( x ) = 0 g(x) = 0 g ( x ) = 0 对于每个 x 。 x\mathclose{\text{。}} x 。 那么 lim u → 0 f ( u ) = 0 , \lim_{u\to0} f(u) = 0\mathclose{\text{,}} lim u → 0 f ( u ) = 0 , 但是 f ( g ( x ) ) = f ( 0 ) = 1 f(g(x)) = f(0) = 1 f ( g ( x )) = f ( 0 ) = 1 对于每个 x , x\mathclose{\text{,}} x , 所以 lim x → 0 f ( g ( x ) ) = 1 。 \lim_{x\to0} f(g(x)) = 1\mathclose{\text{。}} lim x → 0 f ( g ( x )) = 1 。 证明失败是因为 u = g ( x ) u = g(x) u = g ( x ) 可以等于 b , b\mathclose{\text{,}} b , 而 f f f 在 b b b 处的极限对 f ( b ) f(b) f ( b ) 本身没有任何说明;连续性才有。
例 3.3它在何处连续? ✓ 已检验
找出每个函数在其定义域上的连续区间。
(a) f ( x ) = sin x x 2 + 1 f(x) = \dfrac{\sin x}{x^2 + 1} f ( x ) = x 2 + 1 sin x
(b) g ( x ) = 9 − x 2 g(x) = \sqrt{9 - x^2} g ( x ) = 9 − x 2
(c) h ( x ) = ln ( 1 + cos x ) h(x) = \ln(1 + \cos x) h ( x ) = ln ( 1 + cos x )
(a) sin x \sin x sin x 和 x 2 + 1 x^2 + 1 x 2 + 1 在 R \R R 上连续,且 x 2 + 1 ≥ 1 x^2 + 1 \ge 1 x 2 + 1 ≥ 1 永远不为 0,因此根据商法则 f f f 在 R \R R 上连续。
(b) g g g 是平方根函数 u \sqrt u u 与 u = 9 − x 2 u = 9 - x^2 u = 9 − x 2 的复合,定义域由 9 − x 2 ≥ 0 9 - x^2 \ge 0 9 − x 2 ≥ 0 给出,即 − 3 ≤ x ≤ 3 。 -3 \le x \le 3\mathclose{\text{。}} − 3 ≤ x ≤ 3 。 当 − 3 < x < 3 -3 < x < 3 − 3 < x < 3 时,u u u 为正,且 u \sqrt u u 在任一正的 u u u 处连续,所以由定理 3.5,g g g 在 x x x 处连续。在端点 3,当 x → 3 − x \to 3^- x → 3 − 时,u = 9 − x 2 u = 9 - x^2 u = 9 − x 2 通过正值趋近于 0;当 u → 0 + u \to 0^+ u → 0 + 时 u → 0 , \sqrt u \to 0\mathclose{\text{,}} u → 0 , 所以 g ( x ) → 0 = g ( 3 ) 。 g(x) \to 0 = g(3)\mathclose{\text{。}} g ( x ) → 0 = g ( 3 ) 。 因此 g g g 在 3 处左连续,同理在 − 3 -3 − 3 处右连续,故在 [ − 3 , 3 ] [-3, 3] [ − 3 , 3 ] 上连续。它的图像是圆 x 2 + y 2 = 9 x^2 + y^2 = 9 x 2 + y 2 = 9 的上半部(参见例 1.2 )。
(c) ln u \ln u ln u 在 u > 0 u > 0 u > 0 和 1 + cos x 1 + \cos x 1 + cos x 处连续,因此 h h h 在 1 + cos x > 0 1 + \cos x > 0 1 + cos x > 0 处连续。由于 cos x ≥ − 1 , \cos x \ge -1\mathclose{\text{,}} cos x ≥ − 1 , 1 + cos x ≥ 0 , 1 + \cos x \ge 0\mathclose{\text{,}} 1 + cos x ≥ 0 , 当且仅当 cos x = − 1 \cos x = -1 cos x = − 1 时成立:在 π \pi π 的奇数倍处,x = ± π , ± 3 π , … 。 x = \pm\pi, \pm3\pi, \dots\mathclose{\text{。}} x = ± π , ± 3 π , … 。 因此 h h h 在每一个相邻的 π \pi π 的奇数倍之间的区间上连续:在 ( − π , π ) (-\pi, \pi) ( − π , π ) 上,在 ( π , 3 π ) (\pi, 3\pi) ( π , 3 π ) 上,依此类推。在 π \pi π 的奇数倍处,h h h 未定义,其值趋向于无穷大(第 3.6 节)。
例 3.4连续性求极限 ✓ 已检验
求 (a) lim x → 1 ln x 2 − 1 x − 1 \displaystyle\lim_{x\to 1} \ln\frac{x^2 - 1}{x - 1} x → 1 lim ln x − 1 x 2 − 1 和 (b) lim x → 0 e ( sin x ) / x 。 \displaystyle\lim_{x\to0} e^{(\sin x)/x}\mathclose{\text{。}} x → 0 lim e ( s i n x ) / x 。
(a) 内层函数 g ( x ) = x 2 − 1 x − 1 g(x) = \dfrac{x^2 - 1}{x - 1} g ( x ) = x − 1 x 2 − 1 在 1 处未定义,但对于 x ≠ 1 , x \ne 1\mathclose{\text{,}} x = 1 , 它等于 ( x − 1 ) ( x + 1 ) x − 1 = x + 1 , \dfrac{(x - 1)(x + 1)}{x - 1} = x + 1\mathclose{\text{,}} x − 1 ( x − 1 ) ( x + 1 ) = x + 1 , 因此 lim x → 1 g ( x ) = 2 。 \lim_{x\to1} g(x) = 2\mathclose{\text{。}} lim x → 1 g ( x ) = 2 。 对数函数在 2 处连续,因此根据定理 3.4
lim x → 1 ln x 2 − 1 x − 1 = ln ( lim x → 1 x 2 − 1 x − 1 ) = ln 2 ≈ 0.6931. \begin{aligned} \lim_{x\to 1} \ln\frac{x^2 - 1}{x - 1} &= \ln\Big(\lim_{x\to1}\frac{x^2 - 1}{x - 1}\Big) \\ &= \ln 2 \approx 0.6931. \end{aligned} x → 1 lim ln x − 1 x 2 − 1 = ln ( x → 1 lim x − 1 x 2 − 1 ) = ln 2 ≈ 0.6931.
该定理需要内层极限存在,而不是内层函数连续:此处内层函数在 1 处有一个可去间断点。
(b) 与 x → 0 x \to 0 x → 0 相同,指数 sin x x \dfrac{\sin x}{x} x sin x 趋近于 1(模块 2),且 e u e^u e u 在 1 处连续,因此
lim x → 0 e ( sin x ) / x = e 1 = e ≈ 2.718. \lim_{x\to0} e^{(\sin x)/x} = e^1 = e \approx 2.718. x → 0 lim e ( s i n x ) / x = e 1 = e ≈ 2.718.
注意
一个极限进入函数内部只有在该函数在内部极限处连续时才成立。地板函数在 1 处不连续:如 x → 0 , x \to 0\mathclose{\text{,}} x → 0 , cos x → 1 , \cos x \to 1\mathclose{\text{,}} cos x → 1 , 但对于 0 < ∣ x ∣ < π / 2 , 0 < \abs{x} < \pi/2\mathclose{\text{,}} 0 < ∣ x ∣ < π /2 , 0 < cos x < 1 , 0 < \cos x < 1\mathclose{\text{,}} 0 < cos x < 1 , 所以 ⌊ cos x ⌋ = 0 。 \lfloor\cos x\rfloor = 0\mathclose{\text{。}} ⌊ cos x ⌋ = 0 。 因此 lim x → 0 ⌊ cos x ⌋ = 0 , \lim_{x\to0}\lfloor\cos x\rfloor = 0\mathclose{\text{,}} lim x → 0 ⌊ cos x ⌋ = 0 , 而非 ⌊ 1 ⌋ = 1 。 \lfloor 1\rfloor = 1\mathclose{\text{。}} ⌊ 1 ⌋ = 1 。
从海拔 1200 米的小屋沿山路走到海拔 2100 米的山顶。无论山路如何曲折起伏,总会有某一刻你恰在海拔 1500 米处,因为海拔连续变化,从低于 1500 米到高于 1500 米的途中必会经过这个高度。同理,对于介于 f ( a ) f(a) f ( a ) 与 f ( b ) f(b) f ( b ) 之间的任意高度 N , N\mathclose{\text{,}} N , 相应的水平线必在 a a a 与 b b b 之间某处和连续函数的图像相交(图 3.2)。
图 3.2 中值定理。左:f f f 在 [ a , b ] [a, b] [ a , b ] 上连续,且 N N N 介于 f ( a ) f(a) f ( a ) 和 f ( b ) f(b) f ( b ) 之间,因此直线 y = N y = N y = N 与图像相交,此处相交于三个点 c 1 、 c_1\mathclose{\text{、}} c 1 、 c 2 c_2 c 2 和 c 3 。 c_3\mathclose{\text{。}} c 3 。 右:一个有跳跃间断点的图像可能会跳过高度 N , N\mathclose{\text{,}} N , 此时没有 c c c 满足 f ( c ) = N 。 f(c) = N\mathclose{\text{。}} f ( c ) = N 。
定理 3.6介值定理
假设 f f f 在闭区间 [ a , b ] [a, b] [ a , b ] 上连续,且 N N N 是 f ( a ) f(a) f ( a ) 和 f ( b ) f(b) f ( b ) 之间的任意数,则存在至少一个 c c c 属于 ( a , b ) , (a, b)\mathclose{\text{,}} ( a , b ) , 使得 f ( c ) = N 。 f(c) = N\mathclose{\text{。}} f ( c ) = N 。
你最常使用的形式是关于根的。如果 f f f 在 [ a , b ] [a, b] [ a , b ] 上连续,且 f ( a ) f(a) f ( a ) 和 f ( b ) f(b) f ( b ) 符号相反,则 0 严格介于它们之间,因此方程 f ( x ) = 0 f(x) = 0 f ( x ) = 0 在 ( a , b ) (a, b) ( a , b ) 内有解。
假设是整个闭区间上的连续性,包括端点,且该区间的每一部分都是必需的:
缺少连续性时。 当 x < 0 x < 0 x < 0 时令 f ( x ) = − 1 , f(x) = -1\mathclose{\text{,}} f ( x ) = − 1 , 当 x ≥ 0 x \ge 0 x ≥ 0 时令 f ( x ) = 1 。 f(x) = 1\mathclose{\text{。}} f ( x ) = 1 。 在 [ − 1 , 1 ] [-1, 1] [ − 1 , 1 ] 上有 f ( − 1 ) = − 1 < 0 < 1 = f ( 1 ) , f(-1) = -1 < 0 < 1 = f(1)\mathclose{\text{,}} f ( − 1 ) = − 1 < 0 < 1 = f ( 1 ) , 但 f f f 始终不为 0,因为在 0 处的跳跃越过了 − 1 -1 − 1 与 1 之间的所有值。
没有在端点处连续。 设 g ( 0 ) = − 1 g(0) = -1 g ( 0 ) = − 1 和 g ( x ) = x g(x) = x g ( x ) = x 为 0 < x ≤ 1 。 0 < x \le 1\mathclose{\text{。}} 0 < x ≤ 1 。 则 g g g 在 ( 0 , 1 ] (0, 1] ( 0 , 1 ] 上连续,并且 g ( 0 ) = − 1 < 0 < 1 = g ( 1 ) , g(0) = -1 < 0 < 1 = g(1)\mathclose{\text{,}} g ( 0 ) = − 1 < 0 < 1 = g ( 1 ) , 但 g ( x ) = x g(x) = x g ( x ) = x 对于每个 x x x 在 ( 0 , 1 ] (0, 1] ( 0 , 1 ] 中都是正的: g g g 没有根。罪魁祸首是端点 0,因为在该点 g g g 并不从右边连续,因为 lim x → 0 + g ( x ) = 0 ≠ g ( 0 ) 。 \lim_{x\to0^+} g(x) = 0 \ne g(0)\mathclose{\text{。}} lim x → 0 + g ( x ) = 0 = g ( 0 ) 。
请注意定理并未说明的内容。它保证至少存在一个 c , c\mathclose{\text{,}} c , 而不是恰好一个:在图 3.2 中有三个。它也没有说明 c c c 的位置:这是一个存在性定理。第 3.4 节将其转化为寻找 c c c 的方法。
例 3.5三次方程的根 ✓ 已检验
证明方程 x 3 − 2 x − 5 = 0 x^3 - 2x - 5 = 0 x 3 − 2 x − 5 = 0 在 2 和 3 之间有一个解。
设 f ( x ) = x 3 − 2 x − 5 。 f(x) = x^3 - 2x - 5\mathclose{\text{。}} f ( x ) = x 3 − 2 x − 5 。 它是一个多项式,因此在 [ 2 , 3 ] [2, 3] [ 2 , 3 ] 上连续(定理 3.2)。在区间端点处,
f ( 2 ) = 8 − 4 − 5 = − 1 , f ( 3 ) = 27 − 6 − 5 = 16. \begin{aligned} f(2) &= 8 - 4 - 5 = -1, \\ f(3) &= 27 - 6 - 5 = 16. \end{aligned} f ( 2 ) f ( 3 ) = 8 − 4 − 5 = − 1 , = 27 − 6 − 5 = 16.
由 f ( 2 ) < 0 < f ( 3 ) , f(2) < 0 < f(3)\mathclose{\text{,}} f ( 2 ) < 0 < f ( 3 ) , 将介值定理用于 N = 0 , N = 0\mathclose{\text{,}} N = 0 , 可知在 ( 2 , 3 ) (2, 3) ( 2 , 3 ) 中存在一个数 c , c\mathclose{\text{,}} c , 使得 f ( c ) = 0 。 f(c) = 0\mathclose{\text{。}} f ( c ) = 0 。 该定理只保证解在 ( 2 , 3 ) (2, 3) ( 2 , 3 ) 内。由于 f ( 2 ) = − 1 f(2) = -1 f ( 2 ) = − 1 比 f ( 3 ) = 16 f(3) = 16 f ( 3 ) = 16 更接近 0,可以猜测 c c c 更接近 2。第 3.4 节求出 c ≈ 2.0946 。 c \approx 2.0946\mathclose{\text{。}} c ≈ 2.0946 。
例 3.6
求解 cos x = x \cos x = x cos x = x ✓ 已检验
证明方程 cos x = x \cos x = x cos x = x 有解,并找出一个长度为 1 的区间,该区间包含该解。
cos x = x \cos x = x cos x = x 无法用代数方法直接求解。将它写成 f ( x ) = 0 , f(x) = 0\mathclose{\text{,}} f ( x ) = 0 , 其中 f ( x ) = cos x − x 。 f(x) = \cos x - x\mathclose{\text{。}} f ( x ) = cos x − x 。 作为两个连续函数的差,它在 R \R R 上连续(定理 3.1 和 3.3)。试代入几个值,角度仍用弧度:
f ( 0 ) = cos 0 − 0 = 1 > 0 , f ( 1 ) = cos 1 − 1 ≈ 0.5403 − 1 = − 0.4597 < 0. \begin{aligned} f(0) &= \cos 0 - 0 = 1 > 0, \\ f(1) &= \cos 1 - 1 \approx 0.5403 - 1 \\ &= -0.4597 < 0. \end{aligned} f ( 0 ) f ( 1 ) = cos 0 − 0 = 1 > 0 , = cos 1 − 1 ≈ 0.5403 − 1 = − 0.4597 < 0.
根据中间值定理,方程 cos x − x = 0 \cos x - x = 0 cos x − x = 0 在 ( 0 , 1 ) (0, 1) ( 0 , 1 ) 中有解。这类混合三角函数与多项式的方程在物理和工程中很常见,且没有解析解;第 3.4 节找出该解,约为 0.739。
注意
在使用定理之前,请先检查整个区间上的连续性。 tan x \tan x tan x 在 [ π / 4 , 3 π / 4 ] [\pi/4, 3\pi/4] [ π /4 , 3 π /4 ] 上符号发生变化,从 tan ( π / 4 ) = 1 \tan(\pi/4) = 1 tan ( π /4 ) = 1 变到 tan ( 3 π / 4 ) = − 1 , \tan(3\pi/4) = -1\mathclose{\text{,}} tan ( 3 π /4 ) = − 1 , 但它在那里没有零点(它的零点是 π \pi π 的倍数)。它的图像并未穿过轴线;它在渐近线 x = π / 2 x = \pi/2 x = π /2 处从 + ∞ +\infty + ∞ 跳跃到 − ∞ , -\infty\mathclose{\text{,}} − ∞ , 在那里 tan x \tan x tan x 不连续。
深入一步为什么中间值定理成立
一次初步阅读可以跳过这个证明。它将实数的一个性质作为公理,并由此证明其余性质。
假设 f f f 在 [ a , b ] [a, b] [ a , b ] 上连续,且 f ( a ) < N < f ( b ) 。 f(a) < N < f(b)\mathclose{\text{。}} f ( a ) < N < f ( b ) 。 (若 f ( a ) > N > f ( b ) , f(a) > N > f(b)\mathclose{\text{,}} f ( a ) > N > f ( b ) , 可将同样的论证用于 − f -f − f 和 − N 。) -N\mathclose{\text{。)}} − N 。) 把 [ a , b ] [a, b] [ a , b ] 二等分。如果 f f f 在中点取值 N , N\mathclose{\text{,}} N , 这个中点就是所求的 c 。 c\mathclose{\text{。}} c 。 否则保留其中一半,使 f f f 在该半区间的左端点低于 N , N\mathclose{\text{,}} N , 在右端点高于它。重复这一过程。或者某个中点恰好给出值 N , N\mathclose{\text{,}} N , 或者得到区间列 [ a n , b n ] , [a_n, b_n]\mathclose{\text{,}} [ a n , b n ] , 每个区间长度都是前一个的一半,对于每个 n n n 有 f ( a n ) < N < f ( b n ) 。 f(a_n) < N < f(b_n)\mathclose{\text{。}} f ( a n ) < N < f ( b n ) 。 这就是下一节的二分法,只是用 N N N 代替 0。
左端点 a 0 ≤ a 1 ≤ a 2 ≤ ⋯ a_0 \le a_1 \le a_2 \le \cdots a 0 ≤ a 1 ≤ a 2 ≤ ⋯ 永远不减少,右端点 b 0 ≥ b 1 ≥ b 2 ≥ ⋯ b_0 \ge b_1 \ge b_2 \ge \cdots b 0 ≥ b 1 ≥ b 2 ≥ ⋯ 永远不增加,且宽度 b n − a n = ( b − a ) / 2 n b_n - a_n = (b - a)/2^n b n − a n = ( b − a ) / 2 n 趋近于 0。此处的证明需要实数的 完备性 :数轴上没有间隙,因此每个区间 c c c 都存在一个数 a n ≤ c ≤ b n , a_n \le c \le b_n\mathclose{\text{,}} a n ≤ c ≤ b n , 对于每一个 n n n 都成立。这是公理。(模块 14 将其作为单调收敛定理陈述:一个永不减少且始终低于固定上界的序列都有极限。此处 c c c 是 a n a_n a n 的极限。)
仍有待证明 f ( c ) = N 。 f(c) = N\mathclose{\text{。}} f ( c ) = N 。 假设不成立,并挑战 f f f 在 c c c 处的连续性,用 ε = ∣ f ( c ) − N ∣ 。 \varepsilon = \abs{f(c) - N}\mathclose{\text{。}} ε = ∣ f ( c ) − N ∣ 。 存在一个 δ > 0 , \delta > 0\mathclose{\text{,}} δ > 0 , 使得 ∣ f ( x ) − f ( c ) ∣ < ε \abs{f(x) - f(c)} < \varepsilon ∣ f ( x ) − f ( c ) ∣ < ε 对于每个 x x x 在 [ a , b ] [a, b] [ a , b ] 中满足 ∣ x − c ∣ < δ : \abs{x - c} < \delta\mathclose{\text{:}} ∣ x − c ∣ < δ : 所有这些 f ( x ) f(x) f ( x ) 都比 N N N 更接近 f ( c ) , f(c)\mathclose{\text{,}} f ( c ) , 因此它们位于 N N N 的同一侧,与 f ( c ) f(c) f ( c ) 一致。取 n n n 足够大,使得 b n − a n < δ 。 b_n - a_n < \delta\mathclose{\text{。}} b n − a n < δ 。 由于 c c c 位于 [ a n , b n ] [a_n, b_n] [ a n , b n ] 中,两端都在 c c c 的 δ \delta δ 范围内,因此 f ( a n ) f(a_n) f ( a n ) 和 f ( b n ) f(b_n) f ( b n ) 位于 N N N 的同一侧。但是 f ( a n ) < N < f ( b n ) 。 f(a_n) < N < f(b_n)\mathclose{\text{。}} f ( a n ) < N < f ( b n ) 。 因此 f ( c ) = N 。 f(c) = N\mathclose{\text{。}} f ( c ) = N 。 最后,c c c 既不是 a a a 也不是 b , b\mathclose{\text{,}} b , 因为 f ( a ) ≠ N ≠ f ( b ) 。 f(a) \ne N \ne f(b)\mathclose{\text{。}} f ( a ) = N = f ( b ) 。
完备性至关重要。仅在有理数范围内,该定理是不成立的:x 2 − 2 x^2 - 2 x 2 − 2 在 1 处为负,在 2 处为正,但不存在有理数 c c c 满足 c 2 = 2 , c^2 = 2\mathclose{\text{,}} c 2 = 2 , 因为 2 \sqrt2 2 是无理数;区间 [ a n , b n ] [a_n, b_n] [ a n , b n ] 逐渐逼近那个间隙,其中 2 \sqrt2 2 应该存在。实分析课程要么构建实数并证明完备性,要么将其作为公理,如这里所示。
中间值定理说明 x 3 − 2 x − 5 x^3 - 2x - 5 x 3 − 2 x − 5 在 ( 2 , 3 ) (2, 3) ( 2 , 3 ) 内有一个根,但具体位置不确定。二分法 通过反复应用该定理来找到这个根:将区间一分为二,并保留符号发生变化的那一半。
定义 3.4二分法
设 f f f 在 [ a , b ] [a, b] [ a , b ] 上连续,且 f ( a ) f(a) f ( a ) 与 f ( b ) f(b) f ( b ) 符号相反。以 括号 [ a 0 , b 0 ] = [ a , b ] [a_0, b_0] = [a, b] [ a 0 , b 0 ] = [ a , b ] 作为初始区间。对于 n = 0 , 1 , 2 , … : n = 0, 1, 2, \dots\mathclose{\text{:}} n = 0 , 1 , 2 , … :
计算中点 m n = a n + b n 2 m_n = \dfrac{a_n + b_n}{2} m n = 2 a n + b n 和函数值 f ( m n ) 。 f(m_n)\mathclose{\text{。}} f ( m n ) 。
如果 f ( m n ) = 0 , f(m_n) = 0\mathclose{\text{,}} f ( m n ) = 0 , 停止:m n m_n m n 是一个根。
如果 f ( m n ) f(m_n) f ( m n ) 与 f ( a n ) f(a_n) f ( a n ) 符号相同,新的括号是 [ a n + 1 , b n + 1 ] = [ m n , b n ] ; [a_{n+1}, b_{n+1}] = [m_n, b_n]\mathclose{\text{;}} [ a n + 1 , b n + 1 ] = [ m n , b n ] ; 否则是 [ a n + 1 , b n + 1 ] = [ a n , m n ] 。 [a_{n+1}, b_{n+1}] = [a_n, m_n]\mathclose{\text{。}} [ a n + 1 , b n + 1 ] = [ a n , m n ] 。
停止当括号的宽度达到你所需精度。
将 a n a_n a n 读作 “a sub n”。步骤 3 总是保持一个区间,其中 f f f 的两端符号相反,因此,根据中间值定理,每个区间包含一个根(图 3.3)。
图 3.3 对 f ( x ) = x 2 − 2 f(x) = x^2 - 2 f ( x ) = x 2 − 2 使用二分法,从 [ 1 , 2 ] [1, 2] [ 1 , 2 ] 开始,其中 f ( 1 ) = − 1 < 0 < 2 = f ( 2 ) 。 f(1) = -1 < 0 < 2 = f(2)\mathclose{\text{。}} f ( 1 ) = − 1 < 0 < 2 = f ( 2 ) 。 每个区间 [ a n , b n ] [a_n, b_n] [ a n , b n ] 是其上一个区间的半个:即 f f f 符号发生变化的那一半。每个区间包含根 2 \sqrt2 2 (虚线),并且经过六步后,区间 [ 1.40625 , 1.421875 ] [1.40625, 1.421875] [ 1.40625 , 1.421875 ] 的宽度为 1 / 64 。 1/64\mathclose{\text{。}} 1/64 。
例 3.7
用二分法计算 2 \sqrt2 2 ✓ 已检验
在 f ( x ) = x 2 − 2 f(x) = x^2 - 2 f ( x ) = x 2 − 2 上使用二分法,从 [ 1 , 2 ] [1, 2] [ 1 , 2 ] 开始,以确定 2 , \sqrt2\mathclose{\text{,}} 2 , 即 f f f 的正根。进行六步计算。
f f f 是连续的并且 f ( 1 ) = − 1 < 0 < 2 = f ( 2 ) , f(1) = -1 < 0 < 2 = f(2)\mathclose{\text{,}} f ( 1 ) = − 1 < 0 < 2 = f ( 2 ) , 因此方法可以开始。对于 n = 0 , n = 0\mathclose{\text{,}} n = 0 , m 0 = 1.5 m_0 = 1.5 m 0 = 1.5 和 f ( 1.5 ) = 2.25 − 2 = 0.25 , f(1.5) = 2.25 - 2 = 0.25\mathclose{\text{,}} f ( 1.5 ) = 2.25 − 2 = 0.25 , 正数像 f ( b 0 ) : f(b_0)\mathclose{\text{:}} f ( b 0 ) : 根位于左半部分,[ a 1 , b 1 ] = [ 1 , 1.5 ] 。 [a_1, b_1] = [1, 1.5]\mathclose{\text{。}} [ a 1 , b 1 ] = [ 1 , 1.5 ] 。 对于 n = 1 , n = 1\mathclose{\text{,}} n = 1 , m 1 = 1.25 m_1 = 1.25 m 1 = 1.25 和 f ( 1.25 ) = 1.5625 − 2 = − 0.4375 , f(1.25) = 1.5625 - 2 = -0.4375\mathclose{\text{,}} f ( 1.25 ) = 1.5625 − 2 = − 0.4375 , 负数像 f ( a 1 ) : f(a_1)\mathclose{\text{:}} f ( a 1 ) : 根位于右半部分,[ a 2 , b 2 ] = [ 1.25 , 1.5 ] 。 [a_2, b_2] = [1.25, 1.5]\mathclose{\text{。}} [ a 2 , b 2 ] = [ 1.25 , 1.5 ] 。 继续以相同的方式进行,将 f ( m n ) f(m_n) f ( m n ) 四舍五入到四位有效数字:
n n n
a n a_n a n
b n b_n b n
m n m_n m n
f ( m n ) f(m_n) f ( m n )
0
1
2
1.5
0.25
1
1
1.5
1.25
−0.4375
2
1.25
1.5
1.375
−0.1094
3
1.375
1.5
1.4375
0.06641
4
1.375
1.4375
1.40625
−0.02246
5
1.40625
1.4375
1.421875
0.02173
6
1.40625
1.421875
1.4140625
−0.0004272
经过六步后,根位于 [ a 6 , b 6 ] = [ 1.40625 , 1.421875 ] , [a_6, b_6] = [1.40625, 1.421875]\mathclose{\text{,}} [ a 6 , b 6 ] = [ 1.40625 , 1.421875 ] , 一个宽度为 1 64 = 0.015625 \tfrac{1}{64} = 0.015625 64 1 = 0.015625 的区间内。两个端点都开始于 1.4,因此 2 = 1.4 … \sqrt2 = 1.4\ldots 2 = 1.4 … 是确定的;第二位小数尚未确定,因为端点开始于 1.40 和 1.42。中点 m 6 = 1.4140625 m_6 = 1.4140625 m 6 = 1.4140625 位于 2 \sqrt2 2 的一半宽度内,1 128 = 0.0078125 。 \tfrac{1}{128} = 0.0078125\mathclose{\text{。}} 128 1 = 0.0078125 。 实际上 2 = 1.41421356 … , \sqrt2 = 1.41421356\ldots\mathclose{\text{,}} 2 = 1.41421356 … , 因此 m 6 m_6 m 6 的误差仅约为 0.00015:这是最坏情况下的保证。
表中的 f ( m n ) f(m_n) f ( m n ) 值是四舍五入的,但方法所使用的符号,全部都是精确的。
定理 3.7二分法的误差
设 f f f 在 [ a , b ] [a, b] [ a , b ] 上连续,且 f ( a ) f(a) f ( a ) 和 f ( b ) f(b) f ( b ) 符号相反。如果二分法尚未在精确根处停止,则经过 n n n 步后,区间 [ a n , b n ] [a_n, b_n] [ a n , b n ] 包含 f f f 的一个根 r , r\mathclose{\text{,}} r , 并且
b n − a n = b − a 2 n , ∣ m n − r ∣ ≤ b − a 2 n + 1 . b_n - a_n = \frac{b - a}{2^n}, \quad \abs{m_n - r} \le \frac{b - a}{2^{n+1}}. b n − a n = 2 n b − a , ∣ m n − r ∣ ≤ 2 n + 1 b − a .
证明
方法的第 3 步保持一半的区间,该区间两端的 f f f 符号相反:如果 f ( m n ) f(m_n) f ( m n ) 与 f ( a n ) f(a_n) f ( a n ) 符号相同,则其与 f ( b n ) f(b_n) f ( b n ) 符号相反,新的区间是 [ m n , b n ] ; [m_n, b_n]\mathclose{\text{;}} [ m n , b n ] ; 否则 f ( m n ) , f(m_n)\mathclose{\text{,}} f ( m n ) , 其不为 0,与 f ( a n ) f(a_n) f ( a n ) 符号相反,新的区间是 [ a n , m n ] 。 [a_n, m_n]\mathclose{\text{。}} [ a n , m n ] 。 因此,对于每一个 n , n\mathclose{\text{,}} n , f ( a n ) f(a_n) f ( a n ) 和 f ( b n ) f(b_n) f ( b n ) 符号相反。由于 f f f 在 [ a n , b n ] [a_n, b_n] [ a n , b n ] 上连续,且 [ a , b ] [a, b] [ a , b ] 是其一部分,中间值定理给出 r r r 在 ( a n , b n ) (a_n, b_n) ( a n , b n ) 中。每一步将区间宽度减半,因此经过 n n n 步后,宽度为 ( b − a ) / 2 n 。 (b - a)/2^n\mathclose{\text{。}} ( b − a ) / 2 n 。 最后,一个区间中点距离该区间内所有点的距离不超过该区间宽度的一半,特别是距离 r 。 r\mathclose{\text{。}} r 。
∣ m n − r ∣ ≤ 1 2 ⋅ b − a 2 n = b − a 2 n + 1 . \abs{m_n - r} \le \frac12\cdot\frac{b - a}{2^n} = \frac{b - a}{2^{n+1}}. ∣ m n − r ∣ ≤ 2 1 ⋅ 2 n b − a = 2 n + 1 b − a .
∎
因此,二分法具有大多数数值方法所缺乏的保证:你事先就知道需要多少步才能达到所需的精度。为了得到 ∣ m n − r ∣ ≤ ε , \abs{m_n - r} \le \varepsilon\mathclose{\text{,}} ∣ m n − r ∣ ≤ ε , 只需要 ( b − a ) / 2 n + 1 ≤ ε , (b - a)/2^{n+1} \le \varepsilon\mathclose{\text{,}} ( b − a ) / 2 n + 1 ≤ ε , 也就是说,
2 n + 1 ≥ b − a ε . 2^{n+1} \ge \frac{b - a}{\varepsilon}. 2 n + 1 ≥ ε b − a .
例 3.8需要多少步? ✓ 已检验
从 [ 1 , 2 ] [1, 2] [ 1 , 2 ] 开始进行多少次二分法步骤,才能保证中点 m n m_n m n 与 2 \sqrt2 2 之间的距离不超过 10 − 6 ? 10^{-6}\mathclose{\text{?}} 1 0 − 6 ?
这里 b − a = 1 , b - a = 1\mathclose{\text{,}} b − a = 1 , 因此条件是 2 n + 1 ≥ 10 6 。 2^{n+1} \ge 10^6\mathclose{\text{。}} 2 n + 1 ≥ 1 0 6 。 由于 2 19 = 524,288 2^{19} = 524{,}288 2 19 = 524 , 288 太小而 2 20 = 1,048,576 2^{20} = 1{,}048{,}576 2 20 = 1 , 048 , 576 足够大,n + 1 = 20 : n + 1 = 20\mathclose{\text{:}} n + 1 = 20 : 经过 n = 19 n = 19 n = 19 步后,m 19 m_{19} m 19 与 2 \sqrt2 2 之间的距离不超过 2 − 20 ≈ 9.5 × 10 − 7 。 2^{-20} \approx 9.5 \times 10^{-7}\mathclose{\text{。}} 2 − 20 ≈ 9.5 × 1 0 − 7 。 用对数表示,n + 1 ≥ log 2 10 6 ≈ 19.93 。 n + 1 \ge \log_2 10^6 \approx 19.93\mathclose{\text{。}} n + 1 ≥ log 2 1 0 6 ≈ 19.93 。
每一步增加一个二进制位。由于 2 10 = 1024 ≈ 10 3 , 2^{10} = 1024 \approx 10^3\mathclose{\text{,}} 2 10 = 1024 ≈ 1 0 3 , 十步大约增加三个十进制位,因此每个十进制位大约需要 3.3 3.3 3.3 步。二分法是在数轴上的二分查找,计数方式与 第1.4节 :在一个包含一百万项的有序列表中进行二分查找需要大约20步,原因相同。
优缺点。 二分法在其假设成立时总是有效,并且有误差保证。 但其收敛速度较慢,每一步仅增加一个二进制位的精度,无论函数如何;牛顿法(模块 7)通常每一步将正确数字的数量翻倍,尽管它有时会失败。 二分法需要符号变化,因此无法找到函数图像接触轴而不穿过轴的根,如 ( x − 1 ) 2 (x - 1)^2 ( x − 1 ) 2 在 1 处的情况;并且当一个区间包含多个根时,它只能找到其中一个。
注意
二分法需要连续性,正如其定理所要求的那样。在 [ 1 , 2 ] , [1, 2]\mathclose{\text{,}} [ 1 , 2 ] , f ( x ) = tan x f(x) = \tan x f ( x ) = tan x 包含 f ( 1 ) ≈ 1.557 > 0 f(1) \approx 1.557 > 0 f ( 1 ) ≈ 1.557 > 0 和 f ( 2 ) ≈ − 2.185 < 0 , f(2) \approx -2.185 < 0\mathclose{\text{,}} f ( 2 ) ≈ − 2.185 < 0 , 并且二分法收敛到 1.5708 … = π / 2 , 1.5708\ldots = \pi/2\mathclose{\text{,}} 1.5708 … = π /2 , 即渐近线,而 tan x \tan x tan x 在那里根本没有根。警告信号出现在值 f ( m n ) f(m_n) f ( m n ) 中:它们并没有趋向于 0,而是从 f ( m 0 ) ≈ 14.1 f(m_0) \approx 14.1 f ( m 0 ) ≈ 14.1 增长到 f ( m 3 ) ≈ 120.5 f(m_3) \approx 120.5 f ( m 3 ) ≈ 120.5 和 f ( m 6 ) ≈ 2067 。 f(m_6) \approx 2067\mathclose{\text{。}} f ( m 6 ) ≈ 2067 。 请在下面的控件中尝试一下。
动手计算Python 中的二分法
该方法在 Python 中只需几行代码。此函数运行 n 步并返回最终的括号,或者如果遇到精确根 m,则返回该对 (m, m):
Python 复制
def bisection (f, a, b, n):
"""n steps of the bisection method on [a, b]; returns the last bracket."""
if f (a) * f (b) >= 0 :
raise ValueError ("f(a) and f(b) must have opposite signs" )
for _ in range (n):
m = (a + b) / 2
if f (m) == 0 :
return m, m # an exact root
if (f (m) > 0 ) == (f (a) > 0 ): # same sign as f(a): keep [m, b]
a = m
else : # otherwise keep [a, m]
b = m
return a, b
print (bisection (lambda x: x**2 - 2 , 1 , 2 , 6 ))
这是例 3.7 中的夹逼区间 [ a 6 , b 6 ] 。 [a_6, b_6]\mathclose{\text{。}} [ a 6 , b 6 ] 。 根据例 3.8,19 步可使 2 \sqrt2 2 精确到 10 − 6 ; 10^{-6}\mathclose{\text{;}} 1 0 − 6 ; 将中点的实际误差与保证值 2 − 20 2^{-20} 2 − 20 进行比较:
Python 复制
import math
a, b = bisection (lambda x: x**2 - 2 , 1 , 2 , 19 )
m = (a + b) / 2
print (m, abs (m - math.sqrt (2 )), 2 **-20 )
输出
1.4142141342163086 5.718432134482754e-07 9.5367431640625e-07
实际误差小于保证值,这通常如此。同样的函数满足例3.5和3.6中的方程,x 3 − 2 x − 5 = 0 x^3 - 2x - 5 = 0 x 3 − 2 x − 5 = 0 和 cos x = x 。 \cos x = x\mathclose{\text{。}} cos x = x 。 从宽度为1的区间出发,经过30步后,每个中点都与根的距离在 2 − 31 ≈ 4.7 × 10 − 10 2^{-31} \approx 4.7 \times 10^{-10} 2 − 31 ≈ 4.7 × 1 0 − 10 以内:
Python 复制
a, b = bisection (lambda x: x**3 - 2 *x - 5 , 2 , 3 , 30 )
print ((a + b) / 2 )
a, b = bisection (lambda x: math.cos (x) - x, 0 , 1 , 30 )
print ((a + b) / 2 )
输出
2.094551481772214
0.7390851336531341
没有符号变化时,该方法拒绝开始。( x − 1 ) 2 (x - 1)^2 ( x − 1 ) 2 在1处有一个根,但在两侧都是正的:
Python 故意出错的例子
bisection (lambda x: (x - 1 )**2 , 0 , 3 , 10 )
错误
ValueError: f(a) and f(b) must have opposite signs
最后,浮点数(模块2)设定了一个限制。在1和2之间,它们之间的距离为 2 − 52 ≈ 2.2 × 10 − 16 , 2^{-52} \approx 2.2 \times 10^{-16}\mathclose{\text{,}} 2 − 52 ≈ 2.2 × 1 0 − 16 , 因此从 [ 1 , 2 ] [1, 2] [ 1 , 2 ] 出发经过52步后,括号的两端成为相邻的浮点数,进一步的步骤不会改变结果:
Python 复制
a, b = bisection (lambda x: x**2 - 2 , 1 , 2 , 60 )
print (a, b, b - a)
输出
1.414213562373095 1.4142135623730951 2.220446049250313e-16
一整天,从午夜到午夜,室外温度有一个最高值和一个最低值,每个值在一天中的某个时刻达到。这并不是关于天气的事实:它适用于任何在闭区间上的连续函数。
定义 3.5最大值和最小值
设 f f f 在一个区间 I I I 上定义。对于 c c c 中的某个 I , I\mathclose{\text{,}} I , 数 f ( c ) f(c) f ( c ) 是 f f f 在 I I I 上的 最大值 ,如果对于 x x x 中的每一个 I , I\mathclose{\text{,}} I , 都有 f ( x ) ≤ f ( c ) 。 f(x) \le f(c)\mathclose{\text{。}} f ( x ) ≤ f ( c ) 。 对于 d d d 中的某个 I , I\mathclose{\text{,}} I , 数 f ( d ) f(d) f ( d ) 是 f f f 在 I I I 上的 最小值 ,如果对于 x x x 中的每一个 I , I\mathclose{\text{,}} I , 都有 f ( x ) ≥ f ( d ) 。 f(x) \ge f(d)\mathclose{\text{。}} f ( x ) ≥ f ( d ) 。 它们合起来是 f f f 在 I I I 上的 极值 。
最大值必须是 f f f 实际取到的数 f ( c ) 。 f(c)\mathclose{\text{。}} f ( c ) 。 函数值只能趋近的数不能算作最大值。模块 8 将这里的最大值和最小值称为全局最大值和全局最小值,并用导数来求它们。
定理 3.8极值定理
如果 f f f 在一个闭区间 [ a , b ] [a, b] [ a , b ] 上连续,那么 f f f 在 [ a , b ] [a, b] [ a , b ] 上有最大值和最小值:存在 c c c 和 d d d 在 [ a , b ] [a, b] [ a , b ] 中,使得对于 x x x 中的每一个 [ a , b ] , [a, b]\mathclose{\text{,}} [ a , b ] ,
f ( d ) ≤ f ( x ) ≤ f ( c ) . f(d) \le f(x) \le f(c). f ( d ) ≤ f ( x ) ≤ f ( c ) .
该定理的证明同样依赖于实数的完备性,但其证明过程比中间值定理的证明更为复杂;它属于实分析课程的内容,而本系列将直接使用该定理而不进行证明。你现在可以理解为何每个假设都是必要的(图3.4):
闭区间。 f ( x ) = x f(x) = x f ( x ) = x 在开区间 ( 0 , 1 ) (0, 1) ( 0 , 1 ) 上连续,但在此区间内没有最大值:对于任意 x x x 在 ( 0 , 1 ) (0, 1) ( 0 , 1 ) 内,数 x + 1 2 \tfrac{x + 1}{2} 2 x + 1 也在 ( 0 , 1 ) (0, 1) ( 0 , 1 ) 内,并且更大。函数值趋近于 1,但达到 1 的端点却缺失。同样地,也没有最小值。
连续性。 在 [ 0 , 1 ] [0, 1] [ 0 , 1 ] 上,设 f ( x ) = x f(x) = x f ( x ) = x 对于 0 ≤ x < 1 0 \le x < 1 0 ≤ x < 1 和 f ( 1 ) = 0 。 f(1) = 0\mathclose{\text{。}} f ( 1 ) = 0 。 同样地,函数值趋近于 1 但未达到 1:在 1 处,f f f 从左侧不连续,函数值骤降至 0。这个 f f f 有最小值 0,但没有最大值。
一个有界的区间。[ 0 , ∞ ) [0, \infty) [ 0 , ∞ ) 包含它的左端点但没有右端点,因此不是一个闭区间 [ a , b ] 。 [a, b]\mathclose{\text{。}} [ a , b ] 。 在该区间上,f ( x ) = x x + 1 = 1 − 1 x + 1 f(x) = \dfrac{x}{x + 1} = 1 - \dfrac{1}{x + 1} f ( x ) = x + 1 x = 1 − x + 1 1 是连续的,并且随着 x x x 的增加而增加,逐渐接近 1(第 3.7 节)但并未达到。每一个值都会被后面的值所超越:没有最大值。
图 3.4 极值定理。左:f ( x ) = x 2 − 4 x + 1 f(x) = x^2 - 4x + 1 f ( x ) = x 2 − 4 x + 1 在闭区间 [ 0 , 3 ] [0, 3] [ 0 , 3 ] 上连续,并达到最大值 1(在 0 处)和最小值 − 3 -3 − 3 (在 2 处),如例 3.9 所示。中间:x x x 在开区间 ( 0 , 1 ) (0, 1) ( 0 , 1 ) 上既没有最大值也没有最小值;空心点表示缺失的端点。右:f ( x ) = x f(x) = x f ( x ) = x 对于 0 ≤ x < 1 0 \le x < 1 0 ≤ x < 1 和 f ( 1 ) = 0 f(1) = 0 f ( 1 ) = 0 在 1 处不连续,其值趋近于 1 但并未达到。
该定理说明极值存在,但不保证在以下位置存在:在区间的端点,如图 3.4 中的最大值,或在区间内部,如最小值。在最优化中,它保证存在最佳选择:一个依赖于连续设置的成本函数,在每个设置的闭区间内都有一个最便宜的设置。模块 8 展示了如何找到它。
例 3.9该定理适用吗? ✓ 已检验
判断极值定理是否保证存在最大值和最小值,并找出你能够找到的这些值。
(a) f ( x ) = x 2 − 4 x + 1 f(x) = x^2 - 4x + 1 f ( x ) = x 2 − 4 x + 1 on [ 0 , 3 ] [0, 3] [ 0 , 3 ]
(b) g ( x ) = 1 x − 1 g(x) = \dfrac{1}{x - 1} g ( x ) = x − 1 1 on [ 2 , 4 ] [2, 4] [ 2 , 4 ]
(c) 同一个 g g g 在 [ 0 , 2 ] [0, 2] [ 0 , 2 ] 上
(a) f f f 是一个多项式,在闭区间 [ 0 , 3 ] [0, 3] [ 0 , 3 ] 上连续,因此定理保证两者都存在。为了找到它们,完成平方: f ( x ) = ( x − 2 ) 2 − 3 。 f(x) = (x - 2)^2 - 3\mathclose{\text{。}} f ( x ) = ( x − 2 ) 2 − 3 。 由于 ( x − 2 ) 2 ≥ 0 , (x - 2)^2 \ge 0\mathclose{\text{,}} ( x − 2 ) 2 ≥ 0 , 仅在 x = 2 x = 2 x = 2 处取等号,因此最小值是 f ( 2 ) = − 3 。 f(2) = -3\mathclose{\text{。}} f ( 2 ) = − 3 。 在 [ 0 , 3 ] [0, 3] [ 0 , 3 ] 上,( x − 2 ) 2 (x - 2)^2 ( x − 2 ) 2 最大值出现在 x x x 最远离 2 的点,即 x = 0 , x = 0\mathclose{\text{,}} x = 0 , 因此最大值是 f ( 0 ) = 1 。 f(0) = 1\mathclose{\text{。}} f ( 0 ) = 1 。 (在另一端,f ( 3 ) = − 2 。) f(3) = -2\mathclose{\text{。)}} f ( 3 ) = − 2 。)
(b) g g g 在 x ≠ 1 x \ne 1 x = 1 处连续,在特别是在闭区间 [ 2 , 4 ] [2, 4] [ 2 , 4 ] 上连续,因此定理适用。随着 x x x 增加,x − 1 x - 1 x − 1 增加而 1 x − 1 \dfrac{1}{x - 1} x − 1 1 减少,因此最大值是 g ( 2 ) = 1 , g(2) = 1\mathclose{\text{,}} g ( 2 ) = 1 , 最小值是 g ( 4 ) = 1 3 。 g(4) = \tfrac13\mathclose{\text{。}} g ( 4 ) = 3 1 。
(c) g g g 在 1 处无定义,而 1 属于 [ 0 , 2 ] , [0, 2]\mathclose{\text{,}} [ 0 , 2 ] , 所以 g g g 在 [ 0 , 2 ] [0, 2] [ 0 , 2 ] 上不连续,定理不适用。事实上,g g g 在那里没有极值:当 x x x 从右趋近于 1 时,1 x − 1 \dfrac{1}{x - 1} x − 1 1 会超过任何拟定的最大值;从左趋近时会低于任何拟定的最小值。
注意
两张纸条。"f f f 在 ( 0 , 1 ) (0, 1) ( 0 , 1 ) 上连续,因此有最大值"是错误的,如 f ( x ) = x f(x) = x f ( x ) = x 所示:定理需要一个闭区间 [ a , b ] 。 [a, b]\mathclose{\text{。}} [ a , b ] 。 当假设条件不成立时,定理对结果不做任何保证:在开区间 ( − 1 , 2 ) (-1, 2) ( − 1 , 2 ) 上,x 2 x^2 x 2 的最小值为 0,但没有最大值。
模块 1 指出 1 / x 1/x 1/ x 的值在 0 附近“变得很大”,“右边为正,左边为负”,并承诺本模块将研究这种行为。以下是 1 / x 1/x 1/ x 和 1 / x 2 1/x^2 1/ x 2 的数值:
x x x 1 x \dfrac{1}{x} x 1 1 x 2 \dfrac{1}{x^2} x 2 1 − 0.1 -0.1 − 0.1 − 10 -10 − 10 100 100 100 − 0.01 -0.01 − 0.01 − 100 -100 − 100 10000 10000 10000 − 0.001 -0.001 − 0.001 − 1000 -1000 − 1000 1 × 10 6 1\times10^{6} 1 × 1 0 6 0.001 0.001 0.001 1000 1000 1000 1 × 10 6 1\times10^{6} 1 × 1 0 6 0.01 0.01 0.01 100 100 100 10000 10000 10000 0.1 0.1 0.1 10 10 10 100 100 100
当 x x x 从任一侧趋近于 0 时,1 / x 2 1/x^2 1/ x 2 会超过 100,10,000,一百万,以及你选择的任何界限 M , M\mathclose{\text{,}} M , 并且保持在该界限之上。模块 2 显示,没有任何数是它的极限;但是极限以如此确定的方式不存在,以至于它拥有自己的符号表示。
定义 3.6无限极限与垂直渐近线
设 f f f 在包含 a a a 的开区间上定义,除了可能在 a a a 本身处。那么
lim x → a f ( x ) = ∞ , \lim_{x\to a} f(x) = \infty, x → a lim f ( x ) = ∞ ,
读作“f f f 在 x x x 处当 x x x 趋近于 a a a 时的极限是无穷大”,意味着无论你选择什么数 M , M\mathclose{\text{,}} M , f ( x ) > M f(x) > M f ( x ) > M 对于足够接近 a a a 的每一个 x ≠ a x \ne a x = a (接近程度取决于 M )。 M\mathclose{\text{)。}} M )。 同样 lim x → a f ( x ) = − ∞ \lim_{x\to a} f(x) = -\infty lim x → a f ( x ) = − ∞ 表示,无论你选择什么数 M , M\mathclose{\text{,}} M , f ( x ) < M f(x) < M f ( x ) < M 对于足够接近 a a a 的每一个 x ≠ a 。 x \ne a\mathclose{\text{。}} x = a 。 单侧无穷极限,如 lim x → a + f ( x ) = ∞ , \lim_{x\to a^+} f(x) = \infty\mathclose{\text{,}} lim x → a + f ( x ) = ∞ , 只考虑 x x x 在 a a a 一侧的情况。
直线 x = a x = a x = a 是 f f f 图像的 垂直渐近线 ,如果 lim x → a − f ( x ) \lim_{x\to a^-} f(x) lim x → a − f ( x ) 和 lim x → a + f ( x ) \lim_{x\to a^+} f(x) lim x → a + f ( x ) 至少有一个单侧极限是 ∞ \infty ∞ 或 − ∞ 。 -\infty\mathclose{\text{。}} − ∞ 。
所以 lim x → 0 1 / x 2 = ∞ 。 \lim_{x\to0} 1/x^2 = \infty\mathclose{\text{。}} lim x → 0 1/ x 2 = ∞ 。 对于 1 / x 1/x 1/ x 两侧不一致,
lim x → 0 + 1 x = ∞ , lim x → 0 − 1 x = − ∞ , \lim_{x\to0^+}\frac1x = \infty, \qquad \lim_{x\to0^-}\frac1x = -\infty, x → 0 + lim x 1 = ∞ , x → 0 − lim x 1 = − ∞ ,
并且 1 / x 1/x 1/ x 在 0 处没有极限,甚至没有无穷大的极限。两个图像都有垂直渐近线 x = 0 : x = 0\mathclose{\text{:}} x = 0 : 在接近该渐近线时,图像沿着直线向上或向下无限延伸。写作 lim f ( x ) = ∞ \lim f(x) = \infty lim f ( x ) = ∞ 并不使 ∞ \infty ∞ 成为一个数。极限仍然不存在;这种记号记录了极限失败的方式。
大多数垂直渐近线来自于一个分式,其分母趋于 0 而分子不趋于 0。一个非零数除以一个极小的数会得到一个极大的数,而符号决定这个极大数是正无穷还是负无穷:
定理 3.9非零除以零
假设 lim x → a + f ( x ) = L \lim_{x\to a^+} f(x) = L lim x → a + f ( x ) = L 是一个具有 L ≠ 0 L \ne 0 L = 0 的数,以及 lim x → a + g ( x ) = 0 。 \lim_{x\to a^+} g(x) = 0\mathclose{\text{。}} lim x → a + g ( x ) = 0 。 如果 g ( x ) > 0 g(x) > 0 g ( x ) > 0 对于某个区间 ( a , a + δ ) (a, a + \delta) ( a , a + δ ) 内的每一个 x , x\mathclose{\text{,}} x , 则
lim x → a + f ( x ) g ( x ) = ∞ if L > 0 , lim x → a + f ( x ) g ( x ) = − ∞ if L < 0. \begin{aligned} \lim_{x\to a^+}\frac{f(x)}{g(x)} &= \infty \quad \text{if } L > 0, \\ \lim_{x\to a^+}\frac{f(x)}{g(x)} &= -\infty \quad \text{if } L < 0. \end{aligned} x → a + lim g ( x ) f ( x ) x → a + lim g ( x ) f ( x ) = ∞ if L > 0 , = − ∞ if L < 0.
如果相反 g ( x ) < 0 g(x) < 0 g ( x ) < 0 在这样的一个区间内,两个符号会交换。对于左侧极限和双边极限也是如此。
证明
取 L > 0 L > 0 L > 0 和 g ( x ) > 0 ; g(x) > 0\mathclose{\text{;}} g ( x ) > 0 ; 其他情况类似。由于 f ( x ) → L , f(x) \to L\mathclose{\text{,}} f ( x ) → L , 对于 x x x 足够接近 a a a (且大于 a ) a\mathclose{\text{)}} a ) f ( x ) f(x) f ( x ) 在 L 2 \tfrac{L}{2} 2 L 内 L , L\mathclose{\text{,}} L , 因此 f ( x ) > L 2 。 f(x) > \tfrac{L}{2}\mathclose{\text{。}} f ( x ) > 2 L 。 现在令 M > 0 M > 0 M > 0 为任意数。由于 g ( x ) → 0 g(x) \to 0 g ( x ) → 0 通过正数,对于 x x x 足够接近 a a a 时 0 < g ( x ) < L 2 M 0 < g(x) < \tfrac{L}{2M} 0 < g ( x ) < 2 M L 也成立。对于这样的 x , x\mathclose{\text{,}} x , 两者都成立,并且
f ( x ) g ( x ) > L / 2 L / ( 2 M ) = M . \frac{f(x)}{g(x)} > \frac{L/2}{L/(2M)} = M. g ( x ) f ( x ) > L / ( 2 M ) L /2 = M .
所以 f ( x ) / g ( x ) f(x)/g(x) f ( x ) / g ( x ) 在 x x x 足够接近 a a a 时会超过每一个 M : M\mathclose{\text{:}} M : 它的极限是 ∞ 。 \infty\mathclose{\text{。}} ∞ 。
∎
例 3.10单侧无穷极限 ✓ 已检验
求下列函数在指定点的单侧极限和垂直渐近线:(a) r ( x ) = x 2 − 4 x 2 − x − 2 r(x) = \dfrac{x^2 - 4}{x^2 - x - 2} r ( x ) = x 2 − x − 2 x 2 − 4 在 − 1 ; -1\mathclose{\text{;}} − 1 ; (b) ln x \ln x ln x 在 0;(称) tan x \tan x tan x 在 π / 2 。 \pi/2\mathclose{\text{。}} π /2 。
(a) 对于 x x x 接近 − 1 -1 − 1 (以及 x ≠ − 1 ), x \ne -1\mathclose{\text{),}} x = − 1 ), r ( x ) = x + 2 x + 1 r(x) = \dfrac{x + 2}{x + 1} r ( x ) = x + 1 x + 2 (例 3.2)。分子趋于 1,为正数,分母趋于 0。对于 x x x 略大于 − 1 , -1\mathclose{\text{,}} − 1 , x + 1 > 0 ; x + 1 > 0\mathclose{\text{;}} x + 1 > 0 ; 对于 x x x 略小于,x + 1 < 0 。 x + 1 < 0\mathclose{\text{。}} x + 1 < 0 。 根据定理 3.9,
lim x → − 1 + r ( x ) = ∞ , lim x → − 1 − r ( x ) = − ∞ , \begin{aligned} \lim_{x\to-1^+} r(x) &= \infty, \\ \lim_{x\to-1^-} r(x) &= -\infty, \end{aligned} x → − 1 + lim r ( x ) x → − 1 − lim r ( x ) = ∞ , = − ∞ ,
且直线 x = − 1 x = -1 x = − 1 是垂直渐近线。分母的另一个零点 2 并不产生渐近线:在该点极限为 4 3 \tfrac43 3 4 (例 3.2),且图像在该点有一个空点。
(b) ln x \ln x ln x 仅在 x > 0 x > 0 x > 0 时有定义,因此只有右侧极限有意义。由于 ln \ln ln 是递增的且 ln e − M = − M , \ln e^{-M} = -M\mathclose{\text{,}} ln e − M = − M , ln x \ln x ln x 小于 − M -M − M 恰好当 0 < x < e − M 。 0 < x < e^{-M}\mathclose{\text{。}} 0 < x < e − M 。 因此,ln x \ln x ln x 一旦 − M -M − M 足够接近 0,就会低于任何数 x : x\mathclose{\text{:}} x :
lim x → 0 + ln x = − ∞ , \lim_{x\to0^+}\ln x = -\infty, x → 0 + lim ln x = − ∞ ,
且 y y y 轴是 y = ln x y = \ln x y = ln x 的垂直渐近线,如 图 1.3 所示。
(c) 当 x → π / 2 x \to \pi/2 x → π /2 时,有 sin x → 1 \sin x \to 1 sin x → 1 与 cos x → 0 。 \cos x \to 0\mathclose{\text{。}} cos x → 0 。 从单位圆可知,当 x x x 略小于 π / 2 \pi/2 π /2 时,cos x \cos x cos x 为正;当 x x x 略大于该角时,它为负。根据定理 3.9,
lim x → π / 2 − tan x = ∞ , lim x → π / 2 + tan x = − ∞ , \begin{aligned} \lim_{x\to\pi/2^-}\tan x &= \infty, \\ \lim_{x\to\pi/2^+}\tan x &= -\infty, \end{aligned} x → π / 2 − lim tan x x → π / 2 + lim tan x = ∞ , = − ∞ ,
所以 x = π / 2 x = \pi/2 x = π /2 是 y = tan x y = \tan x y = tan x 的垂直渐近线,同样,每一条 x = π / 2 + k π x = \pi/2 + k\pi x = π /2 + k π 都是,因为 tan \tan tan 的周期是 π 。 \pi\mathclose{\text{。}} π 。
注意
∞ \infty ∞ 不是一个数,因此不能用它进行计算。如果 f ( x ) → ∞ f(x) \to \infty f ( x ) → ∞ 和 g ( x ) → ∞ , g(x) \to \infty\mathclose{\text{,}} g ( x ) → ∞ , 那么 f ( x ) − g ( x ) f(x) - g(x) f ( x ) − g ( x ) 可以做任何事情。当 x → 0 x \to 0 x → 0 趋于无穷时, 1 x 2 + 1 \dfrac{1}{x^2} + 1 x 2 1 + 1 和 1 x 2 \dfrac{1}{x^2} x 2 1 都趋于 ∞ , \infty\mathclose{\text{,}} ∞ , 它们的差为 1; 2 x 2 \dfrac{2}{x^2} x 2 2 和 1 x 2 \dfrac{1}{x^2} x 2 1 都趋于 ∞ , \infty\mathclose{\text{,}} ∞ , 它们的差 1 x 2 \dfrac{1}{x^2} x 2 1 趋于 ∞ , \infty\mathclose{\text{,}} ∞ , 它们的商为 2。因此,“∞ − ∞ = 0 ” \infty - \infty = 0\mathclose{\text{”}} ∞ − ∞ = 0 ” 和“∞ / ∞ = 1 ” \infty/\infty = 1\mathclose{\text{”}} ∞/∞ = 1 ” 是错误的。这种形式是 不定形式 :它们的值取决于函数,模块 7 展示了如何求解。并且不要写 lim x → 0 1 / x = ∞ : \lim_{x\to0} 1/x = \infty\mathclose{\text{:}} lim x → 0 1/ x = ∞ : 两边不一致。
现在让 x x x 而不是 f ( x ) f(x) f ( x ) 趋向于无穷大。这里是例 3.2 中的函数 r , r\mathclose{\text{,}} r , 远离原点时的情形:
x x x r ( x ) = x 2 − 4 x 2 − x − 2 r(x) = \dfrac{x^2 - 4}{x^2 - x - 2} r ( x ) = x 2 − x − 2 x 2 − 4 − 1000 -1000 − 1000 0.998999 0.998999 0.998999 − 100 -100 − 100 0.989899 0.989899 0.989899 − 10 -10 − 10 0.888889 0.888889 0.888889 10 10 10 1.09091 1.09091 1.09091 100 100 100 1.00990 1.00990 1.00990 1000 1000 1000 1.00100 1.00100 1.00100
当 x x x 增大,无论是正还是负,r ( x ) r(x) r ( x ) 都趋于 1:对于非常大的正 x , x\mathclose{\text{,}} x , 从上方趋近;对于非常大的负 x , x\mathclose{\text{,}} x , 从下方趋近。被约去的形式说明了这一点:对于 x ≠ 2 x \ne 2 x = 2 和 x ≠ − 1 , x \ne -1\mathclose{\text{,}} x = − 1 ,
r ( x ) = x + 2 x + 1 = 1 + 1 x + 1 , r(x) = \frac{x + 2}{x + 1} = 1 + \frac{1}{x + 1}, r ( x ) = x + 1 x + 2 = 1 + x + 1 1 ,
而 1 x + 1 \dfrac{1}{x + 1} x + 1 1 随着 x x x 的增大趋向于 0。当 x > − 1 x > -1 x > − 1 为正时,它为正;当 x < − 1 x < -1 x < − 1 为负时,它为负,这解释了为何 r ( x ) r(x) r ( x ) 在右侧从上方趋近 1,在左侧从下方趋近 1。
定义 3.7无穷远处的极限与水平渐近线
设 f f f 在区间 ( c , ∞ ) (c, \infty) ( c , ∞ ) 上定义,则
lim x → ∞ f ( x ) = L , \lim_{x\to\infty} f(x) = L, x → ∞ lim f ( x ) = L ,
当 x x x 趋于无穷大时,f f f 的 x x x 的极限是 L , L\mathclose{\text{,}} L , 这意味着通过取 x x x 足够大,f ( x ) f(x) f ( x ) 可以任意接近 L 。 L\mathclose{\text{。}} L 。 对于在区间 ( − ∞ , c ) (-\infty, c) ( − ∞ , c ) 上定义的 f , f\mathclose{\text{,}} f , lim x → − ∞ f ( x ) = L \lim_{x\to-\infty} f(x) = L lim x → − ∞ f ( x ) = L 的含义相同,只是 x x x 是足够大的负数。线 y = L y = L y = L 是 f f f 图像的 水平渐近线 ,如果 lim x → ∞ f ( x ) = L \lim_{x\to\infty} f(x) = L lim x → ∞ f ( x ) = L 或 lim x → − ∞ f ( x ) = L 。 \lim_{x\to-\infty} f(x) = L\mathclose{\text{。}} lim x → − ∞ f ( x ) = L 。
同样地,lim x → ∞ f ( x ) = ∞ \lim_{x\to\infty} f(x) = \infty lim x → ∞ f ( x ) = ∞ 表示,无论你选择什么数 M , M\mathclose{\text{,}} M , 对于足够大的 x , x\mathclose{\text{,}} x , f ( x ) > M f(x) > M f ( x ) > M 都成立;对于 − ∞ -\infty − ∞ 也是如此。
因此,线 y = 1 y = 1 y = 1 是 r r r 在两端的水平渐近线(图 3.5)。极限法则、夹逼定理和定理 3.4 对于无穷大的极限同样成立,证明方法相同。
所有内容都基于一个基本极限:对于每一个 p > 0 , p > 0\mathclose{\text{,}} p > 0 ,
lim x → ∞ 1 x p = 0. \lim_{x\to\infty}\frac{1}{x^p} = 0. x → ∞ lim x p 1 = 0.
确实,对于 x > 0 , x > 0\mathclose{\text{,}} x > 0 , 1 x p < ε \dfrac{1}{x^p} < \varepsilon x p 1 < ε 恰好当 x p > 1 ε , x^p > \dfrac{1}{\varepsilon}\mathclose{\text{,}} x p > ε 1 , 即当 x > ε − 1 / p ; x > \varepsilon^{-1/p}\mathclose{\text{;}} x > ε − 1/ p ; 因此,对于足够大的 x , x\mathclose{\text{,}} x , 1 / x p 1/x^p 1/ x p 在 0 的 ε \varepsilon ε 范围内。对于整数 k ≥ 1 , k \ge 1\mathclose{\text{,}} k ≥ 1 , 也 1 / x k → 0 1/x^k \to 0 1/ x k → 0 如 x → − ∞ , x \to -\infty\mathclose{\text{,}} x → − ∞ , 因为 ∣ 1 / x k ∣ = 1 / ∣ x ∣ k 。 \abs{1/x^k} = 1/\abs{x}^k\mathclose{\text{。}} 1/ x k = 1/ ∣ x ∣ k 。
有理函数
为了求有理函数在无穷远处的极限,将分子和分母都除以分母中最高次幂的 x ; x\mathclose{\text{;}} x ; 然后,分母中还留有 x x x 的每一项都趋于 0。只有主导项起作用:
定理 3.10有理函数在无穷远处
设
f ( x ) = a m x m + ⋯ + a 1 x + a 0 b n x n + ⋯ + b 1 x + b 0 , f(x) = \frac{a_m x^m + \dots + a_1x + a_0}{b_n x^n + \dots + b_1x + b_0}, f ( x ) = b n x n + ⋯ + b 1 x + b 0 a m x m + ⋯ + a 1 x + a 0 ,
用 a m ≠ 0 a_m \ne 0 a m = 0 和 b n ≠ 0 , b_n \ne 0\mathclose{\text{,}} b n = 0 , 使得分子的次数为 m , m\mathclose{\text{,}} m , 分母的次数为 n 。 n\mathclose{\text{。}} n 。 当 x → ∞ x \to \infty x → ∞ 趋于无穷时,以及当 x → − ∞ x \to -\infty x → − ∞ 趋于无穷时, f ( x ) f(x) f ( x ) 的行为类似于主导项的比值 a m x m b n x n : \dfrac{a_m x^m}{b_n x^n}\mathclose{\text{:}} b n x n a m x m :
如果 m < n , m < n\mathclose{\text{,}} m < n , 则 f ( x ) → 0 , f(x) \to 0\mathclose{\text{,}} f ( x ) → 0 , 且 x x x 轴是一条水平渐近线;
如果 m = n , m = n\mathclose{\text{,}} m = n , 则 f ( x ) → a m b n , f(x) \to \dfrac{a_m}{b_n}\mathclose{\text{,}} f ( x ) → b n a m , 且直线 y = a m b n y = \dfrac{a_m}{b_n} y = b n a m 是一条水平渐近线;
如果 m > n , m > n\mathclose{\text{,}} m > n , 则 f ( x ) → ∞ f(x) \to \infty f ( x ) → ∞ 或 − ∞ , -\infty\mathclose{\text{,}} − ∞ , 符号由 a m b n x m − n \dfrac{a_m}{b_n}x^{m-n} b n a m x m − n 决定,且不存在水平渐近线。
证明
将 x ≠ 0 x \ne 0 x = 0 的分子和分母中的首项提出来:
f ( x ) = a m x m b n x n ⋅ Q ( x ) , where Q ( x ) = 1 + c 1 / x + ⋯ + c m / x m 1 + d 1 / x + ⋯ + d n / x n \begin{aligned} f(x) &= \frac{a_m x^m}{b_n x^n} \cdot Q(x), \quad\text{where} \\ Q(x) &= \frac{1 + c_1/x + \dots + c_m/x^m}{1 + d_1/x + \dots + d_n/x^n} \end{aligned} f ( x ) Q ( x ) = b n x n a m x m ⋅ Q ( x ) , where = 1 + d 1 / x + ⋯ + d n / x n 1 + c 1 / x + ⋯ + c m / x m
并且 c k = a m − k / a m c_k = a_{m-k}/a_m c k = a m − k / a m 和 d k = b n − k / b n d_k = b_{n-k}/b_n d k = b n − k / b n 是常数。如 x → ± ∞ x \to \pm\infty x → ± ∞ 所示,每一项 c k / x k c_k/x^k c k / x k 和 d k / x k d_k/x^k d k / x k 都趋于 0,因此 Q ( x ) Q(x) Q ( x ) 趋于 1 + 0 + ⋯ + 0 1 + 0 + ⋯ + 0 = 1 。 \dfrac{1 + 0 + \dots + 0}{1 + 0 + \dots + 0} = 1\mathclose{\text{。}} 1 + 0 + ⋯ + 0 1 + 0 + ⋯ + 0 = 1 。 第一个分数等于 a m b n x m − n : \dfrac{a_m}{b_n}x^{m-n}\mathclose{\text{:}} b n a m x m − n : 如果 m < n , m < n\mathclose{\text{,}} m < n , 它趋于 0;如果 a m b n , \dfrac{a_m}{b_n}\mathclose{\text{,}} b n a m , 它是常数 m = n ; m = n\mathclose{\text{;}} m = n ; 如果 m > n , m > n\mathclose{\text{,}} m > n , 它趋于 ∞ \infty ∞ 或 − ∞ 。 -\infty\mathclose{\text{。}} − ∞ 。 在最后一种情况中,一个无界增长的因子与一个趋于 1 的因子的乘积也会无界增长,且符号相同。
∎
例 3.11有理函数在无穷远处 ✓ 已检验
求
(a) lim x → ∞ 6 x 3 − 5 x + 1 2 x 3 + x 2 \displaystyle\lim_{x\to\infty}\frac{6x^3 - 5x + 1}{2x^3 + x^2} x → ∞ lim 2 x 3 + x 2 6 x 3 − 5 x + 1
(b) lim x → − ∞ 4 x − 7 x 2 + 1 \displaystyle\lim_{x\to-\infty}\frac{4x - 7}{x^2 + 1} x → − ∞ lim x 2 + 1 4 x − 7
(c) lim x → − ∞ x 3 − 2 3 x 2 + 5 \displaystyle\lim_{x\to-\infty}\frac{x^3 - 2}{3x^2 + 5} x → − ∞ lim 3 x 2 + 5 x 3 − 2
(a) 次数相等,分别为 3 和 3。将分子和分母都除以 x 3 : x^3\mathclose{\text{:}} x 3 :
6 x 3 − 5 x + 1 2 x 3 + x 2 = 6 − 5 / x 2 + 1 / x 3 2 + 1 / x → 6 − 0 + 0 2 + 0 = 3. \begin{aligned} \frac{6x^3 - 5x + 1}{2x^3 + x^2} &= \frac{6 - 5/x^2 + 1/x^3}{2 + 1/x} \\ &\to \frac{6 - 0 + 0}{2 + 0} = 3. \end{aligned} 2 x 3 + x 2 6 x 3 − 5 x + 1 = 2 + 1/ x 6 − 5/ x 2 + 1/ x 3 → 2 + 0 6 − 0 + 0 = 3.
直线 y = 3 y = 3 y = 3 是水平渐近线,正如定理 3.10 所预测的:3 = 6 / 2 , 3 = 6/2\mathclose{\text{,}} 3 = 6/2 , 即首项系数的比值。
(b) 分子次数为 1,分母次数为 2:除以 x 2 : x^2\mathclose{\text{:}} x 2 :
4 x − 7 x 2 + 1 = 4 / x − 7 / x 2 1 + 1 / x 2 → 0 − 0 1 + 0 = 0. \frac{4x - 7}{x^2 + 1} = \frac{4/x - 7/x^2}{1 + 1/x^2} \to \frac{0 - 0}{1 + 0} = 0. x 2 + 1 4 x − 7 = 1 + 1/ x 2 4/ x − 7/ x 2 → 1 + 0 0 − 0 = 0.
x x x 轴是水平渐近线(在两端都成立,因为相同的计算适用于 x → ∞ )。 x \to \infty\mathclose{\text{)。}} x → ∞ )。
(c) 三次多项式除以二次多项式。最高次项的比值是 x 3 3 x 2 = x 3 , \dfrac{x^3}{3x^2} = \dfrac{x}{3}\mathclose{\text{,}} 3 x 2 x 3 = 3 x , 当 x → − ∞ x \to -\infty x → − ∞ 时趋于 − ∞ 。 -\infty\mathclose{\text{。}} − ∞ 。 因此,根据定理 3.10,
lim x → − ∞ x 3 − 2 3 x 2 + 5 = − ∞ , \lim_{x\to-\infty}\frac{x^3 - 2}{3x^2 + 5} = -\infty, x → − ∞ lim 3 x 2 + 5 x 3 − 2 = − ∞ ,
并且左侧没有水平渐近线(同样右侧也没有,因为极限是 ∞ )。 \infty\mathclose{\text{)。}} ∞ )。
根需要一个额外的概念:x 2 = ∣ x ∣ , \sqrt{x^2} = \abs{x}\mathclose{\text{,}} x 2 = ∣ x ∣ , 而不是x x x (小节 1.4 ) 的陷阱),对于x < 0 , x < 0\mathclose{\text{,}} x < 0 , ∣ x ∣ = − x 。 \abs{x} = -x\mathclose{\text{。}} ∣ x ∣ = − x 。
例 3.12两个不同的水平渐近线 ✓ 已检验
求 f ( x ) = 4 x 2 + 1 x − 3 f(x) = \dfrac{\sqrt{4x^2 + 1}}{x - 3} f ( x ) = x − 3 4 x 2 + 1 的水平渐近线。
根号下的主导项是 4 x 2 , 4x^2\mathclose{\text{,}} 4 x 2 , 因此将 x 2 x^2 x 2 提出根号:对于 x ≠ 0 , x \ne 0\mathclose{\text{,}} x = 0 ,
4 x 2 + 1 = x 2 ( 4 + 1 x 2 ) = ∣ x ∣ 4 + 1 x 2 . \begin{aligned} \sqrt{4x^2 + 1} &= \sqrt{x^2\Big(4 + \frac{1}{x^2}\Big)} \\ &= \abs{x}\sqrt{4 + \frac{1}{x^2}}. \end{aligned} 4 x 2 + 1 = x 2 ( 4 + x 2 1 ) = ∣ x ∣ 4 + x 2 1 .
对于 x > 3 , x > 3\mathclose{\text{,}} x > 3 , ∣ x ∣ = x ; \abs{x} = x\mathclose{\text{;}} ∣ x ∣ = x ; 将分子和分母都除以 x 。 x\mathclose{\text{。}} x 。 当 x → ∞ x \to \infty x → ∞ 时,
f ( x ) = 4 + 1 / x 2 1 − 3 / x → 4 1 = 2 , f(x) = \frac{\sqrt{4 + 1/x^2}}{1 - 3/x} \to \frac{\sqrt4}{1} = 2, f ( x ) = 1 − 3/ x 4 + 1/ x 2 → 1 4 = 2 ,
利用平方根在 4 处的连续性(定理 3.4)。对于 x < 0 , x < 0\mathclose{\text{,}} x < 0 , ∣ x ∣ = − x , \abs{x} = -x\mathclose{\text{,}} ∣ x ∣ = − x , 并且
f ( x ) = − x 4 + 1 / x 2 x − 3 = − 4 + 1 / x 2 1 − 3 / x , \begin{aligned} f(x) &= \frac{-x\sqrt{4 + 1/x^2}}{x - 3} \\ &= -\frac{\sqrt{4 + 1/x^2}}{1 - 3/x}, \end{aligned} f ( x ) = x − 3 − x 4 + 1/ x 2 = − 1 − 3/ x 4 + 1/ x 2 ,
这个表达式趋向于 − 4 / 1 = − 2 -\sqrt4/1 = -2 − 4 /1 = − 2 作为 x → − ∞ 。 x \to -\infty\mathclose{\text{。}} x → − ∞ 。 因此,该图像有两个水平渐近线:y = 2 y = 2 y = 2 在右侧,y = − 2 y = -2 y = − 2 在左侧。忽略 ∣ x ∣ \abs{x} ∣ x ∣ 的符号会导致左侧错误地得到答案 2。(此外,根据定理 3.9,还有垂直渐近线 x = 3 : x = 3\mathclose{\text{:}} x = 3 : 分子在该点趋向于 37 ≠ 0 。) \sqrt{37} \ne 0\mathclose{\text{。)}} 37 = 0 。)
指数函数、对数函数和振荡
指数函数。 设 a > 1 , a > 1\mathclose{\text{,}} a > 1 , 并写 a = 1 + q a = 1 + q a = 1 + q 为 q > 0 。 q > 0\mathclose{\text{。}} q > 0 。 则 a n = ( 1 + q ) n ≥ 1 + n q a^n = (1 + q)^n \ge 1 + nq a n = ( 1 + q ) n ≥ 1 + n q 对于每一个整数 n ≥ 1 n \ge 1 n ≥ 1 都成立。这是一个等式对于 n = 1 ; n = 1\mathclose{\text{;}} n = 1 ; 如果它对于某个 n n n 成立,两边同时乘以正数 1 + q 1 + q 1 + q 就表明它对于 n + 1 n + 1 n + 1 也成立:
( 1 + q ) n + 1 ≥ ( 1 + n q ) ( 1 + q ) = 1 + ( n + 1 ) q + n q 2 ≥ 1 + ( n + 1 ) q . \begin{aligned} (1 + q)^{n+1} &\ge (1 + nq)(1 + q) \\ &= 1 + (n + 1)q + nq^2 \\ &\ge 1 + (n + 1)q. \end{aligned} ( 1 + q ) n + 1 ≥ ( 1 + n q ) ( 1 + q ) = 1 + ( n + 1 ) q + n q 2 ≥ 1 + ( n + 1 ) q .
因此它对于 n = 2 n = 2 n = 2 成立,接着对于 n = 3 n = 3 n = 3 成立,以此类推对于每一个 n n n 都成立。因此 a n a^n a n 超过任何数 M M M 一旦 n > M / q , n > M/q\mathclose{\text{,}} n > M / q , 并且由于 a x a^x a x 随着 x x x 增加,对于每一个 a > 1 a > 1 a > 1
lim x → ∞ a x = ∞ , lim x → − ∞ a x = lim x → − ∞ 1 a − x = 0. \begin{aligned} \lim_{x\to\infty} a^x &= \infty, \\ \lim_{x\to-\infty} a^x &= \lim_{x\to-\infty}\frac{1}{a^{-x}} = 0. \end{aligned} x → ∞ lim a x x → − ∞ lim a x = ∞ , = x → − ∞ lim a − x 1 = 0.
对于 0 < a < 1 , 0 < a < 1\mathclose{\text{,}} 0 < a < 1 , 两个极限的顺序被交换了。特别是 e x → ∞ e^x \to \infty e x → ∞ 当 x → ∞ x \to \infty x → ∞ 趋于无穷时,e x → 0 e^x \to 0 e x → 0 趋于无穷时,x → − ∞ : x \to -\infty\mathclose{\text{:}} x → − ∞ : x x x 轴是 y = e x y = e^x y = e x 在左侧的水平渐近线,如 图 1.3 ] 所示。
对数。 ln x \ln x ln x 也会无界增长,但速度缓慢:当 x > e M x > e^M x > e M 时,正好等于 ln x > M , \ln x > M\mathclose{\text{,}} ln x > M , 因此 ln x → ∞ \ln x \to \infty ln x → ∞ 随着 x → ∞ x \to \infty x → ∞ 增长,但要超过 100, x x x 必须超过 e 100 ≈ 2.7 × 10 43 。 e^{100} \approx 2.7 \times 10^{43}\mathclose{\text{。}} e 100 ≈ 2.7 × 1 0 43 。
振荡。 当 sin x \sin x sin x 趋于无穷时,x → ∞ x \to \infty x → ∞ 没有极限:它在 − 1 -1 − 1 和 1 之间持续摆动。但 sin x x → 0 , \dfrac{\sin x}{x} \to 0\mathclose{\text{,}} x sin x → 0 , 根据夹逼定理:对于 x > 0 , x > 0\mathclose{\text{,}} x > 0 ,
− 1 x ≤ sin x x ≤ 1 x , -\frac1x \le \frac{\sin x}{x} \le \frac1x, − x 1 ≤ x sin x ≤ x 1 ,
且两个上界都趋于 0。同样地 e − x sin x → 0 , e^{-x}\sin x \to 0\mathclose{\text{,}} e − x sin x → 0 , 被 − e − x -e^{-x} − e − x 和 e − x e^{-x} e − x 夹逼:一种衰减振荡,如同拨动的弦的振动或开关断开后电路中的电流,最终趋于 0。
注意
一个图可以跨越其水平渐近线,甚至无限次:sin x x \dfrac{\sin x}{x} x sin x 在每一个非零倍数的 π \pi π 处都是 0。渐近线描述的是图在远处的行为;它并不是一条图永远无法触及的线。
斜渐近线
当分子的次数比分母的次数恰好大 1 时,一个有理函数会无界增长,但方向是确定的:它的图会趋近于一条斜线。
定义 3.8斜渐近线
线 y = m x + c , y = mx + c\mathclose{\text{,}} y = m x + c , 具有 m ≠ 0 , m \ne 0\mathclose{\text{,}} m = 0 , 是函数 f f f 图像的 斜渐近线 (或称斜渐或斜线渐近线),如果
lim x → ∞ [ f ( x ) − ( m x + c ) ] = 0 or lim x → − ∞ [ f ( x ) − ( m x + c ) ] = 0. \begin{aligned} \lim_{x\to\infty}\big[f(x) - (mx + c)\big] &= 0 \quad\text{or} \\ \lim_{x\to-\infty}\big[f(x) - (mx + c)\big] &= 0. \end{aligned} x → ∞ lim [ f ( x ) − ( m x + c ) ] x → − ∞ lim [ f ( x ) − ( m x + c ) ] = 0 or = 0.
括号中的值是图与该直线之间的垂直距离,且该距离趋于 0。对于一个分子次数比分母次数大 1 的有理函数 p / q , p/q\mathclose{\text{,}} p / q , 进行除法运算:p ( x ) = q ( x ) ( m x + c ) + s ( x ) , p(x) = q(x)(mx + c) + s(x)\mathclose{\text{,}} p ( x ) = q ( x ) ( m x + c ) + s ( x ) , 余数 s s s 的次数低于 q q q (即使用学校代数中的多项式长除法,或下例中提到的技巧)。然后
p ( x ) q ( x ) = m x + c + s ( x ) q ( x ) , \frac{p(x)}{q(x)} = mx + c + \frac{s(x)}{q(x)}, q ( x ) p ( x ) = m x + c + q ( x ) s ( x ) ,
且 s ( x ) q ( x ) → 0 \dfrac{s(x)}{q(x)} \to 0 q ( x ) s ( x ) → 0 当 x → ± ∞ x \to \pm\infty x → ± ∞ 时,根据定理 3.10,所以 y = m x + c y = mx + c y = m x + c 在两端都是斜渐近线。
例 3.13斜渐近线 ✓ 已检验
求 f ( x ) = x 2 + 1 x − 1 f(x) = \dfrac{x^2 + 1}{x - 1} f ( x ) = x − 1 x 2 + 1 的渐近线,并确定图像在每条渐近线的哪一侧。
将 x 2 + 1 x^2 + 1 x 2 + 1 除以 x − 1 。 x - 1\mathclose{\text{。}} x − 1 。 这里有一个技巧可以避免长除法:x 2 + 1 = ( x 2 − 1 ) + 2 = ( x − 1 ) ( x + 1 ) + 2 。 x^2 + 1 = (x^2 - 1) + 2 = (x - 1)(x + 1) + 2\mathclose{\text{。}} x 2 + 1 = ( x 2 − 1 ) + 2 = ( x − 1 ) ( x + 1 ) + 2 。 因此,对于 x ≠ 1 , x \ne 1\mathclose{\text{,}} x = 1 ,
f ( x ) = x + 1 + 2 x − 1 . f(x) = x + 1 + \frac{2}{x - 1}. f ( x ) = x + 1 + x − 1 2 .
当 x → ± ∞ , x \to \pm\infty\mathclose{\text{,}} x → ± ∞ , 2 x − 1 → 0 , \dfrac{2}{x - 1} \to 0\mathclose{\text{,}} x − 1 2 → 0 , 所以 y = x + 1 y = x + 1 y = x + 1 是在两端的斜渐近线。对于 x > 1 , x > 1\mathclose{\text{,}} x > 1 , 2 x − 1 > 0 , \dfrac{2}{x - 1} > 0\mathclose{\text{,}} x − 1 2 > 0 , 所以图像位于渐近线之上;对于 x < 1 , x < 1\mathclose{\text{,}} x < 1 , 图像位于渐近线之下。在 x = 1 x = 1 x = 1 处,分子是 2 ≠ 0 , 2 \ne 0\mathclose{\text{,}} 2 = 0 , 分母趋于 0,右侧为正,左侧为负,因此根据定理 3.9
lim x → 1 + f ( x ) = ∞ , lim x → 1 − f ( x ) = − ∞ , \lim_{x\to1^+} f(x) = \infty, \qquad \lim_{x\to1^-} f(x) = -\infty, x → 1 + lim f ( x ) = ∞ , x → 1 − lim f ( x ) = − ∞ ,
和 x = 1 x = 1 x = 1 是垂直渐近线。没有水平渐近线:f ( x ) → ∞ f(x) \to \infty f ( x ) → ∞ 当 x → ∞ x \to \infty x → ∞ 且 f ( x ) → − ∞ f(x) \to -\infty f ( x ) → − ∞ 当 x → − ∞ 。 x \to -\infty\mathclose{\text{。}} x → − ∞ 。 图 3.5 显示了图像及其渐近线。
图 3.5 渐近线。左图:r ( x ) = x 2 − 4 x 2 − x − 2 r(x) = \dfrac{x^2 - 4}{x^2 - x - 2} r ( x ) = x 2 − x − 2 x 2 − 4 的例子 3.2 和 3.10,包含垂直渐近线 x = − 1 , x = -1\mathclose{\text{,}} x = − 1 , 水平渐近线 y = 1 y = 1 y = 1 以及在 ( 2 , 4 3 ) \big(2, \tfrac43\big) ( 2 , 3 4 ) 处的空洞。右图:f ( x ) = x 2 + 1 x − 1 f(x) = \dfrac{x^2 + 1}{x - 1} f ( x ) = x − 1 x 2 + 1 的例子 3.13,包含垂直渐近线 x = 1 x = 1 x = 1 和斜渐近线 y = x + 1 ; y = x + 1\mathclose{\text{;}} y = x + 1 ; 函数图像在 x > 1 x > 1 x > 1 时位于斜渐近线之上,在 x < 1 x < 1 x < 1 时位于斜渐近线之下。
动手计算渐近线与连续性使用 SymPy
在 SymPy 中,∞ \infty ∞ 是 sp.oo。这里是例子 3.12 在两端以及 3 的两侧的极限:
Python 复制
import sympy as sp
x = sp.symbols ('x' )
f = sp.sqrt (4 *x**2 + 1 )/(x - 3 )
print (sp.limit (f, x, sp.oo), sp.limit (f, x, -sp.oo))
print (sp.limit (f, x, 3 , '+' ), sp.limit (f, x, 3 , '-' ))
如模块 2 所警告的,单侧极限需要其方向:没有指定时,limit 从右侧趋近。为了查看函数的连续性,continuous_domain 列出了区间;这里是例子 3.2 的函数 r : r\mathclose{\text{:}} r :
Python 复制
from sympy.calculus.util import continuous_domain
r = (x**2 - 4 )/(x**2 - x - 2 )
print (continuous_domain (r, x, sp.S.Reals))
输出
Union(Interval.open(-oo, -1), Interval.open(-1, 2), Interval.open(2, oo))
Interval.open(-oo, -1) 是开区间 ( − ∞ , − 1 ) : (-\infty, -1)\mathclose{\text{:}} ( − ∞ , − 1 ) : r r r 在除了 − 1 -1 − 1 和 2 以外的所有点都是连续的。答案没有说明每个点的间断类型,对于复杂的公式 continuous_domain 可能是错误的,因此请将其与你自己的推导进行比较。对于斜渐近线,sp.div 将一个多项式除以另一个多项式,返回商和余数:
Python 复制
q, s = sp.div (x**2 + 1 , x - 1 ) # Example 3.13
print (q, s)
print (sp.limit ((x**2 + 1 )/(x - 1 ) - q, x, sp.oo))
商 x + 1 x + 1 x + 1 是渐近线,最后一行确认了它到该渐近线的距离趋于 0。
深入一步精确的定义
模块 2 用 ε 和 δ 精确地定义了 “f ( x ) f(x) f ( x ) 当 x x x 趋于 a a a 时趋于 L L L ”。本模块的新极限也是用相同的方式精确定义的。
lim x → a f ( x ) = ∞ \lim_{x\to a} f(x) = \infty lim x → a f ( x ) = ∞ 表示:对于每一个数 M , M\mathclose{\text{,}} M , 存在一个 δ > 0 , \delta > 0\mathclose{\text{,}} δ > 0 , 使得 f ( x ) > M f(x) > M f ( x ) > M 当 0 < ∣ x − a ∣ < δ 0 < \abs{x - a} < \delta 0 < ∣ x − a ∣ < δ 时成立。
lim x → ∞ f ( x ) = L \lim_{x\to\infty} f(x) = L lim x → ∞ f ( x ) = L 表示:对于每一个 ε > 0 , \varepsilon > 0\mathclose{\text{,}} ε > 0 , 存在一个数 N , N\mathclose{\text{,}} N , 使得 ∣ f ( x ) − L ∣ < ε \abs{f(x) - L} < \varepsilon ∣ f ( x ) − L ∣ < ε 当 x > N x > N x > N 时成立。
lim x → ∞ f ( x ) = ∞ \lim_{x\to\infty} f(x) = \infty lim x → ∞ f ( x ) = ∞ 表示:对于每一个数 M , M\mathclose{\text{,}} M , 存在一个数 N , N\mathclose{\text{,}} N , 使得 f ( x ) > M f(x) > M f ( x ) > M 当 x > N x > N x > N 时成立。
其他情况(− ∞ , -\infty\mathclose{\text{,}} − ∞ , 单侧极限,x → − ∞ ) x \to -\infty\mathclose{\text{)}} x → − ∞ ) 会以显而易见的方式改变不等式。例如,lim x → 0 1 / x 2 = ∞ : \lim_{x\to0} 1/x^2 = \infty\mathclose{\text{:}} lim x → 0 1/ x 2 = ∞ : 给定 M > 0 , M > 0\mathclose{\text{,}} M > 0 , 取 δ = 1 / M ; \delta = 1/\sqrt M\mathclose{\text{;}} δ = 1/ M ; 如果 0 < ∣ x ∣ < δ , 0 < \abs{x} < \delta\mathclose{\text{,}} 0 < ∣ x ∣ < δ , 则 x 2 < δ 2 = 1 / M , x^2 < \delta^2 = 1/M\mathclose{\text{,}} x 2 < δ 2 = 1/ M , 因此 1 / x 2 > M 。 1/x^2 > M\mathclose{\text{。}} 1/ x 2 > M 。
函数 ln x 、 \ln x\mathclose{\text{、}} ln x 、 x 2 、 x^2\mathclose{\text{、}} x 2 、 2 x 2^x 2 x 以及阶乘都趋于 ∞ , \infty\mathclose{\text{,}} ∞ , 但增长速度差异很大,这些差异决定了计算机在实践中能做什么。在几个整数处比较它们 n 。 n\mathclose{\text{。}} n 。 这里 n ! , n!\mathclose{\text{,}} n ! , 读作 “n n n 阶乘”,是乘积 1 ⋅ 2 ⋅ 3 ⋯ n , 1 \cdot 2 \cdot 3 \cdots n\mathclose{\text{,}} 1 ⋅ 2 ⋅ 3 ⋯ n , 即把 n n n 个物体排成一行的方式数目:
n n n 10 10 10 20 20 20 50 50 50 100 100 100 log 2 n \log_2 n log 2 n 3.322 3.322 3.322 4.322 4.322 4.322 5.644 5.644 5.644 6.644 6.644 6.644 n 2 n^2 n 2 100 100 100 400 400 400 2500 2500 2500 10000 10000 10000 2 n 2^n 2 n 1024 1024 1024 1.049 × 10 6 1.049\times10^{6} 1.049 × 1 0 6 1.126 × 10 15 1.126\times10^{15} 1.126 × 1 0 15 1.268 × 10 30 1.268\times10^{30} 1.268 × 1 0 30 n ! n! n ! 3.629 × 10 6 3.629\times10^{6} 3.629 × 1 0 6 2.433 × 10 18 2.433\times10^{18} 2.433 × 1 0 18 3.041 × 10 64 3.041\times10^{64} 3.041 × 1 0 64 9.333 × 10 157 9.333\times10^{157} 9.333 × 1 0 157
对数几乎不变,n 2 n^2 n 2 稳定增长,而 2 n 2^n 2 n 和 n ! n! n ! 则爆炸性增长:100 ! 100! 100 ! 有 158 位数字。为了精确比较增长速度,比较它们的比值。
定义 3.9增长阶
设当 x x x 充分大时,f f f 和 g g g 都为正。如果下述条件成立,就称当 x → ∞ x \to \infty x → ∞ 时 f f f 比 g g g 增长得慢 ,记作 f ≪ g , f \ll g\mathclose{\text{,}} f ≪ g , 读作「f 远小于 g」:
lim x → ∞ f ( x ) g ( x ) = 0. \lim_{x\to\infty}\frac{f(x)}{g(x)} = 0. x → ∞ lim g ( x ) f ( x ) = 0.
对于在整数上定义的函数 n , n\mathclose{\text{,}} n , 例如 n ! , n!\mathclose{\text{,}} n ! , 当 n → ∞ n \to \infty n → ∞ 时,极限意味着相同,其中 n n n 依次经过 1 , 2 , 3 , … ; 1, 2, 3, \dots\mathclose{\text{;}} 1 , 2 , 3 , … ; 模块 14 研究此类序列的极限。
目前来看,f f f 是 g g g 的一个可以忽略不计的分数:最终低于 1%,或 0.0001%,或你命名的任何分数。在幂次中,更高次幂占优:x p ≪ x q x^p \ll x^q x p ≪ x q 当 p < q , p < q\mathclose{\text{,}} p < q , 因为 x p x q = 1 x q − p → 0 。 \dfrac{x^p}{x^q} = \dfrac{1}{x^{q-p}} \to 0\mathclose{\text{。}} x q x p = x q − p 1 → 0 。
定理 3.11增长阶
对于每一个 p > 0 p > 0 p > 0 和每一个 a > 1 , a > 1\mathclose{\text{,}} a > 1 , 当 x → ∞ , x \to \infty\mathclose{\text{,}} x → ∞ ,
ln x ≪ x p ≪ a x , \ln x \ll x^p \ll a^x, ln x ≪ x p ≪ a x ,
并且,当 n → ∞ n \to \infty n → ∞ 依次经过所有整数时,
a n ≪ n ! ≪ n n . a^n \ll n! \ll n^n. a n ≪ n ! ≪ n n .
每一个对数都被每一个正幂超越,每一个幂都被每一个大于 1 的指数函数超越,每一个指数函数又被阶乘超越。与 n ! n! n ! 相关的两个比较只需简单的不等式。
证明 与阶乘的比较
对于 n ! n n , \dfrac{n!}{n^n}\mathclose{\text{,}} n n n ! , 将分子和分母写成 n n n 因子的乘积:
n ! n n = 1 n ⋅ 2 n ⋯ n n ≤ 1 n , \frac{n!}{n^n} = \frac{1}{n}\cdot\frac{2}{n}\cdots\frac{n}{n} \le \frac{1}{n}, n n n ! = n 1 ⋅ n 2 ⋯ n n ≤ n 1 ,
因为第一个因子之后的每一个因子都不超过 1。由于 0 < n ! n n ≤ 1 n 0 < \dfrac{n!}{n^n} \le \dfrac1n 0 < n n n ! ≤ n 1 和 1 n → 0 , \dfrac1n \to 0\mathclose{\text{,}} n 1 → 0 , 夹逼定理给出 n ! n n → 0 。 \dfrac{n!}{n^n} \to 0\mathclose{\text{。}} n n n ! → 0 。
对于 a n n ! , \dfrac{a^n}{n!}\mathclose{\text{,}} n ! a n , 选择一个整数 N ≥ 2 a 。 N \ge 2a\mathclose{\text{。}} N ≥ 2 a 。 对于 n > N , n > N\mathclose{\text{,}} n > N , 将顶部和底部的前 N N N 个因子分开:
a n n ! = a N N ! ⋅ a N + 1 ⋅ a N + 2 ⋯ a n ≤ a N N ! ( 1 2 ) n − N , \begin{aligned} \frac{a^n}{n!} &= \frac{a^N}{N!}\cdot\frac{a}{N + 1}\cdot\frac{a}{N + 2}\cdots\frac{a}{n} \\ &\le \frac{a^N}{N!}\Big(\frac12\Big)^{n - N}, \end{aligned} n ! a n = N ! a N ⋅ N + 1 a ⋅ N + 2 a ⋯ n a ≤ N ! a N ( 2 1 ) n − N ,
因为每个最后的 n − N n - N n − N 个因子都不超过 a N ≤ 1 2 。 \dfrac{a}{N} \le \dfrac12\mathclose{\text{。}} N a ≤ 2 1 。 数 a N N ! \dfrac{a^N}{N!} N ! a N 是固定的,且 ( 1 2 ) n − N → 0 \big(\tfrac12\big)^{n-N} \to 0 ( 2 1 ) n − N → 0 (第 3.7 节),因此 a n n ! → 0 \dfrac{a^n}{n!} \to 0 n ! a n → 0 由夹逼定理得出。
∎
这些比较 ln x ≪ x p ≪ a x \ln x \ll x^p \ll a^x ln x ≪ x p ≪ a x 需要一些更细致的工作。模块 7 用洛必达法则在几行内证明了它们,下面的“深入理解”框则用本模块的工具证明了它们。现在用数字使它们更具说服力:
x x x ln x \ln x ln x x \sqrt{x} x ln x x \dfrac{\ln x}{\sqrt x} x ln x 10 10 10 2.303 2.303 2.303 3.162 3.162 3.162 0.7281 0.7281 0.7281 100 100 100 4.605 4.605 4.605 10 10 10 0.4605 0.4605 0.4605 10000 10000 10000 9.210 9.210 9.210 100 100 100 0.09210 0.09210 0.09210 1000000 1000000 1000000 13.82 13.82 13.82 1000 1000 1000 0.01382 0.01382 0.01382
在 x = 10 x = 10 x = 10 处,对数已经小于 x , \sqrt x\mathclose{\text{,}} x , 并且比率不断减小:根据 x = 10 6 , x = 10^6\mathclose{\text{,}} x = 1 0 6 , ln x \ln x ln x 小于 x \sqrt x x 的 1.4%。
深入一步对数、幂和指数的比较
为了证明 x p a x → 0 \dfrac{x^p}{a^x} \to 0 a x x p → 0 对于 p > 0 p > 0 p > 0 和 a > 1 , a > 1\mathclose{\text{,}} a > 1 , 从整数 n n n 和项 u n = n p a n u_n = \dfrac{n^p}{a^n} u n = a n n p 开始。连续项的比率,
u n + 1 u n = ( n + 1 ) p a n + 1 ⋅ a n n p = 1 a ( 1 + 1 n ) p , \frac{u_{n+1}}{u_n} = \frac{(n + 1)^p}{a^{n+1}}\cdot\frac{a^n}{n^p} = \frac1a\Big(1 + \frac1n\Big)^p, u n u n + 1 = a n + 1 ( n + 1 ) p ⋅ n p a n = a 1 ( 1 + n 1 ) p ,
当 n → ∞ n \to \infty n → ∞ 时,趋近于 1 a < 1 , \frac1a < 1\mathclose{\text{,}} a 1 < 1 , 因为 t p = e p ln t t^p = e^{p\ln t} t p = e p l n t 在 t = 1 t = 1 t = 1 处连续(定理 3.3 和 3.5)。在 1 a \frac1a a 1 与 1 之间取数 ρ \rho ρ (希腊字母 rho),例如 ρ = 1 2 ( 1 + 1 a ) , \rho = \frac12\big(1 + \frac1a\big)\mathclose{\text{,}} ρ = 2 1 ( 1 + a 1 ) , 则从某个 N N N 起,对于每个 n , n\mathclose{\text{,}} n , 这个比值均小于 ρ , \rho\mathclose{\text{,}} ρ , 于是
u N + k ≤ u N ρ k for k = 1 , 2 , 3 , … u_{N+k} \le u_N\,\rho^k \quad\text{for } k = 1, 2, 3, \dots u N + k ≤ u N ρ k for k = 1 , 2 , 3 , …
由于 ρ k = 1 / ( 1 / ρ ) k \rho^k = 1/(1/\rho)^k ρ k = 1/ ( 1/ ρ ) k 和 1 / ρ > 1 , 1/\rho > 1\mathclose{\text{,}} 1/ ρ > 1 , 根据 ρ k → 0 \rho^k \to 0 ρ k → 0 (第 3.7 节),所以 u n → 0 。 u_n \to 0\mathclose{\text{。}} u n → 0 。 对于一个实数 x ≥ 1 , x \ge 1\mathclose{\text{,}} x ≥ 1 , 令 n = ⌊ x ⌋ , n = \lfloor x\rfloor\mathclose{\text{,}} n = ⌊ x ⌋ , 因此 n ≤ x < n + 1 ; n \le x < n + 1\mathclose{\text{;}} n ≤ x < n + 1 ; 然后 x p < ( n + 1 ) p x^p < (n + 1)^p x p < ( n + 1 ) p 和 a x ≥ a n , a^x \ge a^n\mathclose{\text{,}} a x ≥ a n , 所以
0 < x p a x < ( n + 1 ) p a n = a u n + 1 , 0 < \frac{x^p}{a^x} < \frac{(n + 1)^p}{a^n} = a\,u_{n+1}, 0 < a x x p < a n ( n + 1 ) p = a u n + 1 ,
夹逼定理给出 x p a x → 0 。 \dfrac{x^p}{a^x} \to 0\mathclose{\text{。}} a x x p → 0 。 对于 ln x x p , \dfrac{\ln x}{x^p}\mathclose{\text{,}} x p ln x , 代入 x = e t : x = e^t\mathclose{\text{:}} x = e t : 当 x → ∞ x \to \infty x → ∞ 时,t = ln x → ∞ , t = \ln x \to \infty\mathclose{\text{,}} t = ln x → ∞ , 并且 ln x x p = t ( e p ) t , \dfrac{\ln x}{x^p} = \dfrac{t}{(e^p)^t}\mathclose{\text{,}} x p ln x = ( e p ) t t , 根据第一部分,其趋于 0,幂为 1,底数为 e p > 1 。 e^p > 1\mathclose{\text{。}} e p > 1 。 比较连续项,如此处和对于 n ! , n!\mathclose{\text{,}} n ! , 是模块 14 中级数比值判别法的思想。
注意
小表格可能产生误导。比较 n 10 n^{10} n 10 与 2 n : 2^n\mathclose{\text{:}} 2 n :
n n n n 10 n^{10} n 10 2 n 2^n 2 n n 10 2 n \dfrac{n^{10}}{2^n} 2 n n 10 10 10 10 1 × 10 10 1\times10^{10} 1 × 1 0 10 1024 1024 1024 9.766 × 10 6 9.766\times10^{6} 9.766 × 1 0 6 30 30 30 5.905 × 10 14 5.905\times10^{14} 5.905 × 1 0 14 1.074 × 10 9 1.074\times10^{9} 1.074 × 1 0 9 549900 549900 549900 58 58 58 4.308 × 10 17 4.308\times10^{17} 4.308 × 1 0 17 2.882 × 10 17 2.882\times10^{17} 2.882 × 1 0 17 1.495 1.495 1.495 59 59 59 5.111 × 10 17 5.111\times10^{17} 5.111 × 1 0 17 5.765 × 10 17 5.765\times10^{17} 5.765 × 1 0 17 0.8866 0.8866 0.8866 100 100 100 1 × 10 20 1\times10^{20} 1 × 1 0 20 1.268 × 10 30 1.268\times10^{30} 1.268 × 1 0 30 7.889 × 10 − 11 7.889\times10^{-11} 7.889 × 1 0 − 11
对于每一个 n n n 从 2 到 58,n 10 n^{10} n 10 是较大的;只有在 n = 59 n = 59 n = 59 时,2 n 2^n 2 n 才超过它,此后它一直领先,而比率则急剧下降。“最终”可能相距很远:n 100 n^{100} n 100 在每一个 n n n 从 2 到 117,308 时都领先于 1.01 n 。 1.01^n\mathclose{\text{。}} 1.0 1 n 。 一个比较 f ≪ g f \ll g f ≪ g 说明最终谁胜出,而不是什么时候胜出。
大 O 表示法与算法
计算机科学家通过算法运行时间随输入规模 n n n 增长的方式比较算法,例如待排序的项目数量。常数因子取决于计算机和程序员,因此比较时忽略它们。
定义 3.10大 O 表示法
设 f f f 和 g g g 是整数 n n n 的函数。则 f ( n ) = O ( g ( n ) ) f(n) = O\big(g(n)\big) f ( n ) = O ( g ( n ) ) 作为 n → ∞ , n \to \infty\mathclose{\text{,}} n → ∞ , 读作 “f f f of n n n 是 g g g of n n n 的大 O”,如果存在常数 C C C 和 N N N 使得
∣ f ( n ) ∣ ≤ C ∣ g ( n ) ∣ for every n ≥ N . \abs{f(n)} \le C\,\abs{g(n)} \quad\text{for every } n \ge N. ∣ f ( n ) ∣ ≤ C ∣ g ( n ) ∣ for every n ≥ N .
所以 f = O ( g ) f = O(g) f = O ( g ) 表示 f f f 的增长速度不超过某个常数倍的 g ; g\mathclose{\text{;}} g ; 常数因子和小的 n n n 没有关系。它只是一个上界:n = O ( n 2 ) n = O(n^2) n = O ( n 2 ) 是正确的,但如果没提供信息的话就不重要。 (这种记号也用于 h → 0 : h \to 0\mathclose{\text{:}} h → 0 : 模块 4 就是用这种方式来衡量误差的。) 极限提供了一个快速的测试方法:如果 f ( n ) / g ( n ) f(n)/g(n) f ( n ) / g ( n ) 趋向于一个数 L , L\mathclose{\text{,}} L , 那么 f = O ( g ) , f = O(g)\mathclose{\text{,}} f = O ( g ) , 因为最终 ∣ f ( n ) / g ( n ) ∣ < ∣ L ∣ + 1 。 \abs{f(n)/g(n)} < \abs{L} + 1\mathclose{\text{。}} ∣ f ( n ) / g ( n ) ∣ < ∣ L ∣ + 1 。 特别是 f ≪ g f \ll g f ≪ g 推出 f = O ( g ) , f = O(g)\mathclose{\text{,}} f = O ( g ) , 但随后 g g g 不等于 O ( f ) , O(f)\mathclose{\text{,}} O ( f ) , 因为 g ( n ) / f ( n ) g(n)/f(n) g ( n ) / f ( n ) 会无界增长。
例 3.14大 O 上界 ✓ 已检验
证明 3 n 2 + 5 n + 7 = O ( n 2 ) , 3n^2 + 5n + 7 = O(n^2)\mathclose{\text{,}} 3 n 2 + 5 n + 7 = O ( n 2 ) , 并且证明 n 2 n^2 n 2 不等于 O ( n ) 。 O(n)\mathclose{\text{。}} O ( n ) 。
对于 n ≥ 1 , n \ge 1\mathclose{\text{,}} n ≥ 1 , n ≤ n 2 n \le n^2 n ≤ n 2 和 1 ≤ n 2 , 1 \le n^2\mathclose{\text{,}} 1 ≤ n 2 , 所以
3 n 2 + 5 n + 7 ≤ 3 n 2 + 5 n 2 + 7 n 2 = 15 n 2 . \begin{aligned} 3n^2 + 5n + 7 &\le 3n^2 + 5n^2 + 7n^2 \\ &= 15n^2. \end{aligned} 3 n 2 + 5 n + 7 ≤ 3 n 2 + 5 n 2 + 7 n 2 = 15 n 2 .
这就是定义,其中 C = 15 C = 15 C = 15 和 N = 1 。 N = 1\mathclose{\text{。}} N = 1 。 极限测试给出相同的结果:3 n 2 + 5 n + 7 n 2 = 3 + 5 n + 7 n 2 → 3 。 \dfrac{3n^2 + 5n + 7}{n^2} = 3 + \dfrac5n + \dfrac{7}{n^2} \to 3\mathclose{\text{。}} n 2 3 n 2 + 5 n + 7 = 3 + n 5 + n 2 7 → 3 。 低阶项 5 n + 7 5n + 7 5 n + 7 和因子 3 没有关系。
另一方面,n 2 n = n \dfrac{n^2}{n} = n n n 2 = n 会无界增长,因此没有常数 C C C 能够使得 n 2 ≤ C n n^2 \le Cn n 2 ≤ C n 对于所有足够大的 n n n 成立:n 2 n^2 n 2 不等于 O ( n ) 。 O(n)\mathclose{\text{。}} O ( n ) 。
在算法分析中常见的增长阶,从增长最慢到最快:
阶
名称
出现的场景
O ( log 2 n ) O(\log_2 n) O ( log 2 n )
对数阶
二分查找:每一步将有序列表减半
O ( n ) O(n) O ( n )
线性阶
逐个查看每个元素,例如查找最大值
O ( n log 2 n ) O(n\log_2 n) O ( n log 2 n )
线性对数阶
归并排序进行排序
O ( n 2 ) O(n^2) O ( n 2 )
平方阶
比较每一对元素
O ( 2 n ) O(2^n) O ( 2 n )
指数阶
尝试所有元素的子集
O ( n ! ) O(n!) O ( n !)
阶乘阶
尝试物品的每一个顺序
对数的底在 O O O 内并不重要: log 2 n = ln n ln 2 \log_2 n = \dfrac{\ln n}{\ln 2} log 2 n = ln 2 ln n 是 ln n \ln n ln n 的常数倍,因此计算机科学家经常在不指定底数的情况下写作 O ( log n ) 。 O(\log n)\mathclose{\text{。}} O ( log n ) 。 定理 3.11 将表格中的顺序连成一条链,
log 2 n ≪ n ≪ n log 2 n ≪ n 2 ≪ 2 n ≪ n ! , \log_2 n \ll n \ll n\log_2 n \ll n^2 \ll 2^n \ll n!, log 2 n ≪ n ≪ n log 2 n ≪ n 2 ≪ 2 n ≪ n ! ,
因为 n n log 2 n = 1 log 2 n → 0 \dfrac{n}{n\log_2 n} = \dfrac{1}{\log_2 n} \to 0 n log 2 n n = log 2 n 1 → 0 和 n log 2 n n 2 = log 2 n n → 0 。 \dfrac{n\log_2 n}{n^2} = \dfrac{\log_2 n}{n} \to 0\mathclose{\text{。}} n 2 n log 2 n = n log 2 n → 0 。
这在实际中意味着:假设,假设一台计算机每秒可以执行 10 9 10^9 1 0 9 个基本步骤。对于 n = 100 , n = 100\mathclose{\text{,}} n = 100 , 一个需要 n 2 n^2 n 2 步的算法在 10 微秒内完成;一个需要 2 n 2^n 2 n 步的算法,则大约需要 1.27 × 10 30 , 1.27 \times 10^{30}\mathclose{\text{,}} 1.27 × 1 0 30 , 需要约 4.0 × 10 13 4.0 \times 10^{13} 4.0 × 1 0 13 年;一个需要 n ! n! n ! 步的算法则大约需要 3 × 10 141 3 \times 10^{141} 3 × 1 0 141 年。更快的硬件无法拯救指数级算法:一台速度是原来的两倍的计算机,在相同时间内只能处理 2 n 2^n 2 n 算法一个更多的项目,因为 2 n + 1 = 2 ⋅ 2 n , 2^{n+1} = 2 \cdot 2^n\mathclose{\text{,}} 2 n + 1 = 2 ⋅ 2 n , 而一个 n 2 n^2 n 2 算法则可以处理 2 ≈ 1.41 \sqrt2 \approx 1.41 2 ≈ 1.41 倍多的项目,因为 ( 2 n ) 2 = 2 n 2 。 (\sqrt2\,n)^2 = 2n^2\mathclose{\text{。}} ( 2 n ) 2 = 2 n 2 。
注意
大O符号隐藏了常数因子,对于小规模 n n n 它们很重要。一个需要 100 n log 2 n 100\,n\log_2 n 100 n log 2 n 步的算法只有在 n > 100 log 2 n n > 100\log_2 n n > 100 log 2 n 时才比需要 n 2 n^2 n 2 步的算法更好:对于从 2 到 996 的每一个 n , n\mathclose{\text{,}} n , "较差" 的二次算法所需的步骤更少,而只有从 n = 997 n = 997 n = 997 开始,另一个算法才会占优。大O符号说明的是最终谁胜出,而不是你当前的规模。也要进行测量。
动手计算带精确整数的增长率
Python 的整数是精确的,无论多大,因此它们可以无舍入误差地回答增长问题。2 n 2^n 2 n 在何处超过 n 10 ? n^{10}\mathclose{\text{?}} n 10 ?
Python 复制
n = 2
while n**10 >= 2 **n: # exact integer arithmetic: no rounding
n += 1
print (n, n**10 , 2 **n)
输出
59 511116753300641401 576460752303423488
在假设每秒执行 10 9 10^9 1 0 9 步的情况下,表格中的算法需要多长时间?
Python 复制
import math
speed = 10 **9 # steps per second (hypothetical)
year = 365.25 * 24 * 3600 # seconds in a year
for n in (20 , 50 , 100 ):
for name, steps in (("n^2" , n**2 ), ("2^n" , 2 **n), ("n!" , math.factorial (n))):
seconds = steps / speed
print (f"n = {n:3} {name:>3}: {seconds:9.3g} s = {seconds / year:9.3g} years" )
输出
n = 20 n^2: 4e-07 s = 1.27e-14 years
n = 20 2^n: 0.00105 s = 3.32e-11 years
n = 20 n!: 2.43e+09 s = 77.1 years
n = 50 n^2: 2.5e-06 s = 7.92e-14 years
n = 50 2^n: 1.13e+06 s = 0.0357 years
n = 50 n!: 3.04e+55 s = 9.64e+47 years
n = 100 n^2: 1e-05 s = 3.17e-13 years
n = 100 2^n: 1.27e+21 s = 4.02e+13 years
n = 100 n!: 9.33e+148 s = 2.96e+141 years
n 2 n^2 n 2 列始终保持在千分之一秒以下。2 n 2^n 2 n 列从 n = 20 n = 20 n = 20 时的毫秒级增长到 n = 50 n = 50 n = 50 时的约 13 天(1.13 × 10 6 1.13 \times 10^6 1.13 × 1 0 6 秒),而 n ! n! n ! 列在 n = 20 n = 20 n = 20 时已经约为 77 年。
当 lim x → a f ( x ) = f ( a ) \lim_{x\to a} f(x) = f(a) lim x → a f ( x ) = f ( a ) 时,f f f 在 a a a 处连续:f ( a ) f(a) f ( a ) 有定义,极限存在,且两者相等。单侧连续性处理跳跃和区间端点。
间断点可以是可去的(极限存在),跳跃间断点(单侧极限不同),无穷间断点(函数值无界增长)或振荡间断点。只有可去间断点可以通过改变一个点的函数值来修复。
连续函数的和、积、商(分母不为零)以及复合函数都是连续的,且连续函数的极限可以进入函数内部:lim f ( g ( x ) ) = f ( lim g ( x ) ) 。 \lim f\big(g(x)\big) = f\big(\lim g(x)\big)\mathclose{\text{。}} lim f ( g ( x ) ) = f ( lim g ( x ) ) 。 多项式、有理函数、根函数、指数函数、对数函数以及三角函数在其定义域上都是连续的。
中间值定理:一个在 [ a , b ] [a, b] [ a , b ] 上连续的函数会取到 f ( a ) f(a) f ( a ) 和 f ( b ) f(b) f ( b ) 之间的所有值,因此符号变化表明存在一个根。
二分法在每一步都将区间减半:经过 n n n 步后,区间宽度为 ( b − a ) / 2 n , (b - a)/2^n\mathclose{\text{,}} ( b − a ) / 2 n , 并且中点与根的误差不超过 ( b − a ) / 2 n + 1 。 (b - a)/2^{n+1}\mathclose{\text{。}} ( b − a ) / 2 n + 1 。
极值定理:一个在闭区间 [ a , b ] [a, b] [ a , b ] 上连续的函数在该区间上一定存在最大值和最小值;在开区间或无界区间,或存在间断点的情况下,可能不存在极值。
lim x → a f ( x ) = ± ∞ \lim_{x\to a} f(x) = \pm\infty lim x → a f ( x ) = ± ∞ 描述的是无限增长的值;然后 x = a x = a x = a 是一条垂直渐近线,通常出现在分子非零而分母为零的地方。∞ \infty ∞ 不是一个数:∞ − ∞ \infty - \infty ∞ − ∞ 和 ∞ / ∞ \infty/\infty ∞/∞ 没有固定的值。
lim x → ± ∞ f ( x ) = L \lim_{x\to\pm\infty} f(x) = L lim x → ± ∞ f ( x ) = L 给出水平渐近线 y = L 。 y = L\mathclose{\text{。}} y = L 。 有理函数的行为类似于它们主导项的比值;当分子的次数比分母的次数高一次时,除法会给出一条斜渐近线。
ln x ≪ x p ≪ a x \ln x \ll x^p \ll a^x ln x ≪ x p ≪ a x 对于 p > 0 p > 0 p > 0 和 a > 1 , a > 1\mathclose{\text{,}} a > 1 , 以及 a n ≪ n ! ≪ n n 。 a^n \ll n! \ll n^n\mathclose{\text{。}} a n ≪ n ! ≪ n n 。 大 O 符号 f = O ( g ) f = O(g) f = O ( g ) 用一个常数倍的 g g g 来限制 f , f\mathclose{\text{,}} f , 并通过它们成本增长的方式对算法进行排序。
练习 3.1 ★ 三个条件
对于每个函数,判断它在给定的数处是否连续。如果不连续,说明定义 3.1 中的三个条件中的哪一个失败,并分类这种不连续性。
(a) f ( x ) = x 2 − 9 x − 3 , f(x) = \dfrac{x^2 - 9}{x - 3}\mathclose{\text{,}} f ( x ) = x − 3 x 2 − 9 , 在 3 处
(b) g ( x ) = x + 1 g(x) = x + 1 g ( x ) = x + 1 对于 x < 1 , x < 1\mathclose{\text{,}} x < 1 , 以及 g ( x ) = 3 − x g(x) = 3 - x g ( x ) = 3 − x 对于 x ≥ 1 , x \ge 1\mathclose{\text{,}} x ≥ 1 , 在 1 处
(c) h ( x ) = x 2 h(x) = x^2 h ( x ) = x 2 对于 x ≤ 0 , x \le 0\mathclose{\text{,}} x ≤ 0 , 以及 h ( x ) = 1 x h(x) = \dfrac{1}{x} h ( x ) = x 1 对于 x > 0 , x > 0\mathclose{\text{,}} x > 0 , 在 0 处
(d) u ( x ) = ∣ x − 1 ∣ x − 1 , u(x) = \dfrac{\abs{x - 1}}{x - 1}\mathclose{\text{,}} u ( x ) = x − 1 ∣ x − 1 ∣ , 在 1 处
查看解答✓ 已检验
(a) f ( 3 ) = 0 / 0 f(3) = 0/0 f ( 3 ) = 0/0 未定义:条件 1 不满足。对于 x ≠ 3 , x \ne 3\mathclose{\text{,}} x = 3 , f ( x ) = ( x − 3 ) ( x + 3 ) x − 3 = x + 3 , f(x) = \dfrac{(x - 3)(x + 3)}{x - 3} = x + 3\mathclose{\text{,}} f ( x ) = x − 3 ( x − 3 ) ( x + 3 ) = x + 3 , 因此 lim x → 3 f ( x ) = 6 。 \lim_{x\to3} f(x) = 6\mathclose{\text{。}} lim x → 3 f ( x ) = 6 。 极限存在,因此不连续性是可去的:给 f f f 在 3 处赋值 6,使其连续。
(b) g ( 1 ) = 3 − 1 = 2 。 g(1) = 3 - 1 = 2\mathclose{\text{。}} g ( 1 ) = 3 − 1 = 2 。 从左侧,lim x → 1 − ( x + 1 ) = 2 ; \lim_{x\to1^-}(x + 1) = 2\mathclose{\text{;}} lim x → 1 − ( x + 1 ) = 2 ; 从右侧,lim x → 1 + ( 3 − x ) = 2 。 \lim_{x\to1^+}(3 - x) = 2\mathclose{\text{。}} lim x → 1 + ( 3 − x ) = 2 。 单侧极限一致,因此 lim x → 1 g ( x ) = 2 = g ( 1 ) : \lim_{x\to1} g(x) = 2 = g(1)\mathclose{\text{:}} lim x → 1 g ( x ) = 2 = g ( 1 ) : g g g 在 1 处连续。两段在点 ( 1 , 2 ) (1, 2) ( 1 , 2 ) 处衔接。
(c) h ( 0 ) = 0 2 = 0 , h(0) = 0^2 = 0\mathclose{\text{,}} h ( 0 ) = 0 2 = 0 , 且从左侧 lim x → 0 − x 2 = 0 = h ( 0 ) , \lim_{x\to0^-} x^2 = 0 = h(0)\mathclose{\text{,}} lim x → 0 − x 2 = 0 = h ( 0 ) , 因此 h h h 在 0 处左连续。从右侧,h ( x ) = 1 / x h(x) = 1/x h ( x ) = 1/ x 无界增长:lim x → 0 + h ( x ) = ∞ 。 \lim_{x\to0^+} h(x) = \infty\mathclose{\text{。}} lim x → 0 + h ( x ) = ∞ 。 因此 lim x → 0 h ( x ) \lim_{x\to0} h(x) lim x → 0 h ( x ) 不存在(条件 2 不满足),且 0 是无限不连续点。
(d) u ( 1 ) = 0 / 0 u(1) = 0/0 u ( 1 ) = 0/0 未定义:条件 1 不满足。对于 x > 1 , x > 1\mathclose{\text{,}} x > 1 , ∣ x − 1 ∣ = x − 1 \abs{x - 1} = x - 1 ∣ x − 1 ∣ = x − 1 和 u ( x ) = 1 ; u(x) = 1\mathclose{\text{;}} u ( x ) = 1 ; 对于 x < 1 , x < 1\mathclose{\text{,}} x < 1 , ∣ x − 1 ∣ = − ( x − 1 ) \abs{x - 1} = -(x - 1) ∣ x − 1 ∣ = − ( x − 1 ) 和 u ( x ) = − 1 。 u(x) = -1\mathclose{\text{。}} u ( x ) = − 1 。 单侧极限,1 和 − 1 -1 − 1 不同,因此极限也不存在:跳跃不连续。
练习 3.2 ★ 修复间断点
每个公式在一个或两个数上分母为零。在每个这样的数上,判断间断点是否可去,如果是,给出修复它的值。
(a) f ( x ) = x 3 − 8 x − 2 f(x) = \dfrac{x^3 - 8}{x - 2} f ( x ) = x − 2 x 3 − 8
(b) g ( x ) = x + 4 − 2 x g(x) = \dfrac{\sqrt{x + 4} - 2}{x} g ( x ) = x x + 4 − 2
(c) h ( x ) = x + 1 x 2 − 1 h(x) = \dfrac{x + 1}{x^2 - 1} h ( x ) = x 2 − 1 x + 1
查看解答✓ 已检验
(a) f f f 在 2 处未定义。因式分解立方差:x 3 − 8 = ( x − 2 ) ( x 2 + 2 x + 4 ) , x^3 - 8 = (x - 2)(x^2 + 2x + 4)\mathclose{\text{,}} x 3 − 8 = ( x − 2 ) ( x 2 + 2 x + 4 ) , 因此对于 x ≠ 2 , x \ne 2\mathclose{\text{,}} x = 2 , f ( x ) = x 2 + 2 x + 4 , f(x) = x^2 + 2x + 4\mathclose{\text{,}} f ( x ) = x 2 + 2 x + 4 , 趋于 4 + 4 + 4 = 12 。 4 + 4 + 4 = 12\mathclose{\text{。}} 4 + 4 + 4 = 12 。 极限存在:间断点可去,且值 f ( 2 ) = 12 f(2) = 12 f ( 2 ) = 12 修复它。
(b) g g g 在 x ≥ − 4 x \ge -4 x ≥ − 4 处定义,除了在 0 处。有理化,如模块 2 所示:将分子和分母乘以 x + 4 + 2 。 \sqrt{x + 4} + 2\mathclose{\text{。}} x + 4 + 2 。 由于 ( x + 4 − 2 ) ( x + 4 + 2 ) = ( x + 4 ) − 4 = x , \big(\sqrt{x + 4} - 2\big)\big(\sqrt{x + 4} + 2\big) = (x + 4) - 4 = x\mathclose{\text{,}} ( x + 4 − 2 ) ( x + 4 + 2 ) = ( x + 4 ) − 4 = x , 对于 x ≠ 0 x \ne 0 x = 0
g ( x ) = x x ( x + 4 + 2 ) = 1 x + 4 + 2 . \begin{aligned} g(x) &= \frac{x}{x\big(\sqrt{x + 4} + 2\big)} \\ &= \frac{1}{\sqrt{x + 4} + 2}. \end{aligned} g ( x ) = x ( x + 4 + 2 ) x = x + 4 + 2 1 .
平方根在 4 处连续,因此在 0 处的极限是 1 / ( 2 + 2 ) = 1 4 : 1/(2 + 2) = \tfrac14\mathclose{\text{:}} 1/ ( 2 + 2 ) = 4 1 : 可去间断点,通过 g ( 0 ) = 1 4 g(0) = \tfrac14 g ( 0 ) = 4 1 修复。
(c) h h h 在 x 2 − 1 = ( x − 1 ) ( x + 1 ) = 0 x^2 - 1 = (x - 1)(x + 1) = 0 x 2 − 1 = ( x − 1 ) ( x + 1 ) = 0 处未定义,当 − 1 -1 − 1 和 1 时。对于其他 x , x\mathclose{\text{,}} x , h ( x ) = 1 / ( x − 1 ) 。 h(x) = 1/(x - 1)\mathclose{\text{。}} h ( x ) = 1/ ( x − 1 ) 。 在 − 1 -1 − 1 处的极限是 1 / ( − 2 ) = − 1 2 : 1/(-2) = -\tfrac12\mathclose{\text{:}} 1/ ( − 2 ) = − 2 1 : 可去间断点,通过 h ( − 1 ) = − 1 2 h(-1) = -\tfrac12 h ( − 1 ) = − 2 1 修复。在 1 处, 1 / ( x − 1 ) 1/(x - 1) 1/ ( x − 1 ) 的分子为 1,分母趋于 0,因此根据定理 3.9,函数值在右侧趋于 ∞ , \infty\mathclose{\text{,}} ∞ , 在左侧趋于 − ∞ : -\infty\mathclose{\text{:}} − ∞ : 无穷间断点,无法通过任何值修复。
练习 3.3 ★ 中间值定理求根
(a) 证明 x 5 + x − 1 = 0 x^5 + x - 1 = 0 x 5 + x − 1 = 0 在 ( 0 , 1 ) (0, 1) ( 0 , 1 ) 内有解。
(b) 证明 e − x = x e^{-x} = x e − x = x 在 ( 0 , 1 ) (0, 1) ( 0 , 1 ) 内有解。
(c) f ( x ) = 1 x f(x) = \dfrac1x f ( x ) = x 1 在 f ( − 1 ) = − 1 < 0 < 1 = f ( 1 ) f(-1) = -1 < 0 < 1 = f(1) f ( − 1 ) = − 1 < 0 < 1 = f ( 1 ) 内有解。为什么中间值定理不能保证 ( − 1 , 1 ) (-1, 1) ( − 1 , 1 ) 内有根? f f f 是否有根?
查看解答✓ 已检验
(a) p ( x ) = x 5 + x − 1 p(x) = x^5 + x - 1 p ( x ) = x 5 + x − 1 是一个多项式,在 [ 0 , 1 ] [0, 1] [ 0 , 1 ] 上连续,且具有 p ( 0 ) = − 1 < 0 p(0) = -1 < 0 p ( 0 ) = − 1 < 0 和 p ( 1 ) = 1 > 0 。 p(1) = 1 > 0\mathclose{\text{。}} p ( 1 ) = 1 > 0 。 根据中间值定理,存在某个 c c c 在 ( 0 , 1 ) (0, 1) ( 0 , 1 ) 内,使得 p ( c ) = 0 。 p(c) = 0\mathclose{\text{。}} p ( c ) = 0 。 (二分法或计算机可得 c ≈ 0.7549 。) c \approx 0.7549\mathclose{\text{。)}} c ≈ 0.7549 。)
(b) 将方程重写为 g ( x ) = 0 , g(x) = 0\mathclose{\text{,}} g ( x ) = 0 , 其中 g ( x ) = e − x − x g(x) = e^{-x} - x g ( x ) = e − x − x 是在 R \R R 上连续的(e − x e^{-x} e − x 是 e u e^u e u 与 u = − x u = -x u = − x 的复合)。因此 g ( 0 ) = 1 > 0 g(0) = 1 > 0 g ( 0 ) = 1 > 0 和 g ( 1 ) = e − 1 − 1 ≈ 0.3679 − 1 = − 0.6321 < 0 , g(1) = e^{-1} - 1 \approx 0.3679 - 1 = -0.6321 < 0\mathclose{\text{,}} g ( 1 ) = e − 1 − 1 ≈ 0.3679 − 1 = − 0.6321 < 0 , 所以 g g g 在 ( 0 , 1 ) (0, 1) ( 0 , 1 ) 内有一个根: e − x = x e^{-x} = x e − x = x 那里。(它就是 c ≈ 0.5671 。) c \approx 0.5671\mathclose{\text{。)}} c ≈ 0.5671 。)
(c) 定理要求 f f f 在 [ − 1 , 1 ] [-1, 1] [ − 1 , 1 ] 的整个定义域上连续,而 1 / x 1/x 1/ x 在 0 处未定义:它在该点有一个无限间断点。因此定理无话可说。而且 f f f 没有根: 1 x = 0 \dfrac1x = 0 x 1 = 0 需要 1 = 0 ⋅ x = 0 。 1 = 0 \cdot x = 0\mathclose{\text{。}} 1 = 0 ⋅ x = 0 。 符号变化是因为图像在渐近线 x = 0 x = 0 x = 0 处从 − ∞ -\infty − ∞ 跳到 ∞ , \infty\mathclose{\text{,}} ∞ , 而不是穿过轴。
练习 3.4 ★★ 手动二分法
使用二分法在 f ( x ) = x 3 − 2 x − 5 f(x) = x^3 - 2x - 5 f ( x ) = x 3 − 2 x − 5 上进行,从 [ 2 , 3 ] [2, 3] [ 2 , 3 ] 开始(例 3.5)。
(a) 进行四步,给出括号 [ a 4 , b 4 ] 。 [a_4, b_4]\mathclose{\text{。}} [ a 4 , b 4 ] 。
(b) 定理 3.7 保证关于中点 m 4 m_4 m 4 的什么?与根 c ≈ 2.0946 c \approx 2.0946 c ≈ 2.0946 进行比较。
(c) 从 [ 2 , 3 ] [2, 3] [ 2 , 3 ] 出发需要多少步才能保证中点 m n m_n m n 在根的 10 − 4 10^{-4} 1 0 − 4 范围内?
查看解答✓ 已检验
(a) f ( 2 ) = − 1 < 0 f(2) = -1 < 0 f ( 2 ) = − 1 < 0 和 f ( 3 ) = 16 > 0 。 f(3) = 16 > 0\mathclose{\text{。}} f ( 3 ) = 16 > 0 。 每一步比较 f ( m n ) f(m_n) f ( m n ) 与 f ( a n ) f(a_n) f ( a n ) 的符号。后者始终为负,因为 a n a_n a n 只移动到 f f f 为负的中点(f f f 保留四位有效数字):
n n n
a n a_n a n
b n b_n b n
m n m_n m n
f ( m n ) f(m_n) f ( m n )
0
2
3
2.5
5.625
1
2
2.5
2.25
1.891
2
2
2.25
2.125
0.3457
3
2
2.125
2.0625
−0.3513
前三个中点给出正值,因此每个都替换 b ; b\mathclose{\text{;}} b ; 第四个给出负值并替换 a 。 a\mathclose{\text{。}} a 。 因此 [ a 4 , b 4 ] = [ 2.0625 , 2.125 ] , [a_4, b_4] = [2.0625, 2.125]\mathclose{\text{,}} [ a 4 , b 4 ] = [ 2.0625 , 2.125 ] , 宽度为 1 16 = 0.0625 。 \tfrac{1}{16} = 0.0625\mathclose{\text{。}} 16 1 = 0.0625 。
(b) 中点 m 4 = 2.09375 m_4 = 2.09375 m 4 = 2.09375 在根的 3 − 2 2 5 = 1 32 = 0.03125 \dfrac{3 - 2}{2^5} = \dfrac{1}{32} = 0.03125 2 5 3 − 2 = 32 1 = 0.03125 范围内。实际上根约为 2.0946,因此误差约为 0.0008。
(c) 定理 3.7 需要 1 2 n + 1 ≤ 10 − 4 , \dfrac{1}{2^{n+1}} \le 10^{-4}\mathclose{\text{,}} 2 n + 1 1 ≤ 1 0 − 4 , 即 2 n + 1 ≥ 10,000 。 2^{n+1} \ge 10{,}000\mathclose{\text{。}} 2 n + 1 ≥ 10 , 000 。 由于 2 13 = 8192 2^{13} = 8192 2 13 = 8192 太小,而 2 14 = 16,384 2^{14} = 16{,}384 2 14 = 16 , 384 足够大,因此 n + 1 = 14 : n + 1 = 14\mathclose{\text{:}} n + 1 = 14 : 13 步。
练习 3.5 ★★ 极值存在与否
对每个函数和区间,判断极值定理是否适用。然后找出最大值和最小值,或解释为何不存在。
(a) f ( x ) = 4 x − x 2 f(x) = 4x - x^2 f ( x ) = 4 x − x 2 on [ 0 , 3 ] [0, 3] [ 0 , 3 ]
(b) g ( x ) = 1 x 2 g(x) = \dfrac{1}{x^2} g ( x ) = x 2 1 在 [ − 1 , 1 ] [-1, 1] [ − 1 , 1 ] 上,其中 g g g 在 0 处未定义
(c) h ( x ) = x 2 h(x) = x^2 h ( x ) = x 2 在 ( − 1 , 2 ) (-1, 2) ( − 1 , 2 ) 上
(d) ⌊ x ⌋ \lfloor x\rfloor ⌊ x ⌋ 在 [ 0 , 2 ] [0, 2] [ 0 , 2 ] 上
查看解答✓ 已检验
(a) f f f 是一个多项式,在闭区间 [ 0 , 3 ] [0, 3] [ 0 , 3 ] 上连续:定理适用。完成平方: f ( x ) = 4 − ( x − 2 ) 2 。 f(x) = 4 - (x - 2)^2\mathclose{\text{。}} f ( x ) = 4 − ( x − 2 ) 2 。 最大值为 f ( 2 ) = 4 , f(2) = 4\mathclose{\text{,}} f ( 2 ) = 4 , 此时平方为 0。平方最大值出现在 x x x 最远离 2 处,即 x = 0 , x = 0\mathclose{\text{,}} x = 0 , 因此最小值为 f ( 0 ) = 0 f(0) = 0 f ( 0 ) = 0 (在另一端 f ( 3 ) = 3 f(3) = 3 f ( 3 ) = 3 处)。
(b) g g g 在 0 处未定义,而 0 位于 [ − 1 , 1 ] [-1, 1] [ − 1 , 1 ] 中,因此在该点不连续:定理不适用。没有最大值,因为 g ( x ) → ∞ g(x) \to \infty g ( x ) → ∞ 作为 x → 0 。 x \to 0\mathclose{\text{。}} x → 0 。 但存在最小值:对于 0 < ∣ x ∣ ≤ 1 , 0 < \abs{x} \le 1\mathclose{\text{,}} 0 < ∣ x ∣ ≤ 1 , x 2 ≤ 1 , x^2 \le 1\mathclose{\text{,}} x 2 ≤ 1 , 所以 1 x 2 ≥ 1 , \dfrac{1}{x^2} \ge 1\mathclose{\text{,}} x 2 1 ≥ 1 , 当 x = ± 1 x = \pm1 x = ± 1 时取等号。最小值为 1。
(c) h h h 是连续的,但 ( − 1 , 2 ) (-1, 2) ( − 1 , 2 ) 是开区间,因此定理不适用。由于 x 2 ≥ 0 , x^2 \ge 0\mathclose{\text{,}} x 2 ≥ 0 , 最小值为 h ( 0 ) = 0 。 h(0) = 0\mathclose{\text{。}} h ( 0 ) = 0 。 最大值不存在:对 ( − 1 , 2 ) (-1, 2) ( − 1 , 2 ) 内的任意 x , x\mathclose{\text{,}} x , 均有 x 2 < 4 ; x^2 < 4\mathclose{\text{;}} x 2 < 4 ; 当 x → 2 − x \to 2^- x → 2 − 时函数值趋近于 4,因此对于任一候选值 h ( x 0 ) , h(x_0)\mathclose{\text{,}} h ( x 0 ) , 在更接近 2 的点处都能找到更大的 h 。 h\mathclose{\text{。}} h 。
(d) ⌊ x ⌋ \lfloor x\rfloor ⌊ x ⌋ 在 1 处跳跃,在 2 处不从左侧连续(lim x → 2 − ⌊ x ⌋ = 1 ≠ 2 ), \lim_{x\to2^-}\lfloor x\rfloor = 1 \ne 2\mathclose{\text{),}} lim x → 2 − ⌊ x ⌋ = 1 = 2 ), 因此它在 [ 0 , 2 ] [0, 2] [ 0 , 2 ] 上不连续:定理不适用。然而极值存在:值为 0(在 [ 0 , 1 ) ), [0, 1)\mathclose{\text{),}} [ 0 , 1 ) ), 1(在 [ 1 , 2 ) ) [1, 2)\mathclose{\text{)}} [ 1 , 2 ) ) 和 2(在 x = 2 ), x = 2\mathclose{\text{),}} x = 2 ), 因此最大值为 2,最小值为 0。
部分 (b)、(c) 和 (d) 表明假设条件是充分的,而非必要的:当它们不成立时,极值可能存在也可能不存在。
练习 3.6 ★★ 垂直渐近线
(a) 找出 f ( x ) = x + 2 x 2 + x − 2 f(x) = \dfrac{x + 2}{x^2 + x - 2} f ( x ) = x 2 + x − 2 x + 2 的垂直渐近线,并写出每个渐近点的单侧极限,以及图像中的任何间断点。
(b) 找出 lim x → 0 + e 1 / x \displaystyle\lim_{x\to0^+} e^{1/x} x → 0 + lim e 1/ x 和 lim x → 0 − e 1 / x 。 \displaystyle\lim_{x\to0^-} e^{1/x}\mathclose{\text{。}} x → 0 − lim e 1/ x 。 在 0 处 e 1 / x e^{1/x} e 1/ x 有什么类型的间断点?其图像是否有水平渐近线?
查看解答✓ 已检验
(a) 分解分母:x 2 + x − 2 = ( x + 2 ) ( x − 1 ) 。 x^2 + x - 2 = (x + 2)(x - 1)\mathclose{\text{。}} x 2 + x − 2 = ( x + 2 ) ( x − 1 ) 。 因此 f f f 在 − 2 -2 − 2 和 1 处未定义,并且对于所有其他 x x x
f ( x ) = x + 2 ( x + 2 ) ( x − 1 ) = 1 x − 1 . f(x) = \frac{x + 2}{(x + 2)(x - 1)} = \frac{1}{x - 1}. f ( x ) = ( x + 2 ) ( x − 1 ) x + 2 = x − 1 1 .
在 − 2 -2 − 2 处因子约去,且 lim x → − 2 f ( x ) = 1 − 3 = − 1 3 : \lim_{x\to-2} f(x) = \dfrac{1}{-3} = -\dfrac13\mathclose{\text{:}} lim x → − 2 f ( x ) = − 3 1 = − 3 1 : 在 ( − 2 , − 1 3 ) \big(-2, -\tfrac13\big) ( − 2 , − 3 1 ) 处有一个孔,而不是渐近线。在 1 处,分子为 1,分母 x − 1 x - 1 x − 1 趋于 0,右侧为正,左侧为负,因此根据定理 3.9
lim x → 1 + f ( x ) = ∞ , lim x → 1 − f ( x ) = − ∞ , \begin{aligned} \lim_{x\to1^+} f(x) &= \infty, \\ \lim_{x\to1^-} f(x) &= -\infty, \end{aligned} x → 1 + lim f ( x ) x → 1 − lim f ( x ) = ∞ , = − ∞ ,
且 x = 1 x = 1 x = 1 是唯一的垂直渐近线。
(b) 当 x → 0 + x \to 0^+ x → 0 + 时, u = 1 x u = \dfrac1x u = x 1 无界增长, e u e^u e u (第 3.7 节)也无界增长: lim x → 0 + e 1 / x = ∞ 。 \lim_{x\to0^+} e^{1/x} = \infty\mathclose{\text{。}} lim x → 0 + e 1/ x = ∞ 。 当 x → 0 − x \to 0^- x → 0 − 时, u = 1 x u = \dfrac1x u = x 1 趋于 − ∞ , -\infty\mathclose{\text{,}} − ∞ , 且 e u → 0 : e^u \to 0\mathclose{\text{:}} e u → 0 : lim x → 0 − e 1 / x = 0 。 \lim_{x\to0^-} e^{1/x} = 0\mathclose{\text{。}} lim x → 0 − e 1/ x = 0 。 由于一侧极限为无穷大,0 是无穷间断点,且 x = 0 x = 0 x = 0 是垂直渐近线,仅在右侧存在。当 x → ± ∞ x \to \pm\infty x → ± ∞ 时, 1 x → 0 \dfrac1x \to 0 x 1 → 0 和 e u e^u e u 在 0 处连续,因此 e 1 / x → e 0 = 1 e^{1/x} \to e^0 = 1 e 1/ x → e 0 = 1 (定理 3.4):直线 y = 1 y = 1 y = 1 是左右两端的水平渐近线。
练习 3.7 ★★ 无穷远处的极限
求
(a) lim x → ∞ 2 x 3 − x 4 x 3 + 5 x 2 + 1 \displaystyle\lim_{x\to\infty}\frac{2x^3 - x}{4x^3 + 5x^2 + 1} x → ∞ lim 4 x 3 + 5 x 2 + 1 2 x 3 − x
(b) lim x → − ∞ 3 x + 1 x 2 + 4 \displaystyle\lim_{x\to-\infty}\frac{3x + 1}{\sqrt{x^2 + 4}} x → − ∞ lim x 2 + 4 3 x + 1
(c) lim x → ∞ ( x 2 + x − x ) 。 \displaystyle\lim_{x\to\infty}\Big(\sqrt{x^2 + x} - x\Big)\mathclose{\text{。}} x → ∞ lim ( x 2 + x − x ) 。 (提示:将 x 2 + x + x \sqrt{x^2 + x} + x x 2 + x + x 相乘并相除。)
查看解答✓ 已检验
(a) 角度相等,因此将分子和分母都除以 x 3 : x^3\mathclose{\text{:}} x 3 :
2 x 3 − x 4 x 3 + 5 x 2 + 1 = 2 − 1 / x 2 4 + 5 / x + 1 / x 3 → 2 4 = 1 2 . \begin{aligned} &\frac{2x^3 - x}{4x^3 + 5x^2 + 1} \\ &\quad= \frac{2 - 1/x^2}{4 + 5/x + 1/x^3} \to \frac{2}{4} = \frac12. \end{aligned} 4 x 3 + 5 x 2 + 1 2 x 3 − x = 4 + 5/ x + 1/ x 3 2 − 1/ x 2 → 4 2 = 2 1 .
(b) 对于 x < 0 , x < 0\mathclose{\text{,}} x < 0 , x 2 + 4 = ∣ x ∣ 1 + 4 / x 2 = − x 1 + 4 / x 2 。 \sqrt{x^2 + 4} = \abs{x}\sqrt{1 + 4/x^2} = -x\sqrt{1 + 4/x^2}\mathclose{\text{。}} x 2 + 4 = ∣ x ∣ 1 + 4/ x 2 = − x 1 + 4/ x 2 。 将分子和分母都除以 − x , -x\mathclose{\text{,}} − x , 它是正数,
3 x + 1 x 2 + 4 = 3 x + 1 − x 1 + 4 / x 2 = − 3 + 1 / x 1 + 4 / x 2 → − 3 1 = − 3. \begin{aligned} \frac{3x + 1}{\sqrt{x^2 + 4}} &= \frac{3x + 1}{-x\sqrt{1 + 4/x^2}} \\ &= -\frac{3 + 1/x}{\sqrt{1 + 4/x^2}} \\ &\to -\frac{3}{1} = -3. \end{aligned} x 2 + 4 3 x + 1 = − x 1 + 4/ x 2 3 x + 1 = − 1 + 4/ x 2 3 + 1/ x → − 1 3 = − 3.
常见的错误答案 3 忽略了 x 2 = ∣ x ∣ = − x \sqrt{x^2} = \abs{x} = -x x 2 = ∣ x ∣ = − x 对于负 x x x 的情况。(当 x → ∞ x \to \infty x → ∞ 时极限为 3。)
(c) x 2 + x \sqrt{x^2 + x} x 2 + x 和 x x x 都趋于 ∞ , \infty\mathclose{\text{,}} ∞ , 而 “∞ − ∞ \infty - \infty ∞ − ∞ ” 没有决定作用,因此需要有理化,如模块 2 所示。对于 x > 0 , x > 0\mathclose{\text{,}} x > 0 , 写成 s = x 2 + x , s = \sqrt{x^2 + x}\mathclose{\text{,}} s = x 2 + x , 使得 s 2 = x 2 + x 。 s^2 = x^2 + x\mathclose{\text{。}} s 2 = x 2 + x 。 将分子和分母乘以 s + x , s + x\mathclose{\text{,}} s + x , 并将分子上的平方差展开:
s − x = ( s − x ) ( s + x ) s + x = s 2 − x 2 s + x = x s + x . \begin{aligned} s - x &= \frac{(s - x)(s + x)}{s + x} \\ &= \frac{s^2 - x^2}{s + x} = \frac{x}{s + x}. \end{aligned} s − x = s + x ( s − x ) ( s + x ) = s + x s 2 − x 2 = s + x x .
将 s = x 2 + x s = \sqrt{x^2 + x} s = x 2 + x 恢复,并将分子和分母都除以 x , x\mathclose{\text{,}} x , 使用 x 2 + x = x 1 + 1 / x \sqrt{x^2 + x} = x\sqrt{1 + 1/x} x 2 + x = x 1 + 1/ x 表示 x > 0 : x > 0\mathclose{\text{:}} x > 0 :
x x 2 + x + x = 1 1 + 1 / x + 1 → 1 1 + 1 = 1 2 . \begin{aligned} \frac{x}{\sqrt{x^2 + x} + x} &= \frac{1}{\sqrt{1 + 1/x} + 1} \\ &\to \frac{1}{1 + 1} = \frac12. \end{aligned} x 2 + x + x x = 1 + 1/ x + 1 1 → 1 + 1 1 = 2 1 .
答案是 1 2 , \tfrac12\mathclose{\text{,}} 2 1 , 而不是 0:两个项一起增长,它们的差趋于 1 2 。 \tfrac12\mathclose{\text{。}} 2 1 。 在计算机上,原式也是数值危险的。对于大的 x , x\mathclose{\text{,}} x , 它会减去两个几乎相等的数,模块 2 的消去会破坏精度;重写后的形式则保留了精度:
Python 复制
import math
for x in (1e4 , 1e8 , 1e16 ):
print (x, math.sqrt (x*x + x) - x, 1 /(math.sqrt (1 + 1 /x) + 1 ))
输出
10000.0 0.49998750062513864 0.49998750062496095
100000000.0 0.5 0.49999999875
1e+16 2.0 0.5
在 x = 10 16 x = 10^{16} x = 1 0 16 处,原式给出 2.0,而改写后的形式给出正确的 0.5。
练习 3.8 ★★ 斜渐近线
设 f ( x ) = 2 x 2 − 3 x + 1 x + 1 。 f(x) = \dfrac{2x^2 - 3x + 1}{x + 1}\mathclose{\text{。}} f ( x ) = x + 1 2 x 2 − 3 x + 1 。
(a) 将 f ( x ) f(x) f ( x ) 写成 m x + c + d x + 1 mx + c + \dfrac{d}{x + 1} m x + c + x + 1 d 的形式。
(b) 找出图像的渐近线,并说明图像在斜渐近线的哪一侧。
(c) 找出图像与坐标轴的交点,并描述其形状。
查看解答✓ 已检验
(a) 用长除法将 2 x 2 − 3 x + 1 2x^2 - 3x + 1 2 x 2 − 3 x + 1 除以 x + 1 。 x + 1\mathclose{\text{。}} x + 1 。 首先 2 x 2 ÷ x = 2 x , 2x^2 \div x = 2x\mathclose{\text{,}} 2 x 2 ÷ x = 2 x , 并 2 x ( x + 1 ) = 2 x 2 + 2 x ; 2x(x + 1) = 2x^2 + 2x\mathclose{\text{;}} 2 x ( x + 1 ) = 2 x 2 + 2 x ; 相减后余 − 5 x + 1 。 -5x + 1\mathclose{\text{。}} − 5 x + 1 。 接着 − 5 x ÷ x = − 5 , -5x \div x = -5\mathclose{\text{,}} − 5 x ÷ x = − 5 , 并 − 5 ( x + 1 ) = − 5 x − 5 ; -5(x + 1) = -5x - 5\mathclose{\text{;}} − 5 ( x + 1 ) = − 5 x − 5 ; 相减后余数为 6。因此 2 x 2 − 3 x + 1 = ( x + 1 ) ( 2 x − 5 ) + 6 , 2x^2 - 3x + 1 = (x + 1)(2x - 5) + 6\mathclose{\text{,}} 2 x 2 − 3 x + 1 = ( x + 1 ) ( 2 x − 5 ) + 6 , 且对于 x ≠ − 1 x \ne -1 x = − 1
f ( x ) = 2 x − 5 + 6 x + 1 . f(x) = 2x - 5 + \frac{6}{x + 1}. f ( x ) = 2 x − 5 + x + 1 6 .
通过展开检查:( x + 1 ) ( 2 x − 5 ) + 6 = 2 x 2 − 3 x − 5 + 6 = 2 x 2 − 3 x + 1 。 (x + 1)(2x - 5) + 6 = 2x^2 - 3x - 5 + 6 = 2x^2 - 3x + 1\mathclose{\text{。}} ( x + 1 ) ( 2 x − 5 ) + 6 = 2 x 2 − 3 x − 5 + 6 = 2 x 2 − 3 x + 1 。
(b) 当 x → ± ∞ , x \to \pm\infty\mathclose{\text{,}} x → ± ∞ , 6 x + 1 → 0 , \dfrac{6}{x + 1} \to 0\mathclose{\text{,}} x + 1 6 → 0 , 所以 y = 2 x − 5 y = 2x - 5 y = 2 x − 5 是在两端的斜渐近线。对于 x > − 1 , x > -1\mathclose{\text{,}} x > − 1 , 6 x + 1 > 0 \dfrac{6}{x + 1} > 0 x + 1 6 > 0 和图像位于其上方;对于 x < − 1 , x < -1\mathclose{\text{,}} x < − 1 , 位于其下方。在 x = − 1 x = -1 x = − 1 处,分子是 2 + 3 + 1 = 6 ≠ 0 , 2 + 3 + 1 = 6 \ne 0\mathclose{\text{,}} 2 + 3 + 1 = 6 = 0 , 因此根据定理 3.9 lim x → − 1 + f ( x ) = ∞ \lim_{x\to-1^+} f(x) = \infty lim x → − 1 + f ( x ) = ∞ 和 lim x → − 1 − f ( x ) = − ∞ : \lim_{x\to-1^-} f(x) = -\infty\mathclose{\text{:}} lim x → − 1 − f ( x ) = − ∞ : x = − 1 x = -1 x = − 1 是垂直渐近线。没有水平渐近线,因为 f ( x ) → ± ∞ f(x) \to \pm\infty f ( x ) → ± ∞ 当 x → ± ∞ 。 x \to \pm\infty\mathclose{\text{。}} x → ± ∞ 。
(c) f ( x ) = 0 f(x) = 0 f ( x ) = 0 在 2 x 2 − 3 x + 1 = ( 2 x − 1 ) ( x − 1 ) = 0 2x^2 - 3x + 1 = (2x - 1)(x - 1) = 0 2 x 2 − 3 x + 1 = ( 2 x − 1 ) ( x − 1 ) = 0 处,于 x = 1 2 x = \tfrac12 x = 2 1 和 x = 1 , x = 1\mathclose{\text{,}} x = 1 , 以及 f ( 0 ) = 1 。 f(0) = 1\mathclose{\text{。}} f ( 0 ) = 1 。 因此,右支从 ∞ \infty ∞ 附近直线 x = − 1 x = -1 x = − 1 下降,穿过 y y y 轴于 1,介于 x x x 轴之间 1 2 \tfrac12 2 1 和 1 之间下探,然后沿斜渐近线回升,位于其上方。左支保持在斜渐近线下方,并随着 x → − 1 − x \to -1^- x → − 1 − 趋向 − ∞ 。 -\infty\mathclose{\text{。}} − ∞ 。
练习 3.9 ★★★ 增长阶与大 O 记号
(a) 将这些函数按增长速度从最慢到最快排列为 n → ∞ , n \to \infty\mathclose{\text{,}} n → ∞ , 并说明每项比较: n 100 , n^{100}\mathclose{\text{,}} n 100 , 2 n , 2^n\mathclose{\text{,}} 2 n , ( ln n ) 3 , (\ln n)^3\mathclose{\text{,}} ( ln n ) 3 , n log 2 n , n\log_2 n\mathclose{\text{,}} n log 2 n , n , \sqrt n\mathclose{\text{,}} n , 1.01 n , 1.01^n\mathclose{\text{,}} 1.0 1 n , n ! . n!\mathclose{\text{.}} n ! .
(b) 一个程序在输入规模为 n n n 时耗时 T ( n ) = 5 n log 2 n + 100 n T(n) = 5n\log_2 n + 100n T ( n ) = 5 n log 2 n + 100 n 微秒。证明 T ( n ) = O ( n log 2 n ) . T(n) = O(n\log_2 n)\mathclose{\text{.}} T ( n ) = O ( n log 2 n ) .
查看解答✓ 已检验
(a) 排序为
( ln n ) 3 ≪ n ≪ n log 2 n ≪ n 100 ≪ 1.01 n ≪ 2 n ≪ n ! . \begin{aligned} (\ln n)^3 &\ll \sqrt n \ll n\log_2 n \\ &\ll n^{100} \ll 1.01^n \\ &\ll 2^n \ll n!. \end{aligned} ( ln n ) 3 ≪ n ≪ n log 2 n ≪ n 100 ≪ 1.0 1 n ≪ 2 n ≪ n ! .
每个比较是一个比值,趋于 0:
( ln n ) 3 n = ( ln n n 1 / 6 ) 3 → 0 3 = 0 , \dfrac{(\ln n)^3}{\sqrt n} = \Big(\dfrac{\ln n}{n^{1/6}}\Big)^3 \to 0^3 = 0\mathclose{\text{,}} n ( ln n ) 3 = ( n 1/6 ln n ) 3 → 0 3 = 0 , 因为 ln n ≪ n 1 / 6 \ln n \ll n^{1/6} ln n ≪ n 1/6 (定理 3.11 与 p = 1 6 ) p = \tfrac16\mathclose{\text{)}} p = 6 1 ) 且 t 3 t^3 t 3 在 0 处连续(定理 3.4)。
n n log 2 n = 1 n log 2 n → 0 , \dfrac{\sqrt n}{n\log_2 n} = \dfrac{1}{\sqrt n\,\log_2 n} \to 0\mathclose{\text{,}} n log 2 n n = n log 2 n 1 → 0 , 因为分母的两个因子都趋于无穷大。
n log 2 n n 100 = 1 ln 2 ⋅ ln n n 99 → 0 , \dfrac{n\log_2 n}{n^{100}} = \dfrac{1}{\ln 2}\cdot\dfrac{\ln n}{n^{99}} \to 0\mathclose{\text{,}} n 100 n log 2 n = ln 2 1 ⋅ n 99 ln n → 0 , 因为 ln n ≪ n 99 。 \ln n \ll n^{99}\mathclose{\text{。}} ln n ≪ n 99 。
n 100 1.01 n → 0 , \dfrac{n^{100}}{1.01^n} \to 0\mathclose{\text{,}} 1.0 1 n n 100 → 0 , 因为每个幂函数的增长速度都比每个大于 1 的指数函数慢(定理 3.11 与 p = 100 , p = 100\mathclose{\text{,}} p = 100 , a = 1.01 )。 a = 1.01\mathclose{\text{)。}} a = 1.01 )。
1.01 n 2 n = 0.505 n → 0 , \dfrac{1.01^n}{2^n} = 0.505^n \to 0\mathclose{\text{,}} 2 n 1.0 1 n = 0.50 5 n → 0 , 因为是一个小于 1 的指数函数(第 3.7 节)。
2 n n ! → 0 , \dfrac{2^n}{n!} \to 0\mathclose{\text{,}} n ! 2 n → 0 , 根据定理 3.11 与 a = 2 。 a = 2\mathclose{\text{。}} a = 2 。
第四条比较仅在长期趋势中成立:n 100 n^{100} n 100 在 n n n 从 2 到 117,308 的每个值上都领先于 1.01 n 1.01^n 1.0 1 n (第 3.8 节)。
(b) 对于 n ≥ 2 , n \ge 2\mathclose{\text{,}} n ≥ 2 , log 2 n ≥ 1 , \log_2 n \ge 1\mathclose{\text{,}} log 2 n ≥ 1 , 因此 100 n ≤ 100 n log 2 n , 100n \le 100\,n\log_2 n\mathclose{\text{,}} 100 n ≤ 100 n log 2 n , 并且
T ( n ) ≤ 5 n log 2 n + 100 n log 2 n = 105 n log 2 n . \begin{aligned} T(n) &\le 5n\log_2 n + 100\,n\log_2 n \\ &= 105\,n\log_2 n. \end{aligned} T ( n ) ≤ 5 n log 2 n + 100 n log 2 n = 105 n log 2 n .
这是 T ( n ) = O ( n log 2 n ) T(n) = O(n\log_2 n) T ( n ) = O ( n log 2 n ) 的定义,包含 C = 105 C = 105 C = 105 和 N = 2 。 N = 2\mathclose{\text{。}} N = 2 。 使用极限代替:T ( n ) n log 2 n = 5 + 100 log 2 n → 5 。 \dfrac{T(n)}{n\log_2 n} = 5 + \dfrac{100}{\log_2 n} \to 5\mathclose{\text{。}} n log 2 n T ( n ) = 5 + log 2 n 100 → 5 。
练习 3.10 ★★★ 奇数次多项式
(a) 证明每个奇数次多项式至少有一个实根。
(b) 给出一个没有实根的偶数次多项式。
(c) 证明 p ( x ) = x 3 − 3 x + 1 p(x) = x^3 - 3x + 1 p ( x ) = x 3 − 3 x + 1 恰好有三个实根,并找出包含这三个实根的三个长度为 1 的区间。
查看解答✓ 已检验
(a) 设 p ( x ) = a n x n + ⋯ + a 1 x + a 0 , p(x) = a_nx^n + \dots + a_1x + a_0\mathclose{\text{,}} p ( x ) = a n x n + ⋯ + a 1 x + a 0 , 其中 n n n 为奇数且 a n ≠ 0 。 a_n \ne 0\mathclose{\text{。}} a n = 0 。 除以 a n a_n a n 不改变根,所以可取 a n = 1 。 a_n = 1\mathclose{\text{。}} a n = 1 。 多项式是分母为 1 的有理函数。由定理 3.10,当 x → ± ∞ x \to \pm\infty x → ± ∞ 时,p ( x ) p(x) p ( x ) 的行为与其最高次项 x n x^n x n 相同。由于 n n n 是奇数,当 x → ∞ x \to \infty x → ∞ 时 x n → ∞ , x^n \to \infty\mathclose{\text{,}} x n → ∞ , 当 x → − ∞ x \to -\infty x → − ∞ 时 x n → − ∞ , x^n \to -\infty\mathclose{\text{,}} x n → − ∞ , 因此
lim x → ∞ p ( x ) = ∞ , lim x → − ∞ p ( x ) = − ∞ . \begin{aligned} \lim_{x\to\infty} p(x) &= \infty, \\ \lim_{x\to-\infty} p(x) &= -\infty. \end{aligned} x → ∞ lim p ( x ) x → − ∞ lim p ( x ) = ∞ , = − ∞.
第一个极限说明对充分大的 x x x 均有 p ( x ) > 0 。 p(x) > 0\mathclose{\text{。}} p ( x ) > 0 。 取一个这样的 B , B\mathclose{\text{,}} B , 即有 p ( B ) > 0 。 p(B) > 0\mathclose{\text{。}} p ( B ) > 0 。 由第二个极限可取一个数 A < B , A < B\mathclose{\text{,}} A < B , 使得 p ( A ) < 0 。 p(A) < 0\mathclose{\text{。}} p ( A ) < 0 。 多项式 p p p 在 [ A , B ] [A, B] [ A , B ] 上连续,所以由介值定理,它在 ( A , B ) (A, B) ( A , B ) 中有一个零点。
(b) 对每个实数 x x x 均有 x 2 + 1 ≥ 1 > 0 , x^2 + 1 \ge 1 > 0\mathclose{\text{,}} x 2 + 1 ≥ 1 > 0 , 故没有实根。当 n n n 为偶数时,两端均有 x n → ∞ , x^n \to \infty\mathclose{\text{,}} x n → ∞ , 所以 (a) 的论证不再适用。
(c) 试计算 p p p 在几个整数处的值:
x x x
− 2 -2 − 2
− 1 -1 − 1
0 0 0
1 1 1
2 2 2
p ( x ) p(x) p ( x )
− 1 -1 − 1
3 3 3
1 1 1
− 1 -1 − 1
3 3 3
p p p 在 [ − 2 , − 1 ] 、 [-2, -1]\mathclose{\text{、}} [ − 2 , − 1 ] 、 [ 0 , 1 ] [0, 1] [ 0 , 1 ] 和 [ 1 , 2 ] [1, 2] [ 1 , 2 ] 上分别变号,因此由介值定理,在 ( − 2 , − 1 ) 、 (-2, -1)\mathclose{\text{、}} ( − 2 , − 1 ) 、 ( 0 , 1 ) (0, 1) ( 0 , 1 ) 和 ( 1 , 2 ) (1, 2) ( 1 , 2 ) 中各有一个零点,共至少三个零点 r 1 < r 2 < r 3 。 r_1 < r_2 < r_3\mathclose{\text{。}} r 1 < r 2 < r 3 。 下面证明没有其他零点。若多项式的一个根是 r , r\mathclose{\text{,}} r , 则它有因式 x − r x - r x − r (见第 2.5 节 ),所以 p ( x ) = ( x − r 1 ) q ( x ) , p(x) = (x - r_1)\,q(x)\mathclose{\text{,}} p ( x ) = ( x − r 1 ) q ( x ) , 其中 q q q 是首项系数为 1 的二次多项式。因为 p ( r 2 ) = 0 p(r_2) = 0 p ( r 2 ) = 0 且 r 2 ≠ r 1 , r_2 \ne r_1\mathclose{\text{,}} r 2 = r 1 , 可得 q ( r 2 ) = 0 , q(r_2) = 0\mathclose{\text{,}} q ( r 2 ) = 0 , 于是对某个数 s s s 有 q ( x ) = ( x − r 2 ) ( x − s ) 。 q(x) = (x - r_2)(x - s)\mathclose{\text{。}} q ( x ) = ( x − r 2 ) ( x − s ) 。 而 p ( r 3 ) = 0 p(r_3) = 0 p ( r 3 ) = 0 进一步要求 s = r 3 。 s = r_3\mathclose{\text{。}} s = r 3 。 所以 p ( x ) = ( x − r 1 ) ( x − r 2 ) ( x − r 3 ) p(x) = (x - r_1)(x - r_2)(x - r_3) p ( x ) = ( x − r 1 ) ( x − r 2 ) ( x − r 3 ) 在其他各点都不为零,p p p 恰有三个实根。
练习 3.11 ★★★ 夹逼定理
一位徒步者周六 7:00 从山脚出发,15:00 到达山顶。周日 7:00,她从山顶沿同一条路下山,15:00 到达山脚。两天的步速都在变化,她也会不时停下来休息。证明某一时刻,她在这两天都恰好位于山路的同一点。
查看解答✓ 已检验
用路径底部到她的位置的距离来度量她的位置,设 L L L 为路径的长度。设 u ( t ) u(t) u ( t ) 为她在周六 t t t (小时)时的位置,设 d ( t ) d(t) d ( t ) 为她在周日同一时间的位置,对于 7 ≤ t ≤ 15 。 7 \le t \le 15\mathclose{\text{。}} 7 ≤ t ≤ 15 。 两者都是 t t t 的连续函数:她不能从路径的一点直接跳到另一点。因此
g ( t ) = u ( t ) − d ( t ) g(t) = u(t) - d(t) g ( t ) = u ( t ) − d ( t )
在 [ 7 , 15 ] [7, 15] [ 7 , 15 ] 上连续(定理 3.1)。在一天开始 g ( 7 ) = u ( 7 ) − d ( 7 ) = 0 − L = − L < 0 g(7) = u(7) - d(7) = 0 - L = -L < 0 g ( 7 ) = u ( 7 ) − d ( 7 ) = 0 − L = − L < 0 和结束 g ( 15 ) = L − 0 = L > 0 g(15) = L - 0 = L > 0 g ( 15 ) = L − 0 = L > 0 时。根据中间值定理,存在 ( 7 , 15 ) (7, 15) ( 7 , 15 ) 中的一个时间 c , c\mathclose{\text{,}} c , 使得 g ( c ) = 0 , g(c) = 0\mathclose{\text{,}} g ( c ) = 0 , 即 u ( c ) = d ( c ) : u(c) = d(c)\mathclose{\text{:}} u ( c ) = d ( c ) : 在时间 c c c 时,她在两天的同一位置。
同样的论证如图所示:两位徒步者在同一天,一位按照周六的计划向上走,另一位按照周日的计划向下走,他们必定会在某个地方相遇。定理保证至少存在这样一个时间,但不保证具体何时。例如,假设周六她开始走得缓慢,其中 u ( t ) = L s 2 u(t) = Ls^2 u ( t ) = L s 2 表示 s = ( t − 7 ) / 8 s = (t - 7)/8 s = ( t − 7 ) /8 是当天徒步所经过的比例,而周日她以恒定速度向下走,即 d ( t ) = L ( 1 − s ) 。 d(t) = L(1 - s)\mathclose{\text{。}} d ( t ) = L ( 1 − s ) 。 那么 u = d u = d u = d 当 s 2 = 1 − s , s^2 = 1 - s\mathclose{\text{,}} s 2 = 1 − s , 即 s 2 + s − 1 = 0 , s^2 + s - 1 = 0\mathclose{\text{,}} s 2 + s − 1 = 0 , 其在 0 到 1 之间的解为
s = 5 − 1 2 ≈ 0.618 , t = 7 + 8 s ≈ 11.94. \begin{aligned} s &= \frac{\sqrt5 - 1}{2} \approx 0.618, \\ t &= 7 + 8s \approx 11.94. \end{aligned} s t = 2 5 − 1 ≈ 0.618 , = 7 + 8 s ≈ 11.94.
因此,大约在两天的 11:57 左右,她处于相同的位置,大约在全程的 38% 处(s 2 ≈ 0.382 )。 s^2 \approx 0.382\mathclose{\text{)。}} s 2 ≈ 0.382 )。
1 设
f ( x ) = x 2 − 1 x − 1 f(x) = \dfrac{x^2 - 1}{x - 1} f ( x ) = x − 1 x 2 − 1 对于
x ≠ 1 , x \ne 1\mathclose{\text{,}} x = 1 , 且
f ( 1 ) = 3 。 f(1) = 3\mathclose{\text{。}} f ( 1 ) = 3 。 在
x = 1 , x = 1\mathclose{\text{,}} x = 1 , f f f 为
连续,因为 f ( 1 ) f(1) f ( 1 ) 是定义的 不连续,因为 lim x → 1 f ( x ) \lim_{x\to1} f(x) lim x → 1 f ( x ) 不存在 不连续,具有可去间断点 不连续,具有跳跃间断点 对于
x ≠ 1 , x \ne 1\mathclose{\text{,}} x = 1 , f ( x ) = x + 1 , f(x) = x + 1\mathclose{\text{,}} f ( x ) = x + 1 , 所以在 1 处的极限存在且为 2。它不是
f ( 1 ) = 3 , f(1) = 3\mathclose{\text{,}} f ( 1 ) = 3 , 所以条件 3 不满足,给
f f f 在 1 处赋值 2 可以修复:可去间断点。仅定义在某点上是不够的连续性的。极限存在,这排除了第二个答案,而跳跃间断点需要左右极限不同。
2 f ( x ) = x − 1 + ln ( 4 − x ) f(x) = \sqrt{x - 1} + \ln(4 - x) f ( x ) = x − 1 + ln ( 4 − x ) 连续的最小区间是
( 1 , 4 ) (1, 4) ( 1 , 4 ) [ 1 , 4 ) [1, 4) [ 1 , 4 ) [ 1 , 4 ] [1, 4] [ 1 , 4 ] ( − ∞ , 4 ) (-\infty, 4) ( − ∞ , 4 ) 平方根需要
x ≥ 1 , x \ge 1\mathclose{\text{,}} x ≥ 1 , 且在 1 处右连续;对数需要
4 − x > 0 , 4 - x > 0\mathclose{\text{,}} 4 − x > 0 , 即
x < 4 。 x < 4\mathclose{\text{。}} x < 4 。 每个部分在其定义域内连续,因此
f f f 在其定义域
[ 1 , 4 ) [1, 4) [ 1 , 4 ) 上连续。
[ 1 , 4 ] [1, 4] [ 1 , 4 ] 包含 4,其中
ln 0 \ln 0 ln 0 未定义;
( 1 , 4 ) (1, 4) ( 1 , 4 ) 排除 1,其中
f f f 右连续;
( − ∞ , 4 ) (-\infty, 4) ( − ∞ , 4 ) 忘记了平方根。
3 函数
f f f 在
[ 1 , 4 ] [1, 4] [ 1 , 4 ] 上连续,具有
f ( 1 ) = 5 f(1) = 5 f ( 1 ) = 5 和
f ( 4 ) = − 2 。 f(4) = -2\mathclose{\text{。}} f ( 4 ) = − 2 。 哪一说法必须为真?
f ( c ) = 0 f(c) = 0 f ( c ) = 0 在 ( 1 , 4 ) (1, 4) ( 1 , 4 ) 的至少一个 c c c 处成立f ( c ) = 0 f(c) = 0 f ( c ) = 0 在 ( 1 , 4 ) (1, 4) ( 1 , 4 ) 的恰好一个 c c c 处成立f f f 是在 [ 1 , 4 ] [1, 4] [ 1 , 4 ] 上递减的f ( c ) = 6 f(c) = 6 f ( c ) = 6 对某个 c c c 在 ( 1 , 4 ) (1, 4) ( 1 , 4 ) 中成立0 位于
f ( 1 ) = 5 f(1) = 5 f ( 1 ) = 5 和
f ( 4 ) = − 2 f(4) = -2 f ( 4 ) = − 2 之间,因此根据中间值定理,至少存在一个
c c c 满足
f ( c ) = 0 。 f(c) = 0\mathclose{\text{。}} f ( c ) = 0 。 它并没有说明恰好有一个:图像可能与轴相交三次。没有任何东西迫使
f f f 一直递减。而且 6 并不在 5 和
− 2 -2 − 2 之间,因此定理对此没有说明。
4 二分法从括号
[ 0 , 3 ] [0, 3] [ 0 , 3 ] 开始。经过 8 步后,括号的宽度为
3 / 8 = 0.375 3/8 = 0.375 3/8 = 0.375 3 / 2 7 ≈ 0.0234 3/2^7 \approx 0.0234 3/ 2 7 ≈ 0.0234 0.3 / 8 = 0.0375 0.3/8 = 0.0375 0.3/8 = 0.0375 3 / 2 8 ≈ 0.0117 3/2^8 \approx 0.0117 3/ 2 8 ≈ 0.0117 每一步都将宽度减半,因此经过 8 步后宽度为
( 3 − 0 ) / 2 8 = 3 / 256 ≈ 0.0117 。 (3 - 0)/2^8 = 3/256 \approx 0.0117\mathclose{\text{。}} ( 3 − 0 ) / 2 8 = 3/256 ≈ 0.0117 。 用 8 而不是
2 8 2^8 2 8 来除,是将方法视为将区间分成 8 等分;
3 / 2 7 3/2^7 3/ 2 7 是 7 步后的宽度;而
0.3 / 8 0.3/8 0.3/8 在这里没有意义。
1 / x 1/x 1/ x 在 ( 0 , 1 ] (0, 1] ( 0 , 1 ] 上tan x \tan x tan x 在 [ 0 , π ] [0, \pi] [ 0 , π ] 上x 3 − 5 x x^3 - 5x x 3 − 5 x 在 [ − 3 , 3 ] [-3, 3] [ − 3 , 3 ] 上x x x 在 ( 0 , 1 ) (0, 1) ( 0 , 1 ) 上x 3 − 5 x x^3 - 5x x 3 − 5 x 是多项式,在闭区间
[ − 3 , 3 ] [-3, 3] [ − 3 , 3 ] 上连续,因此定理适用。
( 0 , 1 ] (0, 1] ( 0 , 1 ] 不是闭的,且
1 / x 1/x 1/ x 在 0 附近无界;
tan x \tan x tan x 在
π / 2 \pi/2 π /2 处无定义,而该点位于
[ 0 , π ] [0, \pi] [ 0 , π ] 内部;在开区间
( 0 , 1 ) (0, 1) ( 0 , 1 ) 上,
x x x 没有最大值。
6 y = x 2 − 4 x 2 − 3 x + 2 y = \dfrac{x^2 - 4}{x^2 - 3x + 2} y = x 2 − 3 x + 2 x 2 − 4 的垂直渐近线为
x = 1 x = 1 x = 1 和 x = 2 x = 2 x = 2 x = 1 x = 1 x = 1 仅x = 2 x = 2 x = 2 仅x = − 2 x = -2 x = − 2 和 x = 1 x = 1 x = 1 分解:
( x − 2 ) ( x + 2 ) ( x − 2 ) ( x − 1 ) = x + 2 x − 1 \dfrac{(x - 2)(x + 2)}{(x - 2)(x - 1)} = \dfrac{x + 2}{x - 1} ( x − 2 ) ( x − 1 ) ( x − 2 ) ( x + 2 ) = x − 1 x + 2 在
x ≠ 2 x \ne 2 x = 2 处分解。在 2 处分解因子被约去,极限为 4:一个空洞,而非渐近线。在 1 处,分子趋于 3 而分母趋于 0,因此函数值趋于无穷大。
x = − 2 x = -2 x = − 2 是函数为 0 的点,而非渐近线。
7 y = 6 x 2 + x 2 x 2 − 8 y = \dfrac{6x^2 + x}{2x^2 - 8} y = 2 x 2 − 8 6 x 2 + x 的图像具有
水平渐近线 y = 3 y = 3 y = 3 且无垂直渐近线 垂直渐近线 x = ± 2 x = \pm 2 x = ± 2 和水平渐近线 y = 0 y = 0 y = 0 垂直渐近线 x = 4 x = 4 x = 4 和水平渐近线 y = 3 y = 3 y = 3 垂直渐近线 x = ± 2 x = \pm 2 x = ± 2 和水平渐近线 y = 3 y = 3 y = 3 度数相等,因此
y → 6 / 2 = 3 y \to 6/2 = 3 y → 6/2 = 3 在两端。分母
2 ( x − 2 ) ( x + 2 ) 2(x - 2)(x + 2) 2 ( x − 2 ) ( x + 2 ) 在
± 2 \pm2 ± 2 处为 0,而分子(26 和 22)不为 0,因此两条直线都是垂直渐近线。渐近线
y = 0 y = 0 y = 0 需要分子的次数低于分母,而
x = 4 x = 4 x = 4 来自于解
2 x − 8 = 0 2x - 8 = 0 2 x − 8 = 0 而不是
2 x 2 − 8 = 0 。 2x^2 - 8 = 0\mathclose{\text{。}} 2 x 2 − 8 = 0 。
2 n = O ( n 10 ) 2^n = O(n^{10}) 2 n = O ( n 10 ) 5 n 2 + 100 n = O ( n 2 ) 5n^2 + 100n = O(n^2) 5 n 2 + 100 n = O ( n 2 ) n log 2 n = O ( n 2 ) n\log_2 n = O(n^2) n log 2 n = O ( n 2 ) ln n ≪ n \ln n \ll \sqrt n ln n ≪ n n 10 ≪ 2 n n^{10} \ll 2^n n 10 ≪ 2 n (定理 3.11),因此
2 n / n 10 2^n/n^{10} 2 n / n 10 无界增长,且没有常数
C C C 能使
2 n ≤ C n 10 2^n \le Cn^{10} 2 n ≤ C n 10 对所有足够大的
n n n 成立:
2 n 2^n 2 n 不等于
O ( n 10 ) , O(n^{10})\mathclose{\text{,}} O ( n 10 ) , 尽管
n 10 n^{10} n 10 在 2 到 58 的每个
n n n 中更大。其余三个陈述为真:
5 n 2 + 100 n ≤ 105 n 2 5n^2 + 100n \le 105n^2 5 n 2 + 100 n ≤ 105 n 2 对
n ≥ 1 ; n \ge 1\mathclose{\text{;}} n ≥ 1 ; n log 2 n ≤ n 2 n\log_2 n \le n^2 n log 2 n ≤ n 2 因为
log 2 n ≤ n ; \log_2 n \le n\mathclose{\text{;}} log 2 n ≤ n ; 和
ln n / n → 0 。 \ln n/\sqrt n \to 0\mathclose{\text{。}} ln n / n → 0 。
重新作答