微积分是关于变化的数学。每当一个量发生变化(汽车的位置、一杯茶的温度、机器学习模型在训练过程中的误差),微积分都会对它提出两个问题:
它在这一刻变化得有多快? 答案是一个变化率 。
在一段时间内,当变化率本身持续变化时,累积了多少 ?答案是累积量 。
打个比方
汽车的仪表盘回答了这两个问题。速度计显示当前距离变化的快慢;里程表显示累积的距离总量。将速度计的读数随时间累加,即可得到里程表的读数;询问里程表读数的增长速率,即可得到速度计的读数。微积分将这两个过程分别称为积分 和微分 ,其核心定理——微积分基本定理(模块10)——指出,这两个过程互为逆运算。
切线问题与面积问题
这两个问题转化为关于图形的两个问题(图1.1)。
切线问题。 直线只有一个斜率,但曲线在某些地方比另一些地方更陡峭。曲线在点 P P P 处的斜率是多少?画出通过 P P P 和曲线上的另一点 Q Q Q 的直线,即一条割线 ;其斜率易于计算。现在让 Q Q Q 沿曲线向 P P P 滑动。割线收敛于一条直线,即 P P P 处的切线 ,其斜率即为曲线在 P P P 处的斜率。在距离对时间的图像上,该斜率即为该时刻的速度。
面积问题。 曲线在 x = a x = a x = a 和 x = b x = b x = b 之间的下方区域面积是多少?用细长的矩形填充该区域:它们的总面积易于计算且接近所需面积。矩形越细,贴合得越好,而面积即为它们总和所趋近的那个数值。在速度对时间的图像上,该面积即为行驶的距离。
图 1.1 微积分的两个问题。左图:当 Q Q Q 沿曲线向 P P P 滑动时,通过 P P P 和 Q Q Q 的割线趋近于 P P P 处的切线。右图:当曲线在 a a a 和 b b b 之间的下方矩形变细时,它们的总面积趋近于曲线下的面积。
这两个问题都通过同一个新思想解决:逐步改进近似值(割线的斜率、矩形的总面积),并询问这些近似值趋近于哪个数。这个数是极限 ,即模块2的主题。切线的斜率是导数 (该系列的第二部分);面积是积分 (第三部分)。
简短的历史
面积问题由来已久。公元前3世纪的阿基米德使用穷竭法求出了面积和体积,用更简单的形状来近似一个区域,这些形状越来越完全地填充该区域:这是图1.1中矩形的祖先。
作为一种通用方法的微积分在17世纪出现,由两位独立工作的人提出。牛顿在1665–1666年发展了他所称的流数法,但发表较晚。莱布尼茨在1684年发表了微分积分学的第一份报告,在1686年发表了积分积分学;他的符号,带有d x dx d x 和∫ , \int\mathclose{\text{,}} ∫ , 是今天使用的符号。随后发生的优先权争议非常激烈。后来,1820年代的柯西和1860年代及1870年代的魏尔斯特拉斯为微积分奠定了严格的基础,即模块2介绍的极限的ε–δ定义,黎曼在1854年定义了他名字的积分(发表于1868年)。
微积分的应用
在科学中,速度是位置的变化率,加速度是速度的变化率,因此运动定律,如冷却和放射性衰变的定律,都是关于变化率的陈述:微分方程(模块13)。在工程中,电流是电荷的变化率,梁、控制系统和信号滤波器则用导数和积分来描述。在计算领域,机器学习通过梯度下降 训练模型,反复调整其参数以沿使误差减小最快的方向进行,该方向由导数计算得出(模块8和17);反向传播用于计算神经网络中的这些导数,其本质是链式法则(模块5和17)。
所有这些量都是其他某个量的函数,因此本模块研究函数(第1.3节至第1.5节),然后迈出导数概念的第一步(第1.6节)。
每个概念的呈现顺序相同:一张图片或一张数字表、一个精确定义、已解决的示例,以及学习者常犯的错误。主要定理均经过证明;更难的证明和扩展内容位于深入一步 方框中,初次阅读时可跳过。
页面使用以下方框:
方框
其包含内容
定义 、定理 、示例
一个新术语、一个精确陈述、一个已解决的示例
证明
定理为何成立;以 ∎ 结尾
核心思想 ,提示 ,扩展知识
需要记住的要点、实用建议、旁注
注意
常见错误、错误原因及修正方法
可以这样理解
类比
深入一步
选学内容,难度较高
试一试
用于实验的交互式图表
动手计算
可选的 Python 代码
方框、章节和图表按模块编号:定义 1.2 是模块 1 中的第二个定义,图 1.3 是其第三个图。
已检验标记。 带有 ✓ 已检验标记的工作示例和习题解答,其结果及推导步骤均使用 SymPy(一种计算机代数系统)进行了验证。数值表由公式计算得出,图形通过绘制其所展示的函数生成。
习题与测验。 每个模块以总结、10 至 12 道习题和 8 道测验题结束。习题分为三个层级:★ 检验理解,★★ 应用,★★★ 拓展(证明、较难问题或应用)。每道习题在** 查看解答** 下均提供完整的工作解答:请先尝试解答习题。
所需物品。 纸、铅笔和科学计算器(设置为弧度制,第 1.4 节解释了原因)。Python 为可选:第 1.7 节 展示了如何安装它,且“动手计算”框中的所有内容均为代码打印的输出。即使不使用 Python,本系列的其他部分也易于理解。
如果你的代数知识有所生疏,请先学习 可选代数复习 计算机科学与人工智能的数学基础。该系列还包含旨在计算的简明微积分模块,从 其第 15 模块 开始;本系列为完整课程。
提示
边读边用铅笔。当示例展示某一步骤时,请在继续阅读前自行完成该步骤;当提示“展开并合并”时,请执行展开操作。
从静止状态释放一个小球。在地球表面附近,如果空气阻力可以忽略不计,那么经过 t t t 秒后它下落的距离是
s ( t ) = 4.9 t 2 metres . s(t) = 4.9t^2 \text{ metres}. s ( t ) = 4.9 t 2 metres .
(4.9 是 g ≈ 9.8 g \approx 9.8 g ≈ 9.8 m/s²,即重力加速度,的一半。)以下是每隔半秒的距离:
t t t 0 0 0 0.5 0.5 0.5 1 1 1 1.5 1.5 1.5 2 2 2 2.5 2.5 2.5 3 3 3 s ( t ) s(t) s ( t ) 0 0 0 1.225 1.225 1.225 4.9 4.9 4.9 11.025 11.025 11.025 19.6 19.6 19.6 30.625 30.625 30.625 44.1 44.1 44.1
每个 t t t 都恰好对应一个距离 s ( t ) 。 s(t)\mathclose{\text{。}} s ( t ) 。 这正是使 s s s 成为函数的原因。
定义 1.1函数
一个 函数 f f f 是一个规则,它为集合 D D D 中的每个数 x x x 分配恰好一个数 f ( x ) 。 f(x)\mathclose{\text{。}} f ( x ) 。 集合 D D D 是 f f f 的定义域 。数 f ( x ) , f(x)\mathclose{\text{,}} f ( x ) , 读作“f of x”,是 f f f 在 x x x 处的值 。当 x x x 遍历定义域时,所有值 f ( x ) f(x) f ( x ) 的集合是 f f f 的值域 。
输入 x x x 是 自变量 ,输出 y = f ( x ) y = f(x) y = f ( x ) 是 因变量 。在本系列的第 I 至 IV 部分中,输入和输出均为实数,仅在模块 15 中涉及复数;所有实数的集合记为 R 。 \R\mathclose{\text{。}} R 。 若 x x x 属于集合 D , D\mathclose{\text{,}} D , 记作 x ∈ D , x \in D\mathclose{\text{,}} x ∈ D , 读作“x 属于 D”。
“恰好一个”是定义的核心。规则“平方等于 x x x 的数”不是函数:对于 x = 9 , x = 9\mathclose{\text{,}} x = 9 , 它给出两个数,3 和 − 3 。 -3\mathclose{\text{。}} − 3 。 然而,函数可能对不同的输入给出相同的输出:x 2 x^2 x 2 对 x = 2 x = 2 x = 2 和 x = − 2 x = -2 x = − 2 均给出 4。
区间
定义域和值域通常是区间:两个端点之间的所有实数。
定义 1.2区间
对于实数 a < b : a < b\mathclose{\text{:}} a < b :
区间
满足以下条件的数 x : x\mathclose{\text{:}} x :
[ a , b ] [a, b] [ a , b ]
a ≤ x ≤ b a \le x \le b a ≤ x ≤ b
( a , b ) (a, b) ( a , b )
a < x < b a < x < b a < x < b
[ a , b ) [a, b) [ a , b )
a ≤ x < b a \le x < b a ≤ x < b
( a , b ] (a, b] ( a , b ]
a < x ≤ b a < x \le b a < x ≤ b
[ a , ∞ ) [a, \infty) [ a , ∞ )
x ≥ a x \ge a x ≥ a
( a , ∞ ) (a, \infty) ( a , ∞ )
x > a x > a x > a
( − ∞ , b ] (-\infty, b] ( − ∞ , b ]
x ≤ b x \le b x ≤ b
( − ∞ , b ) (-\infty, b) ( − ∞ , b )
x < b x < b x < b
( − ∞ , ∞ ) (-\infty, \infty) ( − ∞ , ∞ )
每个实数 x : x\mathclose{\text{:}} x : 即 R \R R
方括号表示端点属于该区间;圆括号表示端点不属于该区间。
[ a , b ] [a, b] [ a , b ] 是闭区间 ,读作“从a到b的闭区间”;( a , b ) (a, b) ( a , b ) 是开区间 。符号∞ \infty ∞ 读作“无穷大”,不是一个数:[ a , ∞ ) [a, \infty) [ a , ∞ ) 是“所有x ≥ a ” x \ge a\mathclose{\text{”}} x ≥ a ” 的简写,因此∞ \infty ∞ 旁边的括号总是圆括号。要合并区间,使用∪ , \cup\mathclose{\text{,}} ∪ , 读作“并集”:( − ∞ , 2 ) ∪ ( 2 , ∞ ) (-\infty, 2) \cup (2, \infty) ( − ∞ , 2 ) ∪ ( 2 , ∞ ) 是任一区间中的数的集合,即除了2以外的所有实数。
注意
将[ 3 , ∞ ) [3, \infty) [ 3 , ∞ ) 写作“x > 3 ”。 x > 3\mathclose{\text{”。}} x > 3 ” 。 3不包含在内,因此其括号必须是圆括号:( 3 , ∞ ) 。 (3, \infty)\mathclose{\text{。}} ( 3 , ∞ ) 。 且永远不要写[ 3 , ∞ ] : [3, \infty]\mathclose{\text{:}} [ 3 , ∞ ] : ∞ \infty ∞ 不是一个数,因此它不能属于任何区间。
公式的定义域
当函数由公式给出且未提及定义域时,约定如下:
要点
公式的定义域是使公式给出实数的所有实数的集合。要找到它,寻找可能出错的地方:到目前为止,除以零 和负数的平方根 (更一般地,任何偶次根)。第1.4节增加了第三种情况:对数 ,其参数不是正数。
模型的定义域可以比其公式的定义域更小。s ( t ) = 4.9 t 2 s(t) = 4.9t^2 s ( t ) = 4.9 t 2 对每个实数 t t t 都有定义,但作为下落小球的描述,它仅适用于从 t = 0 t = 0 t = 0 (小球被释放时)到小球落地这一时间段。
例 1.1公式的定义域 ✓ 已检验
求每个函数的定义域,使用区间表示法。
(a) f ( x ) = 1 x − 2 f(x) = \dfrac{1}{x - 2} f ( x ) = x − 2 1
(b) g ( x ) = 3 − x g(x) = \sqrt{3 - x} g ( x ) = 3 − x
(c) h ( x ) = x x − 1 h(x) = \dfrac{\sqrt{x}}{x - 1} h ( x ) = x − 1 x
(a) 唯一的危险是除以零,这发生在 x − 2 = 0 x - 2 = 0 x − 2 = 0 时,即在 x = 2 x = 2 x = 2 处。其他所有数字均被允许:定义域为 ( − ∞ , 2 ) ∪ ( 2 , ∞ ) 。 (-\infty, 2) \cup (2, \infty)\mathclose{\text{。}} ( − ∞ , 2 ) ∪ ( 2 , ∞ ) 。
(b) 平方根需要 3 − x ≥ 0 , 3 - x \ge 0\mathclose{\text{,}} 3 − x ≥ 0 , 即 x ≤ 3 x \le 3 x ≤ 3 (两边同时加上 x )。 x\mathclose{\text{)。}} x )。 定义域为 ( − ∞ , 3 ] 。 (-\infty, 3]\mathclose{\text{。}} ( − ∞ , 3 ] 。 包含 3,因为 0 = 0 。 \sqrt{0} = 0\mathclose{\text{。}} 0 = 0 。
(c) 两个条件:x \sqrt{x} x 需要 x ≥ 0 , x \ge 0\mathclose{\text{,}} x ≥ 0 , 且分母需要 x ≠ 1 。 x \ne 1\mathclose{\text{。}} x = 1 。 两者必须同时成立,因此定义域为 [ 0 , 1 ) ∪ ( 1 , ∞ ) 。 [0, 1) \cup (1, \infty)\mathclose{\text{。}} [ 0 , 1 ) ∪ ( 1 , ∞ ) 。
求值域需要更多工作,因为你必须找出哪些输出值实际上会出现。这需要两个论证:你声称的集合中的每个值都落在该集合中,且该集合中的每个数字都是一个函数值。
例 1.2半圆的定义域和值域 ✓ 已检验
求 f ( x ) = 4 − x 2 f(x) = \sqrt{4 - x^2} f ( x ) = 4 − x 2 的定义域和值域。
定义域。 平方根需要 4 − x 2 ≥ 0 , 4 - x^2 \ge 0\mathclose{\text{,}} 4 − x 2 ≥ 0 , 即 x 2 ≤ 4 , x^2 \le 4\mathclose{\text{,}} x 2 ≤ 4 , 这恰好当 − 2 ≤ x ≤ 2 -2 \le x \le 2 − 2 ≤ x ≤ 2 时成立。定义域为 [ − 2 , 2 ] 。 [-2, 2]\mathclose{\text{。}} [ − 2 , 2 ] 。
值域。 对于 x x x 中的 [ − 2 , 2 ] , [-2, 2]\mathclose{\text{,}} [ − 2 , 2 ] , x 2 x^2 x 2 介于 0 和 4 之间,因此 4 − x 2 4 - x^2 4 − x 2 介于 0 和 4 之间,其平方根介于 0 = 0 \sqrt0 = 0 0 = 0 和 4 = 2 \sqrt4 = 2 4 = 2 之间。所以每个值都在 [ 0 , 2 ] [0, 2] [ 0 , 2 ] 中。反之,[ 0 , 2 ] [0, 2] [ 0 , 2 ] 中的每个 y y y 都是一个值。要找到给出该值的输入,对 y = 4 − x 2 y = \sqrt{4 - x^2} y = 4 − x 2 关于 x x x 求解:平方后得到 y 2 = 4 − x 2 , y^2 = 4 - x^2\mathclose{\text{,}} y 2 = 4 − x 2 , 因此尝试 x = 4 − y 2 。 x = \sqrt{4 - y^2}\mathclose{\text{。}} x = 4 − y 2 。 该 x x x 位于 [ 0 , 2 ] [0, 2] [ 0 , 2 ] 中,且由于 y ≥ 0 , y \ge 0\mathclose{\text{,}} y ≥ 0 ,
f ( x ) = 4 − ( 4 − y 2 ) = y 2 = y . f(x) = \sqrt{4 - (4 - y^2)} = \sqrt{y^2} = y. f ( x ) = 4 − ( 4 − y 2 ) = y 2 = y .
值域是 [ 0 , 2 ] 。 [0, 2]\mathclose{\text{。}} [ 0 , 2 ] 。 对 y = 4 − x 2 y = \sqrt{4 - x^2} y = 4 − x 2 平方得到 x 2 + y 2 = 4 , x^2 + y^2 = 4\mathclose{\text{,}} x 2 + y 2 = 4 , 其中 y ≥ 0 。 y \ge 0\mathclose{\text{。}} y ≥ 0 。 根据勾股定理,x 2 + y 2 x^2 + y^2 x 2 + y 2 是从 ( x , y ) (x, y) ( x , y ) 到原点的距离的平方,因此满足 x 2 + y 2 = 4 x^2 + y^2 = 4 x 2 + y 2 = 4 的点构成以原点为中心、半径为 2 的圆,而图像是其上半部分。图 1.2 显示了其定义域和值域。
图像
定义 1.3图像
函数 f f f 的 图像 是坐标平面中所有满足 x x x 在 f f f 的定义域内的点 ( x , f ( x ) ) (x, f(x)) ( x , f ( x )) 的集合。它是方程为 y = f ( x ) y = f(x) y = f ( x ) 的曲线。
要从图中读取 f ( a ) f(a) f ( a ) 的值,请在水平轴上找到 x = a , x = a\mathclose{\text{,}} x = a , 然后向上或向下移动到图像:f ( a ) f(a) f ( a ) 即为该处的高度。定义域是图像有对应点的 x x x 的集合,即其在 x x x 轴上的投影;值域是其在 y y y 轴上的投影。
垂直线测试。 平面上的曲线是 x x x 的函数的图像,当且仅当没有垂直线与它相交超过一次:直线 x = a x = a x = a 与 f f f 的图像仅在 ( a , f ( a ) ) (a, f(a)) ( a , f ( a )) 处相交,前提是 a a a 在定义域内,否则不相交;若有第二个交点,则会使 a a a 有两个值。整个圆 x 2 + y 2 = 4 x^2 + y^2 = 4 x 2 + y 2 = 4 未通过测试:直线 x = 1 x = 1 x = 1 在 ( 1 , 3 ) (1, \sqrt3) ( 1 , 3 ) 和 ( 1 , − 3 ) (1, -\sqrt3) ( 1 , − 3 ) 处与它相交。其上半部分通过测试:它是例 1.2 中函数的图像。
图 1.2 左图:例 1.2 中 y = 4 − x 2 y = \sqrt{4 - x^2} y = 4 − x 2 的图像。其在 x x x 轴上的投影(橙色)是定义域 [ − 2 , 2 ] ; [-2, 2]\mathclose{\text{;}} [ − 2 , 2 ] ; 其在 y y y 轴上的投影(绿色)是值域 [ 0 , 2 ] 。 [0, 2]\mathclose{\text{。}} [ 0 , 2 ] 。 右图:例 1.3 中的分段函数。( 1 , 2 ) (1, 2) ( 1 , 2 ) 处的实心点位于图像上;( 1 , 1 ) (1, 1) ( 1 , 1 ) 处的空心点不在图像上。
分段函数
分段 函数在定义域的不同部分使用不同的公式。最重要的例子是绝对值 函数,记作 ∣ x ∣ , \abs{x}\mathclose{\text{,}} ∣ x ∣ , 读作「x 的绝对值」:
∣ x ∣ = { x if x ≥ 0 , − x if x < 0. \abs{x} = \begin{cases} x & \text{if } x \ge 0, \\ -x & \text{if } x < 0. \end{cases} ∣ x ∣ = { x − x if x ≥ 0 , if x < 0.
它使每个数非负:∣ 5 ∣ = 5 \abs{5} = 5 ∣ 5 ∣ = 5 和 ∣ − 3 ∣ = − ( − 3 ) = 3 。 \abs{-3} = -(-3) = 3\mathclose{\text{。}} ∣ − 3 ∣ = − ( − 3 ) = 3 。 几何上,∣ x ∣ \abs{x} ∣ x ∣ 是数轴上 x x x 到 0 的距离,而 ∣ a − b ∣ \abs{a - b} ∣ a − b ∣ 是 a a a 和 b b b 之间的距离;∣ x ∣ \abs{x} ∣ x ∣ 的图像是一个顶点在原点的V形。神经网络使用另一种分段函数,即修正线性单元 :
ReLU ( x ) = { 0 if x < 0 , x if x ≥ 0. \operatorname{ReLU}(x) = \begin{cases} 0 & \text{if } x < 0, \\ x & \text{if } x \ge 0. \end{cases} ReLU ( x ) = { 0 x if x < 0 , if x ≥ 0.
它与 max ( 0 , x ) \max(0, x) max ( 0 , x ) 相同,即 0 和 x x x 中的较大者。
例 1.3分段函数 ✓ 已检验
设
f ( x ) = { x 2 if x < 1 , 3 − x if x ≥ 1. f(x) = \begin{cases} x^2 & \text{if } x < 1, \\ 3 - x & \text{if } x \ge 1. \end{cases} f ( x ) = { x 2 3 − x if x < 1 , if x ≥ 1.
求 f ( − 1 ) 、 f(-1)\mathclose{\text{、}} f ( − 1 ) 、 f ( 0.5 ) 、 f(0.5)\mathclose{\text{、}} f ( 0.5 ) 、 f ( 1 ) f(1) f ( 1 ) 和 f ( 2 ) , f(2)\mathclose{\text{,}} f ( 2 ) , 并绘制图像。
对于每个输入,首先确定适用哪一段,然后使用该段的公式。
− 1 < 1 , -1 < 1\mathclose{\text{,}} − 1 < 1 , 因此 f ( − 1 ) = ( − 1 ) 2 = 1 。 f(-1) = (-1)^2 = 1\mathclose{\text{。}} f ( − 1 ) = ( − 1 ) 2 = 1 。
0.5 < 1 , 0.5 < 1\mathclose{\text{,}} 0.5 < 1 , 因此 f ( 0.5 ) = 0.5 2 = 0.25 。 f(0.5) = 0.5^2 = 0.25\mathclose{\text{。}} f ( 0.5 ) = 0. 5 2 = 0.25 。
1 ≥ 1 , 1 \ge 1\mathclose{\text{,}} 1 ≥ 1 , 因此 f ( 1 ) = 3 − 1 = 2 。 f(1) = 3 - 1 = 2\mathclose{\text{。}} f ( 1 ) = 3 − 1 = 2 。 边界点属于包含它的条件的那一段,这里是第二段。
2 ≥ 1 , 2 \ge 1\mathclose{\text{,}} 2 ≥ 1 , 因此 f ( 2 ) = 3 − 2 = 1 。 f(2) = 3 - 2 = 1\mathclose{\text{。}} f ( 2 ) = 3 − 2 = 1 。
图(图1.2,右)是抛物线 y = x 2 y = x^2 y = x 2 在 x = 1 x = 1 x = 1 左侧的部分,以及从 x = 1 x = 1 x = 1 开始的直线 y = 3 − x 。 y = 3 - x\mathclose{\text{。}} y = 3 − x 。 抛物线趋向于点 ( 1 , 1 ) , (1, 1)\mathclose{\text{,}} ( 1 , 1 ) , 但 x = 1 x = 1 x = 1 不在其分段中,因此空心点标记了缺口;实心点位于 ( 1 , 2 ) , (1, 2)\mathclose{\text{,}} ( 1 , 2 ) , 显示了值 f ( 1 ) = 2 。 f(1) = 2\mathclose{\text{。}} f ( 1 ) = 2 。 图在 x = 1 x = 1 x = 1 处发生跳跃。
深入一步函数的精确定义
定义1.1提及“规则”,但仅输入与输出的配对至关重要。因此,数学家将函数定义为其图:一个有序对 ( x , y ) (x, y) ( x , y ) 的集合 f , f\mathclose{\text{,}} f , 其中域中的每个 x x x 恰好出现一次,f ( x ) = y f(x) = y f ( x ) = y 表示 ( x , y ) (x, y) ( x , y ) 属于 f 。 f\mathclose{\text{。}} f 。 那么 ( x + 1 ) 2 (x + 1)^2 ( x + 1 ) 2 和 x 2 + 2 x + 1 x^2 + 2x + 1 x 2 + 2 x + 1 定义相同的函数。人们也写作 f : D → R , f\colon D \to \R\mathclose{\text{,}} f : D → R , 读作“f 将 D 映射到 R”。
程序中的函数可以读取时钟,或读取其他代码更改的变量,因此相同的输入可能产生不同的输出;它还可以执行除计算输出之外的其他操作,例如打印。如果函数的输出仅取决于其输入且不执行其他操作,程序员称该函数为 纯 ;数学函数是纯函数。
少数几族函数提供了本系列中几乎每个函数;图1.3展示了它们,且 第1.5节 的函数探索器绘制了其中大多数。掌握它们的形状:识别形状可节省微积分中的大量工作。
图 1.3 目录。第一行:斜率为 2 和 − 1 2 -\tfrac12 − 2 1 的直线;幂函数 x 2 x^2 x 2 和 x 3 ; x^3\mathclose{\text{;}} x 3 ; 例 1.4 中的三次函数及其零点 − 2 、 -2\mathclose{\text{、}} − 2 、 0 和 3;有理函数 1 / x 。 1/x\mathclose{\text{。}} 1/ x 。 第二行:x \sqrt x x 和 x 3 ; \sqrt[3]{x}\mathclose{\text{;}} 3 x ; 指数函数 2 x 、 2^x\mathclose{\text{、}} 2 x 、 e x e^x e x 和 ( 1 2 ) x , (\tfrac12)^x\mathclose{\text{,}} ( 2 1 ) x , 均经过 ( 0 , 1 ) ; (0, 1)\mathclose{\text{;}} ( 0 , 1 ) ; e x e^x e x 及其反函数 ln x , \ln x\mathclose{\text{,}} ln x , 关于直线 y = x y = x y = x 互为镜像;以及 tan x , \tan x\mathclose{\text{,}} tan x , 在 cos x = 0 \cos x = 0 cos x = 0 处无定义,如在 x = ± π 2 x = \pm\tfrac{\pi}{2} x = ± 2 π 处(虚线所示)。
线性函数
一个 线性函数 具有形式 f ( x ) = m x + b , f(x) = mx + b\mathclose{\text{,}} f ( x ) = m x + b , 其中 m m m 和 b b b 为常数。其图像是一条直线,在 y y y 轴上的高度为 b b b 处穿过该轴(截距 ),并具有 斜率 m 。 m\mathclose{\text{。}} m 。 斜率是 y y y 每单位 x x x 变化量的变化:对于直线上的任意两点 ( x 1 , y 1 ) (x_1, y_1) ( x 1 , y 1 ) 和 ( x 2 , y 2 ) (x_2, y_2) ( x 2 , y 2 ) (读作“x 一,y 一”等),且 x 1 ≠ x 2 , x_1 \ne x_2\mathclose{\text{,}} x 1 = x 2 ,
m = y 2 − y 1 x 2 − x 1 . m = \frac{y_2 - y_1}{x_2 - x_1}. m = x 2 − x 1 y 2 − y 1 .
答案不取决于你选取哪两点:y 2 − y 1 = ( m x 2 + b ) − ( m x 1 + b ) = m ( x 2 − x 1 ) , y_2 - y_1 = (mx_2 + b) - (mx_1 + b) = m(x_2 - x_1)\mathclose{\text{,}} y 2 − y 1 = ( m x 2 + b ) − ( m x 1 + b ) = m ( x 2 − x 1 ) , 且除以 x 2 − x 1 x_2 - x_1 x 2 − x 1 后得到 m 。 m\mathclose{\text{。}} m 。
因此,线性函数在各处以相同的速率变化:x x x 每增加1个单位,y y y 就变化m 。 m\mathclose{\text{。}} m 。 摄氏度到华氏度的转换公式F = 1.8 C + 32 F = 1.8C + 32 F = 1.8 C + 32 就是一个例子:无论温度如何,温度升高1 °C即升高1.8 °F。对于直线,“变化率”无需微积分。微积分是将这一概念推广到曲线上的工具,曲线的陡峭程度逐点变化。
经过( x 1 , y 1 ) (x_1, y_1) ( x 1 , y 1 ) 且斜率为m m m 的直线具有点斜式方程 y − y 1 = m ( x − x 1 ) 。 y - y_1 = m(x - x_1)\mathclose{\text{。}} y − y 1 = m ( x − x 1 ) 。 例如,经过( 1 , 3 ) (1, 3) ( 1 , 3 ) 和( 4 , 9 ) (4, 9) ( 4 , 9 ) 的直线斜率为9 − 3 4 − 1 = 2 , \tfrac{9 - 3}{4 - 1} = 2\mathclose{\text{,}} 4 − 1 9 − 3 = 2 , 因此其方程为y − 3 = 2 ( x − 1 ) , y - 3 = 2(x - 1)\mathclose{\text{,}} y − 3 = 2 ( x − 1 ) , 即y = 2 x + 1 。 y = 2x + 1\mathclose{\text{。}} y = 2 x + 1 。
幂函数与多项式
幂函数 为f ( x ) = x n 。 f(x) = x^n\mathclose{\text{。}} f ( x ) = x n 。 对于n = 1 , 2 , 3 , … , n = 1, 2, 3, \dots\mathclose{\text{,}} n = 1 , 2 , 3 , … , 它在所有实数x x x 上均有定义。图1.3展示了两种基本形状:x 2 x^2 x 2 是关于y y y 轴对称的U形抛物线,而x 3 x^3 x 3 穿过原点,关于原点对称。更高的偶次幂(x 4 , x 6 , … ) x^4, x^6, \dots\mathclose{\text{)}} x 4 , x 6 , … ) 看起来像x 2 , x^2\mathclose{\text{,}} x 2 , 更高的奇次幂看起来像x 3 , x^3\mathclose{\text{,}} x 3 , 但在0附近更平坦,在远处更陡峭。负次幂是倒数,x − n = 1 / x n , x^{-n} = 1/x^n\mathclose{\text{,}} x − n = 1/ x n , 在x ≠ 0 x \ne 0 x = 0 时有定义;分数次幂是根式(见下文)。
这两种对称性有名称。如果对于其定义域中的每一个 x , x\mathclose{\text{,}} x , 函数 都是 偶函数 f ( − x ) = f ( x ) , f(-x) = f(x)\mathclose{\text{,}} f ( − x ) = f ( x ) , 则称其为偶函数:其图像关于 y y y 轴对称。如果满足 f ( − x ) = − f ( x ) , f(-x) = -f(x)\mathclose{\text{,}} f ( − x ) = − f ( x ) , 则称其为 奇函数 :关于原点的半周旋转使其图像保持不变。x 2 x^2 x 2 是偶函数,因为 ( − x ) 2 = x 2 ; (-x)^2 = x^2\mathclose{\text{;}} ( − x ) 2 = x 2 ; x 3 x^3 x 3 是奇函数,因为 ( − x ) 3 = − x 3 。 (-x)^3 = -x^3\mathclose{\text{。}} ( − x ) 3 = − x 3 。
定义 1.4多项式
多项式 是形如
p ( x ) = a n x n + a n − 1 x n − 1 + ⋯ + a 1 x + a 0 , p(x) = a_n x^n + a_{n-1} x^{n-1} + \dots + a_1 x + a_0, p ( x ) = a n x n + a n − 1 x n − 1 + ⋯ + a 1 x + a 0 ,
的函数,其中 n ≥ 0 n \ge 0 n ≥ 0 是一个整数,且 系数 a 0 , a 1 , … , a n a_0, a_1, \dots, a_n a 0 , a 1 , … , a n 是常数。如果 a n ≠ 0 , a_n \ne 0\mathclose{\text{,}} a n = 0 , 则该多项式具有 次数 n 。 n\mathclose{\text{。}} n 。 其定义域为 R 。 \R\mathclose{\text{。}} R 。
次数为 1、2 和 3 的多项式分别是线性函数、二次函数 和 三次函数 。满足 p ( r ) = 0 p(r) = 0 p ( r ) = 0 的数 r r r 是 p p p 的 零点 (或 根 ):其图像在 x = r x = r x = r 处与 x x x 轴相交。因式分解可以找到零点。
例 1.4三次函数的零点 ✓ 已检验
求 p ( x ) = x 3 − x 2 − 6 x p(x) = x^3 - x^2 - 6x p ( x ) = x 3 − x 2 − 6 x 的零点。
每一项都包含 x , x\mathclose{\text{,}} x , 因此将其提取出来:p ( x ) = x ( x 2 − x − 6 ) 。 p(x) = x(x^2 - x - 6)\mathclose{\text{。}} p ( x ) = x ( x 2 − x − 6 ) 。 为了对二次多项式进行因式分解,寻找两个数,其乘积为 − 6 -6 − 6 且和为 − 1 : -1\mathclose{\text{:}} − 1 : 它们是 − 3 -3 − 3 和 2 。 2\mathclose{\text{。}} 2 。 因此
p ( x ) = x ( x − 3 ) ( x + 2 ) . p(x) = x(x - 3)(x + 2). p ( x ) = x ( x − 3 ) ( x + 2 ) .
乘积为 0 当且仅当其因子之一为 0,因此零点为 x = 0 、 x = 0\mathclose{\text{、}} x = 0 、 x = 3 x = 3 x = 3 和 x = − 2 。 x = -2\mathclose{\text{。}} x = − 2 。 通过展开进行验证:x ( x − 3 ) ( x + 2 ) = x ( x 2 − x − 6 ) = x 3 − x 2 − 6 x 。 x(x - 3)(x + 2) = x(x^2 - x - 6) = x^3 - x^2 - 6x\mathclose{\text{。}} x ( x − 3 ) ( x + 2 ) = x ( x 2 − x − 6 ) = x 3 − x 2 − 6 x 。 图 1.3 中的图形在这三个点处与 x x x 轴相交。
有理函数
定义 1.5有理函数
有理函数 是两个多项式的商 f ( x ) = p ( x ) q ( x ) , f(x) = \dfrac{p(x)}{q(x)}\mathclose{\text{,}} f ( x ) = q ( x ) p ( x ) , 其中 q q q 不是零多项式。其定义域是所有满足 q ( x ) ≠ 0 q(x) \ne 0 q ( x ) = 0 的 x x x 的集合。
最简单的是 f ( x ) = 1 / x , f(x) = 1/x\mathclose{\text{,}} f ( x ) = 1/ x , 其定义域为 ( − ∞ , 0 ) ∪ ( 0 , ∞ ) 。 (-\infty, 0) \cup (0, \infty)\mathclose{\text{。}} ( − ∞ , 0 ) ∪ ( 0 , ∞ ) 。 其图形(图 1.3)有两个分支。在 x = 0 x = 0 x = 0 附近,值变得巨大,右侧为正,左侧为负;远离 0 时,它们收缩趋向于 0。模块 3 研究此类行为。
例 1.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 的定义域,并简化公式。
对分子和分母进行因式分解:x 2 − 4 = ( x − 2 ) ( x + 2 ) x^2 - 4 = (x - 2)(x + 2) x 2 − 4 = ( x − 2 ) ( x + 2 ) (平方差)和 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 ) 。 分母在 x = 2 x = 2 x = 2 和 x = − 1 x = -1 x = − 1 处为 0,因此定义域为 ( − ∞ , − 1 ) ∪ ( − 1 , 2 ) ∪ ( 2 , ∞ ) 。 (-\infty, -1) \cup (-1, 2) \cup (2, \infty)\mathclose{\text{。}} ( − ∞ , − 1 ) ∪ ( − 1 , 2 ) ∪ ( 2 , ∞ ) 。
对于定义域内的 x , x\mathclose{\text{,}} x , x − 2 ≠ 0 , x - 2 \ne 0\mathclose{\text{,}} x − 2 = 0 , 因此你可以将其消去:对于 x ≠ 2 x \ne 2 x = 2 和 x ≠ − 1 , x \ne -1\mathclose{\text{,}} x = − 1 ,
r ( x ) = ( x − 2 ) ( x + 2 ) ( x − 2 ) ( x + 1 ) = x + 2 x + 1 . r(x) = \frac{(x - 2)(x + 2)}{(x - 2)(x + 1)} = \frac{x + 2}{x + 1}. r ( x ) = ( x − 2 ) ( x + 1 ) ( x − 2 ) ( x + 2 ) = x + 1 x + 2 .
条件至关重要。公式 x + 2 x + 1 \dfrac{x + 2}{x + 1} x + 1 x + 2 在 x = 2 x = 2 x = 2 处有意义,此时它给出 4 3 , \tfrac43\mathclose{\text{,}} 3 4 , 但 r ( 2 ) r(2) r ( 2 ) 未定义。因此,r r r 的图像是 x + 2 x + 1 \dfrac{x + 2}{x + 1} x + 1 x + 2 的图像缺少一个点:在 ( 2 , 4 3 ) \big(2, \tfrac43\big) ( 2 , 3 4 ) 处有一个空洞。r r r 在 x = 2 x = 2 x = 2 附近的行为是极限所能回答的问题类型(模块 2)。
注意
消去一个因子可能会改变定义域:需连同条件一起保留,如 r ( x ) = x + 2 x + 1 r(x) = \dfrac{x + 2}{x + 1} r ( x ) = x + 1 x + 2 对于 x ≠ 2 x \ne 2 x = 2 所示。并且应消去公因子,而非项:x + 2 x + 1 \dfrac{x + 2}{x + 1} x + 1 x + 2 不等于 2 1 。 \dfrac{2}{1}\mathclose{\text{。}} 1 2 。
根
对于 x ≥ 0 , x \ge 0\mathclose{\text{,}} x ≥ 0 , 平方根 x \sqrt{x} x 是平方等于 x x x 的非负数。因此 9 = 3 , \sqrt{9} = 3\mathclose{\text{,}} 9 = 3 , 而非 ± 3 。 \pm 3\mathclose{\text{。}} ± 3 。 方程 x 2 = 9 x^2 = 9 x 2 = 9 有两个解,9 = 3 \sqrt9 = 3 9 = 3 和 − 9 = − 3 , -\sqrt9 = -3\mathclose{\text{,}} − 9 = − 3 , 但符号 9 \sqrt9 9 仅指第一个。x \sqrt x x 的定义域和值域均为 [ 0 , ∞ ) ; [0, \infty)\mathclose{\text{;}} [ 0 , ∞ ) ; 其图像是侧放的抛物线的一半(图 1.3)。
立方根 x 3 \sqrt[3]{x} 3 x 是立方等于 x x x 的数。每个实数恰有一个实立方根,所以定义域是 R , \R\mathclose{\text{,}} R , 例如 8 3 = 2 \sqrt[3]{8} = 2 3 8 = 2 和 − 8 3 = − 2 。 \sqrt[3]{-8} = -2\mathclose{\text{。}} 3 − 8 = − 2 。 一般地,对于 n n n 次根 x n , \sqrt[n]{x}\mathclose{\text{,}} n x , 当 n n n 为奇数时,对每个 x x x 都有定义;当 n n n 为偶数时,只对 x ≥ 0 x \ge 0 x ≥ 0 有定义。根也可以用分数指数表示:x 1 / n = x n x^{1/n} = \sqrt[n]{x} x 1/ n = n x 和 x m / n = ( x n ) m x^{m/n} = \big(\sqrt[n]{x}\big)^m x m / n = ( n x ) m (m / n m/n m / n 为最简分数),因此 8 2 / 3 = 2 2 = 4 。 8^{2/3} = 2^2 = 4\mathclose{\text{。}} 8 2/3 = 2 2 = 4 。 对于负数 x , x\mathclose{\text{,}} x , 本教程沿用多数微积分教材的约定,将 x 1 / 3 x^{1/3} x 1/3 解释为实立方根。Python 和 SymPy 的约定不同,见第 1.7 节。
注意
x x x 并不总是x 2 。 \sqrt{x^2}\mathclose{\text{。}} x 2 。 对于x = − 3 , x = -3\mathclose{\text{,}} x = − 3 , ( − 3 ) 2 = 9 = 3 。 \sqrt{(-3)^2} = \sqrt9 = 3\mathclose{\text{。}} ( − 3 ) 2 = 9 = 3 。 平方根永远不为负,因此
x 2 = ∣ x ∣ for every real x , \sqrt{x^2} = \abs{x} \quad \text{for every real } x, x 2 = ∣ x ∣ for every real x ,
和 x 2 = x \sqrt{x^2} = x x 2 = x 仅在x ≥ 0 x \ge 0 x ≥ 0 时成立。根也不满足加法分配律:9 + 16 = 25 = 5 , \sqrt{9 + 16} = \sqrt{25} = 5\mathclose{\text{,}} 9 + 16 = 25 = 5 , 而非9 + 16 = 7 。 \sqrt9 + \sqrt{16} = 7\mathclose{\text{。}} 9 + 16 = 7 。
指数函数
在幂函数x 2 x^2 x 2 中,变量是底数。将其置于指数位置,则得到指数函数 f ( x ) = a x , f(x) = a^x\mathclose{\text{,}} f ( x ) = a x , 其底数a > 0 a > 0 a > 0 固定。指数法则对所有底数a , b > 0 a, b > 0 a , b > 0 和所有实数x x x 及y y y 均成立:
a x + y = a x a y , a x − y = a x a y , a 0 = 1 , ( a x ) y = a x y , ( a b ) x = a x b x , a − x = 1 a x . \begin{aligned} a^{x+y} &= a^x a^y, & a^{x-y} &= \frac{a^x}{a^y}, & a^0 &= 1, \\ (a^x)^y &= a^{xy}, & (ab)^x &= a^x b^x, & a^{-x} &= \frac{1}{a^x}. \end{aligned} a x + y ( a x ) y = a x a y , = a x y , a x − y ( ab ) x = a y a x , = a x b x , a 0 a − x = 1 , = a x 1 .
对于整数指数,它们源于对因子的计数,如 2 3 ⋅ 2 2 = ( 2 ⋅ 2 ⋅ 2 ) ( 2 ⋅ 2 ) = 2 5 2^3 \cdot 2^2 = (2 \cdot 2 \cdot 2)(2 \cdot 2) = 2^5 2 3 ⋅ 2 2 = ( 2 ⋅ 2 ⋅ 2 ) ( 2 ⋅ 2 ) = 2 5 所示;分数指数是根,a 1 / 2 = a ; a^{1/2} = \sqrt a\mathclose{\text{;}} a 1/2 = a ; 而对于像 2 = 1.41421 … \sqrt2 = 1.41421\ldots 2 = 1.41421 … 这样的无理指数,a 2 a^{\sqrt2} a 2 是 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 , … 趋近的那个数。因此,对于每个实数 x , x\mathclose{\text{,}} x , a x a^x a x 都有定义且为正。
如果 a > 1 , a > 1\mathclose{\text{,}} a > 1 , a x a^x a x 增长:2 x 2^x 2 x 在 x x x 每增加 1 的每一步中翻倍。如果 0 < a < 1 , 0 < a < 1\mathclose{\text{,}} 0 < a < 1 , 它衰减:( 1 2 ) x (\tfrac12)^x ( 2 1 ) x 在每一步中减半。每个指数函数都经过 ( 0 , 1 ) , (0, 1)\mathclose{\text{,}} ( 0 , 1 ) , 因为 a 0 = 1 。 a^0 = 1\mathclose{\text{。}} a 0 = 1 。 对于 a ≠ 1 , a \ne 1\mathclose{\text{,}} a = 1 , 定义域是 R , \R\mathclose{\text{,}} R , 值域是 ( 0 , ∞ ) 。 (0, \infty)\mathclose{\text{。}} ( 0 , ∞ ) 。
数 e。 有一个特殊的底数:被称为欧拉数的数
e = 2.718281828 … , e = 2.718281828\ldots, e = 2.718281828 … ,
即欧拉数。与 π \pi π 一样,它也是无理数:其小数部分永不结束且永不重复。函数 e x , e^x\mathclose{\text{,}} e x , 读作“e 的 x 次方”,被称为 指数 函数,因为当底数为 e e e 时,微积分公式最为简洁;模块 6 展示了 e e e 的来源及其原因。目前,e e e 是介于 2 和 3 之间的一个数,e ≈ 2.71828 , e \approx 2.71828\mathclose{\text{,}} e ≈ 2.71828 , 因此 e x e^x e x 的图像位于 2 x 2^x 2 x 和 3 x 3^x 3 x 的图像之间。
x x x 2 x 2^x 2 x e x e^x e x ( 1 2 ) x (\tfrac12)^x ( 2 1 ) x − 2 -2 − 2 0.25 0.25 0.25 0.13534 0.13534 0.13534 4 4 4 − 1 -1 − 1 0.5 0.5 0.5 0.36788 0.36788 0.36788 2 2 2 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2.7183 2.7183 2.7183 0.5 0.5 0.5 2 2 2 4 4 4 7.3891 7.3891 7.3891 0.25 0.25 0.25 3 3 3 8 8 8 20.086 20.086 20.086 0.125 0.125 0.125
例 1.6一个倍增模型 ✓ 已检验
假设一个细菌群落从 1000 个细胞开始,每 3 小时翻倍。(这些数字是虚构的,但在食物和空间充足时,真实的群落确实如此生长。)经过 t t t 小时后,它拥有
N ( t ) = 1000 ⋅ 2 t / 3 N(t) = 1000 \cdot 2^{t/3} N ( t ) = 1000 ⋅ 2 t /3
个单元格。求 N ( 0 ) 、 N(0)\mathclose{\text{、}} N ( 0 ) 、 N ( 3 ) 、 N(3)\mathclose{\text{、}} N ( 3 ) 、 N ( 12 ) N(12) N ( 12 ) 和 N ( 1 ) , N(1)\mathclose{\text{,}} N ( 1 ) , 并证明对于每个 t , t\mathclose{\text{,}} t , N ( t + 3 ) = 2 N ( t ) N(t + 3) = 2N(t) N ( t + 3 ) = 2 N ( t ) 成立。
N ( 0 ) = 1000 ⋅ 2 0 = 1000 、 N(0) = 1000 \cdot 2^0 = 1000\mathclose{\text{、}} N ( 0 ) = 1000 ⋅ 2 0 = 1000 、 N ( 3 ) = 1000 ⋅ 2 1 = 2000 N(3) = 1000 \cdot 2^1 = 2000 N ( 3 ) = 1000 ⋅ 2 1 = 2000 和 N ( 12 ) = 1000 ⋅ 2 4 = 16,000 。 N(12) = 1000 \cdot 2^4 = 16{,}000\mathclose{\text{。}} N ( 12 ) = 1000 ⋅ 2 4 = 16 , 000 。 对于 N ( 1 ) , N(1)\mathclose{\text{,}} N ( 1 ) , 你需要使用计算器:N ( 1 ) = 1000 ⋅ 2 1 / 3 ≈ 1259.9 , N(1) = 1000 \cdot 2^{1/3} \approx 1259.9\mathclose{\text{,}} N ( 1 ) = 1000 ⋅ 2 1/3 ≈ 1259.9 , 大约为 1260 个单元格。
根据指数法则,
N ( t + 3 ) = 1000 ⋅ 2 ( t + 3 ) / 3 = 1000 ⋅ 2 t / 3 + 1 = 1000 ⋅ 2 t / 3 ⋅ 2 = 2 N ( t ) . \begin{aligned} N(t + 3) &= 1000 \cdot 2^{(t+3)/3} = 1000 \cdot 2^{t/3 + 1} \\ &= 1000 \cdot 2^{t/3} \cdot 2 = 2N(t). \end{aligned} N ( t + 3 ) = 1000 ⋅ 2 ( t + 3 ) /3 = 1000 ⋅ 2 t /3 + 1 = 1000 ⋅ 2 t /3 ⋅ 2 = 2 N ( t ) .
因此,无论何时开始计时,菌落每 3 小时翻倍。这就是指数增长的特征:相等的时间步长使数量乘以相等的因子。
注意
两个经典错误。首先,x 2 x^2 x 2 和 2 x 2^x 2 x 是不同的函数:在 x 2 x^2 x 2 中,变量是底数,在 2 x 2^x 2 x 中,变量是指数,而在 x = 10 x = 10 x = 10 处,它们的值分别为 100 和 1024。其次,指数不满足加法分配律:2 x + 3 = 2 x ⋅ 2 3 = 8 ⋅ 2 x , 2^{x+3} = 2^x \cdot 2^3 = 8 \cdot 2^x\mathclose{\text{,}} 2 x + 3 = 2 x ⋅ 2 3 = 8 ⋅ 2 x , 而不是 2 x + 2 3 。 2^x + 2^3\mathclose{\text{。}} 2 x + 2 3 。
对数
指数函数回答诸如“2 5 2^5 2 5 是多少?”之类的问题。对数回答相反的问题:“2 的多少次幂等于 32?”
定义 1.6对数
设 a > 0 a > 0 a > 0 且 a ≠ 1 。 a \ne 1\mathclose{\text{。}} a = 1 。 对于 x > 0 , x > 0\mathclose{\text{,}} x > 0 , 以 a a a 为底、x x x 的对数,记作 log a x , \log_a x\mathclose{\text{,}} log a x , 读作“以 a 为底 x 的对数”,是满足 a y = x a^y = x a y = x 的数 y : y\mathclose{\text{:}} y :
log a x = y means a y = x . \log_a x = y \quad\text{means}\quad a^y = x. log a x = y means a y = x .
自然对数 ln x , \ln x\mathclose{\text{,}} ln x , 读作“x的自然对数”,是以e e e 为底的对数:ln x = y \ln x = y ln x = y 意味着e y = x 。 e^y = x\mathclose{\text{。}} e y = x 。
例如,log 2 32 = 5 \log_2 32 = 5 log 2 32 = 5 因为2 5 = 32 ; 2^5 = 32\mathclose{\text{;}} 2 5 = 32 ; log 10 1000 = 3 ; \log_{10} 1000 = 3\mathclose{\text{;}} log 10 1000 = 3 ; log 2 1 4 = − 2 \log_2 \tfrac14 = -2 log 2 4 1 = − 2 因为2 − 2 = 1 4 ; 2^{-2} = \tfrac14\mathclose{\text{;}} 2 − 2 = 4 1 ; ln 1 = 0 \ln 1 = 0 ln 1 = 0 因为e 0 = 1 ; e^0 = 1\mathclose{\text{;}} e 0 = 1 ; 以及ln e = 1 。 \ln e = 1\mathclose{\text{。}} ln e = 1 。 由于a y a^y a y 始终为正,0或负数的对数未定义:ln \ln ln 的定义域为( 0 , ∞ ) , (0, \infty)\mathclose{\text{,}} ( 0 , ∞ ) , 其值域为R 。 \R\mathclose{\text{。}} R 。
对数与指数互为逆运算,指数与对数互为逆运算:
e ln x = x for x > 0 , ln ( e y ) = y for every real y . \begin{aligned} e^{\ln x} &= x \quad \text{for } x > 0, \\ \ln\!\big(e^{y}\big) &= y \quad \text{for every real } y. \end{aligned} e l n x ln ( e y ) = x for x > 0 , = y for every real y .
用第 1.5 节的术语,ln \ln ln 是 e x e^x e x 的反函数 。ln x \ln x ln x 的图像是将 e x e^x e x 的图像关于直线 y = x y = x y = x 反射得到的(图 1.3)。
定理 1.1对数法则
对于所有x > 0 、 x > 0\mathclose{\text{、}} x > 0 、 y > 0 y > 0 y > 0 和任意实数r : r\mathclose{\text{:}} r :
ln ( x y ) = ln x + ln y , ln x y = ln x − ln y , ln ( x r ) = r ln x . \begin{aligned} \ln(xy) &= \ln x + \ln y, \\ \ln\frac{x}{y} &= \ln x - \ln y, \\ \ln\big(x^r\big) &= r\ln x. \end{aligned} ln ( x y ) ln y x ln ( x r ) = ln x + ln y , = ln x − ln y , = r ln x .
对于log a , \log_a\mathclose{\text{,}} log a , 任何满足a ≠ 1 a \ne 1 a = 1 的底数a > 0 a > 0 a > 0 均适用相同的法则。
证明
设 p = ln x p = \ln x p = ln x 和 q = ln y , q = \ln y\mathclose{\text{,}} q = ln y , 使得 e p = x e^p = x e p = x 和 e q = y 。 e^q = y\mathclose{\text{。}} e q = y 。 根据指数法则,e p + q = e p e q = x y 。 e^{p+q} = e^p e^q = xy\mathclose{\text{。}} e p + q = e p e q = x y 。 因此 p + q p + q p + q 是 e e e 的 x y xy x y 次幂,这正是 ln ( x y ) = p + q \ln(xy) = p + q ln ( x y ) = p + q 所表述的内容。以同样的方式,e p − q = e p / e q = x / y e^{p-q} = e^p/e^q = x/y e p − q = e p / e q = x / y 给出了第二条法则,而 e r p = ( e p ) r = x r e^{rp} = (e^p)^r = x^r e r p = ( e p ) r = x r 给出了第三条法则。相同的论证适用于任何以 a a a 代替 e e e 的底数。
∎
由此可得两个推论。为了在不同底数之间进行转换,写成 y = log a x , y = \log_a x\mathclose{\text{,}} y = log a x , 使得 a y = x ; a^y = x\mathclose{\text{;}} a y = x ; 对两边取 ln \ln ln 并利用第三条法则:y ln a = ln x 。 y \ln a = \ln x\mathclose{\text{。}} y ln a = ln x 。 由于 a ≠ 1 , a \ne 1\mathclose{\text{,}} a = 1 , ln a ≠ 0 , \ln a \ne 0\mathclose{\text{,}} ln a = 0 , 以及
log a x = ln x ln a . \log_a x = \frac{\ln x}{\ln a}. log a x = ln a ln x .
并且为了解出未知数在指数位置的方程,对两边取对数(例 1.7)。
在计算中,log 2 n \log_2 n log 2 n 计算的是减半次数。在包含 n n n 个元素的有序列表中进行二分搜索,每一步都将剩余待搜索部分减半,因此大约需要 log 2 n \log_2 n log 2 n 步:对于一百万个元素,仅需大约 20 步,因为 log 2 10 6 ≈ 19.93 。 \log_2 10^6 \approx 19.93\mathclose{\text{。}} log 2 1 0 6 ≈ 19.93 。
例 1.7求解指数方程 ✓ 已检验
例 1.6 中的菌落何时达到 10,000 个细胞?
求解 1000 ⋅ 2 t / 3 = 10,000 。 1000 \cdot 2^{t/3} = 10{,}000\mathclose{\text{。}} 1000 ⋅ 2 t /3 = 10 , 000 。 两边除以 1000:2 t / 3 = 10 。 2^{t/3} = 10\mathclose{\text{。}} 2 t /3 = 10 。 对两边取自然对数并利用第三条法则:
t 3 ln 2 = ln 10 , so t = 3 ln 10 ln 2 ≈ 9.966. \frac{t}{3}\ln 2 = \ln 10, \quad\text{so}\quad t = \frac{3\ln 10}{\ln 2} \approx 9.966. 3 t ln 2 = ln 10 , so t = ln 2 3 ln 10 ≈ 9.966.
菌落经过约 9.97 小时(略少于 10 小时)后达到 10,000 个细胞。验证:9.966 / 3 = 3.322 , 9.966/3 = 3.322\mathclose{\text{,}} 9.966/3 = 3.322 , 以及 2 3.322 ≈ 10.00 。 2^{3.322} \approx 10.00\mathclose{\text{。}} 2 3.322 ≈ 10.00 。
注意
对数法则涉及乘积、商和幂,而非和:ln ( x + y ) \ln(x + y) ln ( x + y ) 不等于 ln x + ln y , \ln x + \ln y\mathclose{\text{,}} ln x + ln y , 且 ln x ln y \dfrac{\ln x}{\ln y} ln y ln x 不等于 ln x y 。 \ln\dfrac{x}{y}\mathclose{\text{。}} ln y x 。 这些法则还需要正数输入:对于每一个 x ≠ 0 x \ne 0 x = 0 和 ln ( x 2 ) = 2 ln ∣ x ∣ , \ln(x^2) = 2\ln\abs{x}\mathclose{\text{,}} ln ( x 2 ) = 2 ln ∣ x ∣ , 2 ln x 2\ln x 2 ln x 在 x < 0 x < 0 x < 0 时未定义,其中 ln x \ln x ln x 甚至没有定义。注意符号表示:一些书籍和计算器将 log x \log x log x 写作 log 10 x , \log_{10} x\mathclose{\text{,}} log 10 x , 而其他书籍及 Python 将 log x \log x log x 写作 ln x 。 \ln x\mathclose{\text{。}} ln x 。 本系列始终写出底数,仅在 ln \ln ln 中除外。
三角函数
学校三角学以度为单位测量角度。微积分以弧度为单位测量角度。
定义 1.7弧度
单位圆 是半径为 1 且以原点为中心的圆。其中心处截得单位圆上长度为 θ \theta θ 的弧的角,其度量为 θ \theta θ 弧度 。(字母 θ \theta θ 是希腊字母“theta”。)角度从正 x x x 轴测量,正角逆时针测量,负角顺时针测量。
单位圆的周长为2 π , 2\pi\mathclose{\text{,}} 2 π , 因此一整圈对应2 π 2\pi 2 π 弧度:360 ∘ = 2 π 360^\circ = 2\pi 36 0 ∘ = 2 π 和180 ∘ = π 。 180^\circ = \pi\mathclose{\text{。}} 18 0 ∘ = π 。 要将角度转换为弧度,需乘以π / 180 。 \pi/180\mathclose{\text{。}} π /180 。 因此90 ∘ = π / 2 、 90^\circ = \pi/2\mathclose{\text{、}} 9 0 ∘ = π /2 、 60 ∘ = π / 3 、 60^\circ = \pi/3\mathclose{\text{、}} 6 0 ∘ = π /3 、 45 ∘ = π / 4 45^\circ = \pi/4 4 5 ∘ = π /4 和30 ∘ = π / 6 , 30^\circ = \pi/6\mathclose{\text{,}} 3 0 ∘ = π /6 , 而一弧度等于180 ∘ / π ≈ 57.30 ∘ 。 180^\circ/\pi \approx 57.30^\circ\mathclose{\text{。}} 18 0 ∘ / π ≈ 57.3 0 ∘ 。
弧度使微积分最为简洁:对于以弧度表示的小角θ , \theta\mathclose{\text{,}} θ , sin θ \sin\theta sin θ 几乎精确等于θ \theta θ (sin 0.01 ≈ 0.0099998 ), \sin 0.01 \approx 0.0099998\mathclose{\text{),}} sin 0.01 ≈ 0.0099998 ), 且模块5表明sin x \sin x sin x 的变化率随后为cos x , \cos x\mathclose{\text{,}} cos x , 没有多余因子π / 180 。 \pi/180\mathclose{\text{。}} π /180 。 除非页面另有说明,否则此后角度均以弧度为单位。
定义 1.8正弦和余弦
设θ \theta θ 为任意实数,设P P P 为从( 1 , 0 ) (1, 0) ( 1 , 0 ) 旋转θ \theta θ 弧度后到达的单位圆上的点。则cos θ , \cos\theta\mathclose{\text{,}} cos θ , 余弦 θ , \theta\mathclose{\text{,}} θ , 是P P P 的x x x 坐标,而sin θ , \sin\theta\mathclose{\text{,}} sin θ , 正弦 θ , \theta\mathclose{\text{,}} θ , 是其y y y 坐标:
P = ( cos θ , sin θ ) . P = (\cos\theta, \sin\theta). P = ( cos θ , sin θ ) .
其他四个三角函数由这两个函数定义,只要分母不为0:
tan θ = sin θ cos θ , cot θ = cos θ sin θ , sec θ = 1 cos θ , csc θ = 1 sin θ . \begin{aligned} \tan\theta &= \frac{\sin\theta}{\cos\theta}, & \cot\theta &= \frac{\cos\theta}{\sin\theta}, \\ \sec\theta &= \frac{1}{\cos\theta}, & \csc\theta &= \frac{1}{\sin\theta}. \end{aligned} tan θ sec θ = cos θ sin θ , = cos θ 1 , cot θ csc θ = sin θ cos θ , = sin θ 1 .
它们分别读作「正切」「余切」「正割」「余割」(第一个和第三个与第 1.1 节的切线、割线同名)。对于 0 < θ < π / 2 , 0 < \theta < \pi/2\mathclose{\text{,}} 0 < θ < π /2 , 原点、P P P 以及它正下方的点 ( cos θ , 0 ) (\cos\theta, 0) ( cos θ , 0 ) 构成一个斜边长为一的直角三角形。因此,这里的定义与中学所用的「对边除以斜边」和「邻边除以斜边」一致;单位圆定义还可以用于任意角。
图 1.4 左图:单位圆上角度为θ \theta θ 的点P P P 的坐标为( cos θ , sin θ ) ; (\cos\theta, \sin\theta)\mathclose{\text{;}} ( cos θ , sin θ ) ; 橙色弧的长度为θ 。 \theta\mathclose{\text{。}} θ 。 右图:sin x \sin x sin x 和cos x \cos x cos x 的图像。两个面板中的蓝色线段高度均为sin θ : \sin\theta\mathclose{\text{:}} sin θ : 当P P P 绕圆运动时,其高度描绘出正弦曲线。
关于正弦和余弦的所有内容都可以从圆中读出:
范围。 P P P 位于半径为1的圆上,因此sin \sin sin 和cos \cos cos 的定义域为R , \R\mathclose{\text{,}} R , 值域为[ − 1 , 1 ] 。 [-1, 1]\mathclose{\text{。}} [ − 1 , 1 ] 。
勾股恒等式。 P P P 位于圆x 2 + y 2 = 1 x^2 + y^2 = 1 x 2 + y 2 = 1 上,因此对于每个θ \theta θ sin 2 θ + cos 2 θ = 1 , \sin^2\theta + \cos^2\theta = 1, sin 2 θ + cos 2 θ = 1 ,
其中sin 2 θ \sin^2\theta sin 2 θ 意味着( sin θ ) 2 。 (\sin\theta)^2\mathclose{\text{。}} ( sin θ ) 2 。
周期性。 加上 2 π 2\pi 2 π 到 θ \theta θ 使 P P P 绕圆一周,因此 sin ( θ + 2 π ) = sin θ \sin(\theta + 2\pi) = \sin\theta sin ( θ + 2 π ) = sin θ 和 cos ( θ + 2 π ) = cos θ : \cos(\theta + 2\pi) = \cos\theta\mathclose{\text{:}} cos ( θ + 2 π ) = cos θ : 正弦和余弦是 周期性 ,周期为 2 π 2\pi 2 π (图1.4)。正切函数的周期为 π \pi π (下面的公式 π + θ \pi + \theta π + θ 展示了原因);它在 cos θ = 0 \cos\theta = 0 cos θ = 0 处未定义,在 θ = π / 2 + k π \theta = \pi/2 + k\pi θ = π /2 + k π 处对每个整数 k k k 都成立。
对称性。 旋转 − θ -\theta − θ 得到 P P P 关于 x x x 轴的镜像,因此 cos ( − θ ) = cos θ \cos(-\theta) = \cos\theta cos ( − θ ) = cos θ 和 sin ( − θ ) = − sin θ : \sin(-\theta) = -\sin\theta\mathclose{\text{:}} sin ( − θ ) = − sin θ : 余弦是偶函数,正弦是奇函数。
标准角度处的精确值来自学校几何中的两个三角形,每个三角形的斜边长均为1。沿对角线切割正方形得到一个直角三角形,其两个角均为 π / 4 ; \pi/4\mathclose{\text{;}} π /4 ; 其两条较短边相等,设为 s , s\mathclose{\text{,}} s , 由勾股定理得 2 s 2 = 1 , 2s^2 = 1\mathclose{\text{,}} 2 s 2 = 1 , 因此 s = 1 / 2 = 2 / 2 。 s = 1/\sqrt2 = \sqrt2/2\mathclose{\text{。}} s = 1/ 2 = 2 /2 。 将边长为1的等边三角形沿中线切开,得到一个角为 π / 6 \pi/6 π /6 和 π / 3 \pi/3 π /3 的直角三角形;其最短边(对 π / 6 \pi/6 π /6 角)长为 1 2 , \tfrac12\mathclose{\text{,}} 2 1 , 由勾股定理得第三边长为 1 − 1 4 = 3 / 2 。 \sqrt{1 - \tfrac14} = \sqrt3/2\mathclose{\text{。}} 1 − 4 1 = 3 /2 。 由“对边比斜边”和“邻边比斜边”可得表格的中间三行;第一行和最后一行是单位圆上的点 ( 1 , 0 ) (1, 0) ( 1 , 0 ) 和 ( 0 , 1 ) : (0, 1)\mathclose{\text{:}} ( 0 , 1 ) :
θ \theta θ
sin θ \sin\theta sin θ
cos θ \cos\theta cos θ
tan θ \tan\theta tan θ
0 0 0
0 0 0
1 1 1
0 0 0
π / 6 \pi/6 π /6
1 / 2 1/2 1/2
3 / 2 \sqrt3/2 3 /2
1 / 3 1/\sqrt3 1/ 3
π / 4 \pi/4 π /4
2 / 2 \sqrt2/2 2 /2
2 / 2 \sqrt2/2 2 /2
1 1 1
π / 3 \pi/3 π /3
3 / 2 \sqrt3/2 3 /2
1 / 2 1/2 1/2
3 \sqrt3 3
π / 2 \pi/2 π /2
1 1 1
0 0 0
无定义
对于其他角度,利用圆的对称性。角度为 π − θ \pi - \theta π − θ 的点关于 y y y 轴是角度为 θ \theta θ 的点的镜像,而角度为 π + θ \pi + \theta π + θ 的点是其关于原点的反射,因此
sin ( π − θ ) = sin θ , cos ( π − θ ) = − cos θ , sin ( π + θ ) = − sin θ , cos ( π + θ ) = − cos θ . \begin{aligned} \sin(\pi - \theta) &= \sin\theta, & \cos(\pi - \theta) &= -\cos\theta, \\ \sin(\pi + \theta) &= -\sin\theta, & \cos(\pi + \theta) &= -\cos\theta. \end{aligned} sin ( π − θ ) sin ( π + θ ) = sin θ , = − sin θ , cos ( π − θ ) cos ( π + θ ) = − cos θ , = − cos θ .
例 1.8
2 π / 3 2\pi/3 2 π /3 处的精确值✓ 已检验
求 θ = 2 π / 3 \theta = 2\pi/3 θ = 2 π /3 处 sin 、 \sin\mathclose{\text{、}} sin 、 cos \cos cos 和 tan \tan tan 的精确值,以及该角度处单位圆上的点。
2 π / 3 2\pi/3 2 π /3 是 120 ∘ , 120^\circ\mathclose{\text{,}} 12 0 ∘ , 且为 2 π / 3 = π − π / 3 。 2\pi/3 = \pi - \pi/3\mathclose{\text{。}} 2 π /3 = π − π /3 。 由关于 y y y 轴的镜像对称性,
sin 2 π 3 = sin π 3 = 3 2 , cos 2 π 3 = − cos π 3 = − 1 2 , \begin{aligned} \sin\frac{2\pi}{3} &= \sin\frac{\pi}{3} = \frac{\sqrt3}{2}, \\ \cos\frac{2\pi}{3} &= -\cos\frac{\pi}{3} = -\frac12, \end{aligned} sin 3 2 π cos 3 2 π = sin 3 π = 2 3 , = − cos 3 π = − 2 1 ,
因此
tan 2 π 3 = 3 / 2 − 1 / 2 = − 3 . \tan\frac{2\pi}{3} = \frac{\sqrt3/2}{-1/2} = -\sqrt3. tan 3 2 π = − 1/2 3 /2 = − 3 .
该点为 ( − 1 2 , 3 2 ) : \big(-\tfrac12, \tfrac{\sqrt3}{2}\big)\mathclose{\text{:}} ( − 2 1 , 2 3 ) : 位于 y y y 轴左侧且 x x x 轴上方,正如角度为 120 ∘ 120^\circ 12 0 ∘ 时应有的位置。利用勾股恒等式进行验证:( 3 2 ) 2 + ( − 1 2 ) 2 = 3 4 + 1 4 = 1 。 \big(\tfrac{\sqrt3}{2}\big)^2 + \big(-\tfrac12\big)^2 = \tfrac34 + \tfrac14 = 1\mathclose{\text{。}} ( 2 3 ) 2 + ( − 2 1 ) 2 = 4 3 + 4 1 = 1 。
须知
来自学校三角学的两个恒等式,即 加法公式 ,从模块 5 开始使用:
sin ( x + y ) = sin x cos y + cos x sin y , cos ( x + y ) = cos x cos y − sin x sin y . \begin{aligned} \sin(x + y) &= \sin x\cos y + \cos x\sin y, \\ \cos(x + y) &= \cos x\cos y - \sin x\sin y. \end{aligned} sin ( x + y ) cos ( x + y ) = sin x cos y + cos x sin y , = cos x cos y − sin x sin y .
注意
关于三角函数的三个常见错误。计算器处于角度模式时给出 sin 30 = 0.5 ; \sin 30 = 0.5\mathclose{\text{;}} sin 30 = 0.5 ; 在弧度制下,结果为 sin 30 ≈ − 0.988 , \sin 30 \approx -0.988\mathclose{\text{,}} sin 30 ≈ − 0.988 , 因为 30 弧度几乎等于五圈。sin x 2 \sin x^2 sin x 2 意味着 sin ( x 2 ) , \sin(x^2)\mathclose{\text{,}} sin ( x 2 ) , 而 sin 2 x \sin^2 x sin 2 x 意味着 ( sin x ) 2 。 (\sin x)^2\mathclose{\text{。}} ( sin x ) 2 。 并且 sin ( x + y ) \sin(x + y) sin ( x + y ) 不等于 sin x + sin y : \sin x + \sin y\mathclose{\text{:}} sin x + sin y : 请使用加法公式。
将 f ( x ) = x 2 f(x) = x^2 f ( x ) = x 2 与 g ( x ) = ( x − 2 ) 2 g(x) = (x - 2)^2 g ( x ) = ( x − 2 ) 2 进行比较。在 x = 5 x = 5 x = 5 处,g g g 给出 3 2 = 9 , 3^2 = 9\mathclose{\text{,}} 3 2 = 9 , 即 f f f 在 x = 3 x = 3 x = 3 处的值;在 x = 2 x = 2 x = 2 处,g g g 给出 0,即 f f f 在 0 处的值。一般而言 g ( x ) = f ( x − 2 ) : g(x) = f(x - 2)\mathclose{\text{:}} g ( x ) = f ( x − 2 ) : g g g 在 x x x 处所做之事,与 f f f 在两个单位之前所做之事相同。因此整个图形向右移动 2 个单位。
对公式的每次简单更改都会以简单的方式移动图形。对于常数 c > 0 : c > 0\mathclose{\text{:}} c > 0 :
公式
y = f ( x ) y = f(x) y = f ( x ) 的图形是
f ( x ) + c , f(x) + c\mathclose{\text{,}} f ( x ) + c , f ( x ) − c f(x) - c f ( x ) − c
沿 c c c 方向上下平移
f ( x − c ) , f(x - c)\mathclose{\text{,}} f ( x − c ) , f ( x + c ) f(x + c) f ( x + c )
沿 c c c 方向左右平移
c f ( x ) c\,f(x) c f ( x )
沿垂直方向拉伸 c c c 倍(若 c < 1 c < 1 c < 1 则压缩)
f ( c x ) f(cx) f ( c x )
沿水平方向压缩 c c c 倍(若 c < 1 c < 1 c < 1 则拉伸)
− f ( x ) -f(x) − f ( x )
关于 x x x 轴反射
f ( − x ) f(-x) f ( − x )
关于 y y y 轴反射
f f f 外部的更改按其外观方式起作用。f f f 内部的更改作用方式相反,因为新函数在 x x x 处达到 f f f 的每个值:f ( x − c ) f(x - c) f ( x − c ) 将图形向右移动,而 f ( 2 x ) f(2x) f ( 2 x ) 在 x = 3 x = 3 x = 3 处达到 f f f 在 6 处的值,因此所有事情提前两倍发生,图形向 y y y 轴压缩。
例 1.9
从 y = x 2 y = x^2 y = x 2 构建图形 ✓ 已检验
描述如何从 y = x 2 y = x^2 y = x 2 的图形获得 g ( x ) = − ( x + 2 ) 2 + 4 g(x) = -(x + 2)^2 + 4 g ( x ) = − ( x + 2 ) 2 + 4 的图形。找到 g g g 图形的最高点、零点以及 g g g 的值域。
按照抛物线的底部点 ( 0 , 0 ) , (0, 0)\mathclose{\text{,}} ( 0 , 0 ) , 分三步构建 g : g\mathclose{\text{:}} g :
( x + 2 ) 2 (x + 2)^2 ( x + 2 ) 2 是 x 2 , x^2\mathclose{\text{,}} x 2 , 其中 x x x 替换为 x + 2 : x + 2\mathclose{\text{:}} x + 2 : 向左平移 2 个单位。点 ( 0 , 0 ) (0, 0) ( 0 , 0 ) 移动到 ( − 2 , 0 ) 。 (-2, 0)\mathclose{\text{。}} ( − 2 , 0 ) 。
− ( x + 2 ) 2 : -(x + 2)^2\mathclose{\text{:}} − ( x + 2 ) 2 : 关于 x x x 轴反射。抛物线现在开口向下,且 ( − 2 , 0 ) (-2, 0) ( − 2 , 0 ) 保持原位。
− ( x + 2 ) 2 + 4 : -(x + 2)^2 + 4\mathclose{\text{:}} − ( x + 2 ) 2 + 4 : 向上平移 4 个单位。该点移动到 ( − 2 , 4 ) 。 (-2, 4)\mathclose{\text{。}} ( − 2 , 4 ) 。
因此图像是一个开口向下的抛物线,其最高点位于 ( − 2 , 4 ) 。 (-2, 4)\mathclose{\text{。}} ( − 2 , 4 ) 。 对于零点,− ( x + 2 ) 2 + 4 = 0 -(x + 2)^2 + 4 = 0 − ( x + 2 ) 2 + 4 = 0 意味着 ( x + 2 ) 2 = 4 , (x + 2)^2 = 4\mathclose{\text{,}} ( x + 2 ) 2 = 4 , 即 x + 2 = 2 x + 2 = 2 x + 2 = 2 或 x + 2 = − 2 , x + 2 = -2\mathclose{\text{,}} x + 2 = − 2 , 也就是 x = 0 x = 0 x = 0 或 x = − 4 。 x = -4\mathclose{\text{。}} x = − 4 。 由于 ( x + 2 ) 2 ≥ 0 , (x + 2)^2 \ge 0\mathclose{\text{,}} ( x + 2 ) 2 ≥ 0 , g g g 的每个值至多为 4。反之,每个数 y ≤ 4 y \le 4 y ≤ 4 都是一个函数值:g ( x ) = y g(x) = y g ( x ) = y 意味着 ( x + 2 ) 2 = 4 − y , (x + 2)^2 = 4 - y\mathclose{\text{,}} ( x + 2 ) 2 = 4 − y , 这在 x = − 2 + 4 − y x = -2 + \sqrt{4 - y} x = − 2 + 4 − y 处成立。因此值域为 ( − ∞ , 4 ] 。 (-\infty, 4]\mathclose{\text{。}} ( − ∞ , 4 ] 。 在探索器中:f ( x ) = x 2 , f(x) = x^2\mathclose{\text{,}} f ( x ) = x 2 , a = − 1 , a = -1\mathclose{\text{,}} a = − 1 , c = − 2 , c = -2\mathclose{\text{,}} c = − 2 , d = 4 。 d = 4\mathclose{\text{。}} d = 4 。
注意
f ( x − 3 ) f(x - 3) f ( x − 3 ) 将图像向右 平移三个单位。f f f 内的减号容易让人误以为向左移动。取一个点检验,原来的函数值 f ( 0 ) f(0) f ( 0 ) 现在在 x = 3 x = 3 x = 3 处取得。
复合
要计算 x 2 + 1 , \sqrt{x^2 + 1}\mathclose{\text{,}} x 2 + 1 , 你先平方并加 1,然后取平方根:该函数是两个更简单函数的链,g ( x ) = x 2 + 1 g(x) = x^2 + 1 g ( x ) = x 2 + 1 后接 f ( u ) = u 。 f(u) = \sqrt u\mathclose{\text{。}} f ( u ) = u 。
定义 1.9复合
复合 f ∘ g , f \circ g\mathclose{\text{,}} f ∘ g , 读作“f 与 g 的复合”或“g 之后的 f”,是函数
( f ∘ g ) ( x ) = f ( g ( x ) ) . (f \circ g)(x) = f\big(g(x)\big). ( f ∘ g ) ( x ) = f ( g ( x ) ) .
其定义域是 g g g 定义域中所有使得 g ( x ) g(x) g ( x ) 在 f f f 定义域内的 x x x 的集合。
写在 x x x 旁边的函数最先作用:在 f ∘ g f \circ g f ∘ g 中,先 g , g\mathclose{\text{,}} g , 再 f 。 f\mathclose{\text{。}} f 。 在程序中,复合是一个管道,其中一个函数的输出成为下一个函数的输入;神经网络是简单函数(其层)的长复合。
例 1.10两种顺序的复合 ✓ 已检验
设 f ( x ) = x f(x) = \sqrt{x} f ( x ) = x 和 g ( x ) = x − 3 。 g(x) = x - 3\mathclose{\text{。}} g ( x ) = x − 3 。 求 f ∘ g f \circ g f ∘ g 和 g ∘ f g \circ f g ∘ f 及其定义域,并在 x = 7 x = 7 x = 7 处求值。
( f ∘ g ) ( x ) = f ( x − 3 ) = x − 3 。 (f \circ g)(x) = f(x - 3) = \sqrt{x - 3}\mathclose{\text{。}} ( f ∘ g ) ( x ) = f ( x − 3 ) = x − 3 。 这里 g g g 接受任何 x , x\mathclose{\text{,}} x , 而 f f f 需要其输入 x − 3 x - 3 x − 3 至少为 0,因此定义域为 [ 3 , ∞ ) 。 [3, \infty)\mathclose{\text{。}} [ 3 , ∞ ) 。
( g ∘ f ) ( x ) = g ( x ) = x − 3 。 (g \circ f)(x) = g(\sqrt x) = \sqrt x - 3\mathclose{\text{。}} ( g ∘ f ) ( x ) = g ( x ) = x − 3 。 这里 f f f 需要 x ≥ 0 , x \ge 0\mathclose{\text{,}} x ≥ 0 , 而 g g g 接受任何输入,因此定义域为 [ 0 , ∞ ) 。 [0, \infty)\mathclose{\text{。}} [ 0 , ∞ ) 。
在 x = 7 x = 7 x = 7 处:( f ∘ g ) ( 7 ) = 4 = 2 , (f \circ g)(7) = \sqrt4 = 2\mathclose{\text{,}} ( f ∘ g ) ( 7 ) = 4 = 2 , 而 ( g ∘ f ) ( 7 ) = 7 − 3 ≈ − 0.354 。 (g \circ f)(7) = \sqrt7 - 3 \approx -0.354\mathclose{\text{。}} ( g ∘ f ) ( 7 ) = 7 − 3 ≈ − 0.354 。 两种顺序给出不同的函数,具有不同的定义域:在复合中,顺序很重要。
将复杂函数视为复合是一项技能,模块 5 的链式法则依赖于它。例如,h ( x ) = ( 2 x + 1 ) 5 h(x) = (2x + 1)^5 h ( x ) = ( 2 x + 1 ) 5 是 f ( g ( x ) ) f\big(g(x)\big) f ( g ( x ) ) 与 内层函数 g ( x ) = 2 x + 1 g(x) = 2x + 1 g ( x ) = 2 x + 1 和 外层函数 f ( u ) = u 5 ; f(u) = u^5\mathclose{\text{;}} f ( u ) = u 5 ; 而 e − x 2 e^{-x^2} e − x 2 是 f ( g ( x ) ) f\big(g(x)\big) f ( g ( x ) ) 与 g ( x ) = − x 2 g(x) = -x^2 g ( x ) = − x 2 和 f ( u ) = e u 。 f(u) = e^u\mathclose{\text{。}} f ( u ) = e u 。
注意
复合函数的定义域来自其组成部分,而非简化后的公式。对于 f ( x ) = x 2 f(x) = x^2 f ( x ) = x 2 和 g ( x ) = x , g(x) = \sqrt x\mathclose{\text{,}} g ( x ) = x , ( f ∘ g ) ( x ) = ( x ) 2 = x , (f \circ g)(x) = (\sqrt x)^2 = x\mathclose{\text{,}} ( f ∘ g ) ( x ) = ( x ) 2 = x , 但仅当 x ≥ 0 x \ge 0 x ≥ 0 时:g ( − 4 ) g(-4) g ( − 4 ) 未定义,因此 f ( g ( − 4 ) ) f\big(g(-4)\big) f ( g ( − 4 ) ) 也未定义。
反函数
公式 F = 1.8 C + 32 F = 1.8C + 32 F = 1.8 C + 32 将摄氏度转换为华氏度,而 C = ( F − 32 ) / 1.8 C = (F - 32)/1.8 C = ( F − 32 ) /1.8 将其转换回来:100 °C 变为 212 °F,而 212 °F 又变回 100 °C。每个公式都撤销了另一个公式的操作。并非每个函数都可逆:x 2 x^2 x 2 将 2 和 − 2 -2 − 2 都映射到 4,因此输出 4 无法告诉你输入值。
定义 1.10单射函数
如果不同的输入总是产生不同的输出,则函数 f f f 是 单射 的:只要 x 1 ≠ x 2 , x_1 \ne x_2\mathclose{\text{,}} x 1 = x 2 , 就有 f ( x 1 ) ≠ f ( x 2 ) 。 f(x_1) \ne f(x_2)\mathclose{\text{。}} f ( x 1 ) = f ( x 2 ) 。
水平线 y = k y = k y = k 与 f f f 的图像在 f ( x ) = k f(x) = k f ( x ) = k 处相交,因此 f f f 是单射的,当且仅当没有水平线与其图像相交超过一次:水平线测试 。x 3 x^3 x 3 和 e x e^x e x 通过了该测试;x 2 x^2 x 2 和 sin x \sin x sin x 未通过该测试。
定义 1.11反函数
设 f f f 是一个定义域为 D D D 且值域为 R R R 的单射函数。其 反函数 f − 1 , f^{-1}\mathclose{\text{,}} f − 1 , 读作“f 反”,定义域为 R R R 且值域为 D , D\mathclose{\text{,}} D , 并由下式定义
f − 1 ( y ) = x exactly when f ( x ) = y . f^{-1}(y) = x \quad\text{exactly when}\quad f(x) = y. f − 1 ( y ) = x exactly when f ( x ) = y .
用文字表述,f − 1 f^{-1} f − 1 将 f f f 的每个输出映射回其来源的输入。因此,两者相互抵消:
f − 1 ( f ( x ) ) = x for every x in D , f ( f − 1 ( y ) ) = y for every y in R . \begin{aligned} f^{-1}\big(f(x)\big) &= x \quad \text{for every } x \text{ in } D, \\ f\big(f^{-1}(y)\big) &= y \quad \text{for every } y \text{ in } R. \end{aligned} f − 1 ( f ( x ) ) f ( f − 1 ( y ) ) = x for every x in D , = y for every y in R .
e x e^x e x 和 ln x \ln x ln x 是你在 1.4 节中遇到的一对:ln ( e x ) = x \ln(e^x) = x ln ( e x ) = x 对每个实数 x x x 成立,且 e ln y = y e^{\ln y} = y e l n y = y 对每个 y > 0 y > 0 y > 0 成立。
注意
f − 1 ( x ) f^{-1}(x) f − 1 ( x ) 并不意味着 1 f ( x ) : \dfrac{1}{f(x)}\mathclose{\text{:}} f ( x ) 1 : 这里的 − 1 -1 − 1 不是指数,而是逆函数名称的一部分。对于 f ( x ) = 2 x , f(x) = 2x\mathclose{\text{,}} f ( x ) = 2 x , f − 1 ( x ) = x / 2 , f^{-1}(x) = x/2\mathclose{\text{,}} f − 1 ( x ) = x /2 , 尽管 1 / f ( x ) = 1 / ( 2 x ) 。 1/f(x) = 1/(2x)\mathclose{\text{。}} 1/ f ( x ) = 1/ ( 2 x ) 。 当你意指倒数时,请写 1 f ( x ) \dfrac{1}{f(x)} f ( x ) 1 或 ( f ( x ) ) − 1 。 \big(f(x)\big)^{-1}\mathclose{\text{。}} ( f ( x ) ) − 1 。
为了找到 f − 1 f^{-1} f − 1 的公式,请写出 y = f ( x ) y = f(x) y = f ( x ) 并解出 x 。 x\mathclose{\text{。}} x 。 如果值域中的每个 y y y 恰好来自一个 x , x\mathclose{\text{,}} x , 那么 f f f 是一对一的,且该解是 x = f − 1 ( y ) 。 x = f^{-1}(y)\mathclose{\text{。}} x = f − 1 ( y ) 。 最后,将 y y y 重命名为 x , x\mathclose{\text{,}} x , 以便像往常一样使 x x x 成为 f − 1 f^{-1} f − 1 的输入。
例 1.11求逆函数 ✓ 已检验
证明 f ( x ) = x + 1 x − 2 f(x) = \dfrac{x + 1}{x - 2} f ( x ) = x − 2 x + 1 (其中 x ≠ 2 ) x \ne 2\mathclose{\text{)}} x = 2 ) 是一对一的,并求其值域及其逆函数。
写出 y = x + 1 x − 2 y = \dfrac{x + 1}{x - 2} y = x − 2 x + 1 并解出 x 。 x\mathclose{\text{。}} x 。 两边同乘 x − 2 , x - 2\mathclose{\text{,}} x − 2 , 将含有 x x x 的项收集到左边并因式分解:
y ( x − 2 ) = x + 1 y x − x = 2 y + 1 x ( y − 1 ) = 2 y + 1. \begin{aligned} y(x - 2) &= x + 1 \\ yx - x &= 2y + 1 \\ x(y - 1) &= 2y + 1. \end{aligned} y ( x − 2 ) y x − x x ( y − 1 ) = x + 1 = 2 y + 1 = 2 y + 1.
如果 y = 1 , y = 1\mathclose{\text{,}} y = 1 , 最后一行表明 0 = 3 , 0 = 3\mathclose{\text{,}} 0 = 3 , 这是不可能的:值 1 永远无法达到。如果 y ≠ 1 , y \ne 1\mathclose{\text{,}} y = 1 , 则除以 y − 1 : y - 1\mathclose{\text{:}} y − 1 :
x = 2 y + 1 y − 1 . x = \frac{2y + 1}{y - 1}. x = y − 1 2 y + 1 .
此 x x x 永远不为 2(那需要 2 y + 1 = 2 y − 2 , 2y + 1 = 2y - 2\mathclose{\text{,}} 2 y + 1 = 2 y − 2 , 即 1 = − 2 ), 1 = -2\mathclose{\text{),}} 1 = − 2 ), 因此它属于定义域。每个 y ≠ 1 y \ne 1 y = 1 恰好来自一个 x : x\mathclose{\text{:}} x : f f f 是一对一的,其值域是 ( − ∞ , 1 ) ∪ ( 1 , ∞ ) , (-\infty, 1) \cup (1, \infty)\mathclose{\text{,}} ( − ∞ , 1 ) ∪ ( 1 , ∞ ) , 并且将 y y y 重命名为 x , x\mathclose{\text{,}} x ,
f − 1 ( x ) = 2 x + 1 x − 1 , x ≠ 1. f^{-1}(x) = \frac{2x + 1}{x - 1}, \qquad x \ne 1. f − 1 ( x ) = x − 1 2 x + 1 , x = 1.
检查一个值:f ( 3 ) = 4 / 1 = 4 , f(3) = 4/1 = 4\mathclose{\text{,}} f ( 3 ) = 4/1 = 4 , 以及 f − 1 ( 4 ) = 9 / 3 = 3 。 f^{-1}(4) = 9/3 = 3\mathclose{\text{。}} f − 1 ( 4 ) = 9/3 = 3 。
反函数的图像随 f f f 的图像免费获得。
定理 1.2反函数的图像
如果 f f f 是一对一的,则 f − 1 f^{-1} f − 1 的图像是 f f f 的图像关于直线 y = x y = x y = x 的反射。
证明
点 ( p , q ) (p, q) ( p , q ) 位于 f f f 的图像上,当且仅当 f ( p ) = q , f(p) = q\mathclose{\text{,}} f ( p ) = q , 即,当且仅当 f − 1 ( q ) = p , f^{-1}(q) = p\mathclose{\text{,}} f − 1 ( q ) = p , 即,当且仅当 ( q , p ) (q, p) ( q , p ) 位于 f − 1 f^{-1} f − 1 的图像上。因此,f − 1 f^{-1} f − 1 的图像由 f f f 的图像的点组成,其坐标互换。交换坐标是关于直线 y = x y = x y = x 的反射:如果 p ≠ q , p \ne q\mathclose{\text{,}} p = q , 则 ( p , q ) (p, q) ( p , q ) 和 ( q , p ) (q, p) ( q , p ) 的中点 ( p + q 2 , p + q 2 ) \big(\tfrac{p+q}{2}, \tfrac{p+q}{2}\big) ( 2 p + q , 2 p + q ) 位于直线上,并且连接它们的线段的斜率为 p − q q − p = − 1 , \tfrac{p - q}{q - p} = -1\mathclose{\text{,}} q − p p − q = − 1 , 因此它垂直于斜率为 1 的直线。如果 p = q , p = q\mathclose{\text{,}} p = q , 则该点位于直线上且是其自身的镜像。
∎
无法通过水平线测试的函数,通常可以通过限制其定义域 使其成为单射:在[ 0 , ∞ ) [0, \infty) [ 0 , ∞ ) 上,x 2 x^2 x 2 是单射,其逆函数为x 。 \sqrt x\mathclose{\text{。}} x 。 将y = x y = x y = x 中抛物线的右半部分进行反射,得到侧放的半抛物线。
回到第1.3节中关于下落小球及其表格的内容。在t = 1 t = 1 t = 1 和t = 3 t = 3 t = 3 之间,它在2秒内下落了s ( 3 ) − s ( 1 ) = 44.1 − 4.9 = 39.2 s(3) - s(1) = 44.1 - 4.9 = 39.2 s ( 3 ) − s ( 1 ) = 44.1 − 4.9 = 39.2 米,平均速度为39.2 / 2 = 19.6 39.2/2 = 19.6 39.2/2 = 19.6 米/秒(m/s)。在t = 1 t = 1 t = 1 和t = 2 t = 2 t = 2 之间,它在1秒内下落了19.6 − 4.9 = 14.7 19.6 - 4.9 = 14.7 19.6 − 4.9 = 14.7 米:14.7 m/s。小球正在加速,因此平均值取决于区间。在时刻t = 1 , t = 1\mathclose{\text{,}} t = 1 , 即小球上的速度计会显示的速度是多少?
定义 1.12平均变化率
函数 f f f 在区间 [ a , b ] [a, b] [ a , b ] 上的 平均变化率 为
f ( b ) − f ( a ) b − a = Δ y Δ x . \frac{f(b) - f(a)}{b - a} = \frac{\Delta y}{\Delta x}. b − a f ( b ) − f ( a ) = Δ x Δ y .
Δ \Delta Δ 是大写希腊字母Delta,用于表示“变化量”:Δ x = b − a \Delta x = b - a Δ x = b − a 是自变量的变化量,Δ y = f ( b ) − f ( a ) \Delta y = f(b) - f(a) Δ y = f ( b ) − f ( a ) 是因变量的变化量,Δ y / Δ x \Delta y/\Delta x Δ y /Δ x 读作“delta y over delta x”。其单位是输出单位除以输入单位:对于小球是米/秒,对于冷却的茶杯是度/分钟。
几何上,Δ y / Δ x \Delta y/\Delta x Δ y /Δ x 是通过图像上两点 ( a , f ( a ) ) (a, f(a)) ( a , f ( a )) 和 ( b , f ( b ) ) (b, f(b)) ( b , f ( b )) 的割线 的斜率 。对于线性函数,每一条割线都是该函数本身,因此在任意区间上的平均变化率等于斜率 m 。 m\mathclose{\text{。}} m 。 对于曲线来说,这取决于所选的区间,如图 1.5 所示。
图 1.5 下落的球,s ( t ) = 4.9 t 2 。 s(t) = 4.9t^2\mathclose{\text{。}} s ( t ) = 4.9 t 2 。 从( 1 , 4.9 ) (1, 4.9) ( 1 , 4.9 ) 到t = 1 + h t = 1 + h t = 1 + h 处点的割线,对于h = 2 , h = 2\mathclose{\text{,}} h = 2 , 1和0.5,斜率分别为19.6、14.7和12.25:这是在[ 1 , 3 ] 、 [1, 3]\mathclose{\text{、}} [ 1 , 3 ] 、 [ 1 , 2 ] [1, 2] [ 1 , 2 ] 和[ 1 , 1.5 ] [1, 1.5] [ 1 , 1.5 ] 上的平均速度。随着h h h 缩小,割线趋近于t = 1 t = 1 t = 1 处的虚线切线,其斜率为9.8。
差商
为了研究越来越短的区间上的变化率,固定起点a a a 并将区间长度称为h 。 h\mathclose{\text{。}} h 。
定义 1.13差商
对于函数f 、 f\mathclose{\text{、}} f 、 数a a a 和数h ≠ 0 , h \ne 0\mathclose{\text{,}} h = 0 , 其中a a a 和a + h a + h a + h 在f f f 的定义域内,差商 是
f ( a + h ) − f ( a ) h . \frac{f(a + h) - f(a)}{h}. h f ( a + h ) − f ( a ) .
它是f f f 在a a a 和a + h a + h a + h 之间的平均变化率:在[ a , a + h ] [a, a + h] [ a , a + h ] 上(如果h > 0 ), h > 0\mathclose{\text{),}} h > 0 ), 以及在[ a + h , a ] [a + h, a] [ a + h , a ] 上(如果h < 0 )。 h < 0\mathclose{\text{)。}} h < 0 )。
例 1.12下落球的差商 ✓ 已检验
简化 s ( t ) = 4.9 t 2 s(t) = 4.9t^2 s ( t ) = 4.9 t 2 的差商在 t = 1 t = 1 t = 1 处。
将 1 + h 1 + h 1 + h 代入 t , t\mathclose{\text{,}} t , 保留括号,并展开:
s ( 1 + h ) = 4.9 ( 1 + h ) 2 = 4.9 ( 1 + 2 h + h 2 ) = 4.9 + 9.8 h + 4.9 h 2 . \begin{aligned} s(1 + h) &= 4.9(1 + h)^2 \\ &= 4.9(1 + 2h + h^2) \\ &= 4.9 + 9.8h + 4.9h^2. \end{aligned} s ( 1 + h ) = 4.9 ( 1 + h ) 2 = 4.9 ( 1 + 2 h + h 2 ) = 4.9 + 9.8 h + 4.9 h 2 .
减去 s ( 1 ) = 4.9 : s(1) = 4.9\mathclose{\text{:}} s ( 1 ) = 4.9 : 常数项抵消,且 s ( 1 + h ) − s ( 1 ) = 9.8 h + 4.9 h 2 。 s(1 + h) - s(1) = 9.8h + 4.9h^2\mathclose{\text{。}} s ( 1 + h ) − s ( 1 ) = 9.8 h + 4.9 h 2 。 每个剩余项都包含 h , h\mathclose{\text{,}} h , 因此除以 h h h (由于 h ≠ 0 h \ne 0 h = 0 允许)得到
s ( 1 + h ) − s ( 1 ) h = 9.8 h + 4.9 h 2 h = 9.8 + 4.9 h ( h ≠ 0 ) . \begin{aligned} \frac{s(1 + h) - s(1)}{h} &= \frac{9.8h + 4.9h^2}{h} \\ &= 9.8 + 4.9h \qquad (h \ne 0). \end{aligned} h s ( 1 + h ) − s ( 1 ) = h 9.8 h + 4.9 h 2 = 9.8 + 4.9 h ( h = 0 ) .
对于 h = 2 , h = 2\mathclose{\text{,}} h = 2 , 1 和 0.5,这分别给出 19.6、14.7 和 12.25,即图 1.5 中的斜率。
缩小区间
现在让 h h h 缩小。表格显示了距离变化 s ( 1 + h ) − s ( 1 ) , s(1 + h) - s(1)\mathclose{\text{,}} s ( 1 + h ) − s ( 1 ) , 以及在以 t = 1 t = 1 t = 1 (h > 0 ) h > 0\mathclose{\text{)}} h > 0 ) 开始或以 h < 0 h < 0 h < 0 结束的区间上的平均速度。对于 h < 0 , h < 0\mathclose{\text{,}} h < 0 , 变化量为负,因为 s ( 1 + h ) s(1 + h) s ( 1 + h ) 是较早的位置,将其除以负的 h h h 得到正的速度:
h h h s ( 1 + h ) − s ( 1 ) s(1+h) - s(1) s ( 1 + h ) − s ( 1 ) s ( 1 + h ) − s ( 1 ) h \dfrac{s(1+h) - s(1)}{h} h s ( 1 + h ) − s ( 1 ) 1 1 1 14.7 14.7 14.7 14.7 14.7 14.7 0.1 0.1 0.1 1.029 1.029 1.029 10.29 10.29 10.29 0.01 0.01 0.01 0.09849 0.09849 0.09849 9.849 9.849 9.849 0.001 0.001 0.001 0.0098049 0.0098049 0.0098049 9.8049 9.8049 9.8049 − 0.001 -0.001 − 0.001 − 0.0097951 -0.0097951 − 0.0097951 9.7951 9.7951 9.7951 − 0.01 -0.01 − 0.01 − 0.09751 -0.09751 − 0.09751 9.751 9.751 9.751 − 0.1 -0.1 − 0.1 − 0.931 -0.931 − 0.931 9.31 9.31 9.31 − 1 -1 − 1 − 4.9 -4.9 − 4.9 4.9 4.9 4.9
当 h h h 从两侧趋近于 0 时,平均速度收敛于 9.8 m/s。例 1.12 中的公式 9.8 + 4.9 h 9.8 + 4.9h 9.8 + 4.9 h 说明了原因:项 4.9 h 4.9h 4.9 h 收缩为零。将 9.8 m/s 称为球在时刻 t = 1 t = 1 t = 1 的速度,即其瞬时速度 ,这是自然的。在图 1.5 中,它是切线的斜率。
要点
瞬时变化率是当区间缩小时,平均变化率所趋近的那个数值。你不能在差商中令 h = 0 h = 0 h = 0 等于 0,因为那会使差商变为 0 / 0 ; 0/0\mathclose{\text{;}} 0/0 ; 相反,你要观察当 h h h 趋近于 0 时会发生什么。模块 2 使“趋近”这一概念精确化:它指的是 极限 的概念。模块 4 将结果称为导数 。
注意
当你在公式中代入 a + h a + h a + h 时,替换每一个 x x x 并保留括号。对于 f ( x ) = x 2 , f(x) = x^2\mathclose{\text{,}} f ( x ) = x 2 , f ( 1 + h ) = ( 1 + h ) 2 = 1 + 2 h + h 2 。 f(1 + h) = (1 + h)^2 = 1 + 2h + h^2\mathclose{\text{。}} f ( 1 + h ) = ( 1 + h ) 2 = 1 + 2 h + h 2 。 它不是 f ( 1 ) + h = 1 + h , f(1) + h = 1 + h\mathclose{\text{,}} f ( 1 ) + h = 1 + h , 也不是 f ( 1 ) + f ( h ) = 1 + h 2 。 f(1) + f(h) = 1 + h^2\mathclose{\text{。}} f ( 1 ) + f ( h ) = 1 + h 2 。 丢失中间项 2 h 2h 2 h 是差商中最常见的错误。
本节为可选内容:你仅在“动手计算”框中需要 Python。三个免费软件包将 Python 编程语言转化为数学工作台:SymPy 对符号进行精确的代数和微积分运算,NumPy 对数字数组进行计算,而matplotlib 用于绘制图形。
这些页面上的输出是使用 Python 3.11.18、SymPy 1.14.0、mpmath 1.3.0、NumPy 2.4.6 和 matplotlib 3.11.2 生成的。在撰写本文时(2026 年 11 月),最新的 Python 版本为 3.15.2;当前的 NumPy(2.5.5)需要 Python 3.12 或更高版本,当前的 matplotlib(3.11.2)需要 Python 3.11 或更高版本,且两者均提供适用于 Windows、macOS 和 Linux 上 Python 3.12 至 3.15 的预构建包。较新的版本可能会以不同的方式打印某些结果,例如以不同的顺序排列项。
安装 Python
在网页浏览器中,打开 python.org/downloads 并点击 下载 Python 安装管理器 。(Python 安装管理器 也位于 Microsoft Store 中;这两个版本完全相同。)
双击下载的文件并选择 安装 。这将为您提供命令 python、py 和 pymanager。
从开始菜单打开 PowerShell 并输入 python。如果尚未安装 Python 运行时,安装管理器会自动安装最新发行版。当 Python 启动时,它会显示其提示符 >>>;输入 exit() 并按 Enter 键退出。
当你第一次安装运行时环境时,通常会被询问是否要将一个文件夹 %LocalAppData%\Python\bin 添加到你的 PATH 中。这是可选的,因为本系列使用的是 py 命令,无论是否添加该文件夹都能正常工作。
许多指南仍然描述传统的完整安装程序。由于 Python 3.14 已弃用该安装方式,并且不会为 Python 3.16 或更高版本提供该安装程序,因此本页面使用安装管理器。
在网页浏览器中打开 python.org/downloads 并下载最新版本的 macOS 安装包 (.pkg)。这是一个 universal2 构建版本,适用于 Apple Silicon 和 Intel Mac。
双击该安装包。点击 继续 (阅读说明),继续 和同意 (许可协议),然后点击 安装 。安装需要管理员账户。
最后,双击 Install Certificates.command 窗口中的 /Applications/Python 3.15/。
打开终端并检查版本:
你通过 python3(或 python3.15)启动新的 Python。macOS 也有自己的 /usr/bin/python3,属于 Apple,通常较旧:不要修改或删除它。
大多数 Linux 发行版都预装了 Python。你需要两个额外的部分,venv(虚拟环境)和 pip(包安装器)。在 Debian 和 Ubuntu 上:
终端 复制
$ sudo apt update $ sudo apt install python3-venv python3-pip
在 Fedora 上 sudo dnf install python3-pip python3-wheel;在 Arch 上 sudo pacman -S python-pip。然后检查版本:
Python 3.12 或更高版本允许 pip 安装这三个包的当前版本;产生这些页面输出的 Python 3.11 也适用。
创建一个虚拟环境
一个 虚拟环境 是一个包含自己 Python 包集合的文件夹,与你电脑上的其余部分隔离:当你在该环境中安装包时,它们会进入该文件夹,删除该文件夹会删除这些包。在你存放工作的文件夹中为此系列创建一个,并激活它:
终端 复制
PS> py -m venv calculus_env PS> calculus_env\Scripts\Activate.ps1
如果 PowerShell 拒绝运行 Activate.ps1,请先运行 Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser 一次,然后再次激活。 (在较旧的命令提示符中,第二个命令是 calculus_env\Scripts\activate。)
终端 复制
$ python3 -m venv calculus_env $ source calculus_env/bin/activate
终端 复制
$ python3 -m venv calculus_env $ source calculus_env/bin/activate
deactivate 会离开环境。每次你打开一个新的终端来处理这个系列的内容时,请前往相同的文件夹,并使用第二个命令重新激活环境。
安装 SymPy、NumPy 和 matplotlib
在激活的环境中,检查 pip,Python 的包安装工具,是否正常工作,然后安装这三个包:
终端 复制
PS> py -m pip --version PS> py -m pip install sympy numpy matplotlib
终端 复制
$ python3 -m pip --version $ python3 -m pip install sympy numpy matplotlib
终端 复制
$ python3 -m pip --version $ python3 -m pip install sympy numpy matplotlib
安装 SymPy 时也会安装 mpmath,这是 SymPy 用于处理大量数字的库。
要运行 Python 代码,请在激活的环境中启动 Python,使用 py 在 Windows 上或 python3 在 macOS 和 Linux 上,并在提示符 >>> 下输入这些行;或者将它们保存到一个文件中,例如 first.py,然后运行 py first.py 或 python3 first.py。该系列的所有代码都在 calculus-code.zip 中,每个模块一个脚本。
如果出了问题
macOS: python3 --version 显示的版本比您安装的旧。 这是苹果自己的 Python。使用 python3.15 替代 python3 来创建环境(python3.15 -m venv calculus_env);一旦环境激活,python3 才是正确的。不要动苹果的 Python。
Linux: python3 -m venv 失败。 在 Debian 和 Ubuntu 上,使用 sudo apt install python3-venv python3-pip 安装缺失的部分,然后重试。
ModuleNotFoundError: No module named 'sympy'. Python 无法找到这些包,通常是因为此终端中环境未激活。激活环境并重试;如果错误依旧,需在环境激活状态下重新安装这些包。
第一次会话
下面的四个框将用 Python 重新演示本模块;请将您看到的内容与显示的输出进行比较。
动手计算符号、替换、因式分解与展开
SymPy 可以处理 符号 ,即未知数的名称,您可以通过 symbols 创建它们。然后您可以构建表达式,使用 subs 将数值代入表达式,并通过 factor 和 expand 进行因式分解与展开:
Python 复制
import sympy as sp
x = sp.symbols ('x' ) # x is now a symbol, a name for a number
p = x**3 - x**2 - 6 *x # ** is a power; write * for every product
print (p.subs (x, 4 )) # substitute 4 for x: p(4)
print (sp.factor (p))
print (sp.expand ((x + 2 )*(x - 3 )))
输出
24
x*(x - 3)*(x + 2)
x**2 - x - 6
这个多项式是例1.4中的多项式。这三条线分别是它的值 p ( 4 ) = 64 − 16 − 24 = 24 , p(4) = 64 - 16 - 24 = 24\mathclose{\text{,}} p ( 4 ) = 64 − 16 − 24 = 24 , 它的因式分解形式,以及展开后的乘积 ( x + 2 ) ( x − 3 ) 。 (x + 2)(x - 3)\mathclose{\text{。}} ( x + 2 ) ( x − 3 ) 。 幂运算需要 **:在Python中,符号 ^ 表示其他含义。
错误
TypeError: unsupported operand type(s) for ^: 'Symbol' and 'int'
在整数之间,^ 将它们的二进制位组合起来,因此 2^3 是 1,不会报错。接下来,simplify 寻找表达式的更简单形式;尝试对例1.5中的有理函数应用它:
Python 复制
r = (x**2 - 4 )/(x**2 - x - 2 )
print (sp.simplify (r))
print (r.subs (x, 2 ))
SymPy 会取消因子 x − 2 x - 2 x − 2 而不提及 x ≠ 2 : x \ne 2\mathclose{\text{:}} x = 2 : 第1.4节的陷阱由你记住。将 2 代入 r r r 本身会得到 nan,即“非数字”,因为它等于 0 / 0 。 0/0\mathclose{\text{。}} 0/0 。
动手计算精确数字和十进制数
SymPy 保持数字精确,除非你要求使用十进制。将 4.9 写成分数 sp.Rational(49, 10),并让 SymPy 简化例1.12中的差商:
Python 复制
import sympy as sp
t, h = sp.symbols ('t h' )
s = sp.Rational (49 , 10 )*t**2 # 4.9 t^2, with 4.9 kept exact
q = (s.subs (t, 1 + h) - s.subs (t, 1 ))/h # the difference quotient at t = 1
print (q)
print (sp.simplify (q))
输出
(49*(h + 1)**2/10 - 49/10)/h
49*h/10 + 49/5
49 h 10 + 49 5 \tfrac{49h}{10} + \tfrac{49}{5} 10 49 h + 5 49 是 4.9 h + 9.8 , 4.9h + 9.8\mathclose{\text{,}} 4.9 h + 9.8 , 即例1.12的答案,按照 SymPy 的顺序排列项。sp.N 将精确数字转换为十进制数,除非你要求更多,否则保留15位有效数字:
Python 复制
print (sp.sqrt (8 ), sp.N (sp.sqrt (8 )))
print (sp.N (sp.E), sp.N (sp.pi, 30 ))
print (sp.N (3 *sp.log (10 )/sp.log (2 ), 4 )) # Example 1.7; log is ln
输出
2*sqrt(2) 2.82842712474619
2.71828182845905 3.14159265358979323846264338328
9.966
SymPy 保持 8 \sqrt8 8 精确,如 2 2 。 2\sqrt2\mathclose{\text{。}} 2 2 。 在 SymPy 中,如同在 Python 的 math 模块中,log 表示自然对数 ln ; \ln\mathclose{\text{;}} ln ; 写 sp.log(x, 10) 表示 log 10 x 。 \log_{10} x\mathclose{\text{。}} log 10 x 。
动手计算Python 自己的算术:弧度、四舍五入和定义域
Python 的 math 模块使用 浮点数 ,这是计算机对实数的快速近似,保留大约 16 位有效数字:
Python 复制
import math
print (math.sin (math.pi/6 )) # sin(pi/6) is exactly 1/2
print (math.sin (30 )) # 30 radians, not 30 degrees
print (math.sin (math.radians (30 ))) # convert 30 degrees to radians first
print (math.log (math.e**2 ), math.log10 (1000 ))
输出
0.49999999999999994
-0.9880316240928618
0.49999999999999994
2.0 3.0
三个要点。Python 的三角函数使用弧度;math.radians 将度数转换为弧度。浮点数结果可能在最后一位有误差,因此 sin ( π / 6 ) \sin(\pi/6) sin ( π /6 ) 会略低于 0.5(SymPy 的 sp.sin(sp.pi/6) 恰好等于 1/2);模块 2 展示了这种误差何时重要。并且 math.log 是 ln 。 \ln\mathclose{\text{。}} ln 。 还有两个惊喜:
Python 复制
print ((-8 )**(1 /3 ))
print (math.cbrt (-8 ))
输出
(1.0000000000000002+1.7320508075688772j)
-2.0
Python 对负数取分数次幂时给出复数,其中 j 标记虚部。这里用 ( − 8 ) 1 / 3 (-8)^{1/3} ( − 8 ) 1/3 表示的实立方根是 − 2 , -2\mathclose{\text{,}} − 2 , 在 Python 中可用 math.cbrt 求得。SymPy 也默认给出复根,可以显式要求实根:
Python 复制
import sympy as sp
print (sp.root (-8 , 3 ), sp.real_root (-8 , 3 ))
在 2*(-1)**(1/3) 中,因子 (-1)**(1/3) 表示一个复数,而不是 − 1 。 -1\mathclose{\text{。}} − 1 。 并且在函数的定义域之外,Python 拒绝:
Python 故意出错的例子
print (math.sqrt (-4 ))
错误
ValueError: math domain error
Python 3.11 将此称为 “math domain error”;其他版本可能会以不同的方式表述该信息。
动手计算数字和图像:lambdify、NumPy 和 matplotlib
sp.lambdify 将一个 SymPy 公式转换为一个快速的数值函数,该函数接受一个 NumPy 数组 ,即一个可以被算术运算同时作用的数字列表:
Python 复制
import sympy as sp
import numpy as np
t = sp.symbols ('t' )
s = sp.lambdify (t, 4.9 *t**2 ) # the formula as a numerical function
ts = np.linspace (0 , 3 , 7 ) # 7 equally spaced times from 0 to 3
print (ts)
print (s (ts)) # s at all seven times at once
输出
[0. 0.5 1. 1.5 2. 2.5 3. ]
[ 0. 1.225 4.9 11.025 19.6 30.625 44.1 ]
第二行是第 1.3 节的表格。现在第 1.6 节的平均速度:
Python 复制
for h in [0.1 , 0.01 , 0.001 ]:
print (h, (s (1 + h) - s (1 ))/h)
输出
0.1 10.290000000000008
0.01 9.848999999999997
0.001 9.804899999998895
精确值为 10.29、9.849 和 9.8049,因此计算机的答案在最后几位数字上是错误的。模块 2 解释了原因,以及为什么当 h h h 缩小得更多时误差会增大。最后,一张图表:
Python 复制
import matplotlib.pyplot as plt
ts = np.linspace (0 , 3 , 200 )
plt.plot (ts, s (ts))
plt.xlabel ('t (seconds)' )
plt.ylabel ('distance fallen (metres)' )
plt.show ()
一个窗口打开,显示 s s s 的图像:即图 1.5 中的曲线,但没有其割线。关闭窗口以完成。
微积分研究量变化的快慢(切线问题,导致导数)以及累积的总量(面积问题,导致积分);两者都通过极限来解答。
一个函数将其定义域中的每个输入对应到恰好一个输出;值域是所有输出的集合。区间如 [ 0 , 2 ] [0, 2] [ 0 , 2 ] 和 ( − ∞ , 2 ) ∪ ( 2 , ∞ ) (-\infty, 2) \cup (2, \infty) ( − ∞ , 2 ) ∪ ( 2 , ∞ ) 描述定义域和值域。
一个公式的定义域排除除以零、负数的偶次根以及非正数的对数;模型可能进一步限制定义域。
f f f 的图像是一组点 ( x , f ( x ) ) ; (x, f(x))\mathclose{\text{;}} ( x , f ( x )) ; 没有垂直直线与之相交两次。分段函数在定义域的不同部分使用不同的公式,边界处用实心点和空心点表示。
目录:线性函数(恒定变化率 m ), m\mathclose{\text{),}} m ), 幂函数和多项式,有理函数,根函数,指数函数 a x a^x a x 和 e x e^x e x 与 e ≈ 2.71828 , e \approx 2.71828\mathclose{\text{,}} e ≈ 2.71828 , 对数函数以 ln \ln ln 为底,是 e x e^x e x 的反函数,以及三角函数,由单位圆以弧度定义。
对于 c > 0 , c > 0\mathclose{\text{,}} c > 0 , f ( x − c ) f(x - c) f ( x − c ) 将图像向右平移 c c c 个单位,并且 f ( x ) + c f(x) + c f ( x ) + c 将其向上平移 c c c 个单位;对于 c > 1 , c > 1\mathclose{\text{,}} c > 1 , c f ( x ) c\,f(x) c f ( x ) 垂直拉伸它,f ( c x ) f(cx) f ( c x ) 水平压缩它。( f ∘ g ) ( x ) = f ( g ( x ) ) (f \circ g)(x) = f\big(g(x)\big) ( f ∘ g ) ( x ) = f ( g ( x ) ) 首先应用 g 。 g\mathclose{\text{。}} g 。 单射的函数有反函数,其图像在 y = x y = x y = x 中是镜像的。
平均变化率 ( f ( b ) − f ( a ) ) / ( b − a ) \big(f(b) - f(a)\big)/(b - a) ( f ( b ) − f ( a ) ) / ( b − a ) 是割线的斜率,而差商 ( f ( a + h ) − f ( a ) ) / h \big(f(a + h) - f(a)\big)/h ( f ( a + h ) − f ( a ) ) / h 是在长度为 h h h 的区间上的平均变化率。当 h h h 趋近于零时,它趋近于瞬时变化率:极限(模块 2)和导数(模块 4)的基本思想。
SymPy (symbols, subs, expand, factor, simplify, N, lambdify), NumPy 和 matplotlib 检查并探索所有这些内容;浮点运算在最后几位是近似的。
练习 1.1 ★ 区间表示法的定义域
找出每个函数的定义域,并用区间表示法写出。
(a) f ( x ) = 5 − 2 x f(x) = \sqrt{5 - 2x} f ( x ) = 5 − 2 x
(b) g ( x ) = 1 x 2 − 9 g(x) = \dfrac{1}{x^2 - 9} g ( x ) = x 2 − 9 1
(c) h ( x ) = ln ( x + 4 ) x h(x) = \dfrac{\ln(x + 4)}{x} h ( x ) = x ln ( x + 4 )
查看解答✓ 已检验
(a) 平方根需要 5 − 2 x ≥ 0 , 5 - 2x \ge 0\mathclose{\text{,}} 5 − 2 x ≥ 0 , 也就是说,2 x ≤ 5 , 2x \le 5\mathclose{\text{,}} 2 x ≤ 5 , 也就是说,x ≤ 5 2 。 x \le \tfrac52\mathclose{\text{。}} x ≤ 2 5 。 定义域是 ( − ∞ , 5 2 ] , \big(-\infty, \tfrac52\big]\mathclose{\text{,}} ( − ∞ , 2 5 ] , 包含 5 2 \tfrac52 2 5 是因为 0 = 0 。 \sqrt0 = 0\mathclose{\text{。}} 0 = 0 。
(b) 分母不能为零。当 x 2 = 9 x^2 = 9 x 2 = 9 时,x 2 − 9 = 0 , x^2 - 9 = 0\mathclose{\text{,}} x 2 − 9 = 0 , 即在 x = 3 x = 3 x = 3 或 x = − 3 x = -3 x = − 3 处。定义域为 ( − ∞ , − 3 ) ∪ ( − 3 , 3 ) ∪ ( 3 , ∞ ) 。 (-\infty, -3) \cup (-3, 3) \cup (3, \infty)\mathclose{\text{。}} ( − ∞ , − 3 ) ∪ ( − 3 , 3 ) ∪ ( 3 , ∞ ) 。 常见错误是漏掉 x = − 3 , x = -3\mathclose{\text{,}} x = − 3 , 因为 x 2 = 9 x^2 = 9 x 2 = 9 有两个解。
(c) 两个条件。对数需要 x + 4 > 0 , x + 4 > 0\mathclose{\text{,}} x + 4 > 0 , 即 x > − 4 ; x > -4\mathclose{\text{;}} x > − 4 ; 除法需要 x ≠ 0 。 x \ne 0\mathclose{\text{。}} x = 0 。 定义域是 ( − 4 , 0 ) ∪ ( 0 , ∞ ) 。 (-4, 0) \cup (0, \infty)\mathclose{\text{。}} ( − 4 , 0 ) ∪ ( 0 , ∞ ) 。 − 4 -4 − 4 被排除,因为 ln 0 \ln 0 ln 0 没有定义。
练习 1.2 ★ 阅读分段函数
设
f ( x ) = { 2 x + 1 if x ≤ 1 , x 2 − 1 if x > 1. f(x) = \begin{cases} 2x + 1 & \text{if } x \le 1, \\ x^2 - 1 & \text{if } x > 1. \end{cases} f ( x ) = { 2 x + 1 x 2 − 1 if x ≤ 1 , if x > 1.
(a) 求 f ( − 2 ) , f(-2)\mathclose{\text{,}} f ( − 2 ) , f ( 1 ) , f(1)\mathclose{\text{,}} f ( 1 ) , f ( 2 ) f(2) f ( 2 ) 和 f ( 3 ) 。 f(3)\mathclose{\text{。}} f ( 3 ) 。
(b) 解 f ( x ) = 3 。 f(x) = 3\mathclose{\text{。}} f ( x ) = 3 。
(c) 描述在 x = 1 x = 1 x = 1 附近的图像:哪里有实心点,哪里有空心点?
查看解答✓ 已检验
(a) 首先确定分段。− 2 ≤ 1 , -2 \le 1\mathclose{\text{,}} − 2 ≤ 1 , 因此 f ( − 2 ) = 2 ( − 2 ) + 1 = − 3 。 f(-2) = 2(-2) + 1 = -3\mathclose{\text{。}} f ( − 2 ) = 2 ( − 2 ) + 1 = − 3 。 1 ≤ 1 , 1 \le 1\mathclose{\text{,}} 1 ≤ 1 , 因此 f ( 1 ) = 2 + 1 = 3 。 f(1) = 2 + 1 = 3\mathclose{\text{。}} f ( 1 ) = 2 + 1 = 3 。 2 > 1 , 2 > 1\mathclose{\text{,}} 2 > 1 , 因此 f ( 2 ) = 4 − 1 = 3 。 f(2) = 4 - 1 = 3\mathclose{\text{。}} f ( 2 ) = 4 − 1 = 3 。 3 > 1 , 3 > 1\mathclose{\text{,}} 3 > 1 , 因此 f ( 3 ) = 9 − 1 = 8 。 f(3) = 9 - 1 = 8\mathclose{\text{。}} f ( 3 ) = 9 − 1 = 8 。
(b) 在每一个分段分别求解,再只保留属于该分段的解。第一段中,2 x + 1 = 3 2x + 1 = 3 2 x + 1 = 3 给出 x = 1 , x = 1\mathclose{\text{,}} x = 1 , 而且 1 ≤ 1 , 1 \le 1\mathclose{\text{,}} 1 ≤ 1 , 因此是有效解。第二段中,x 2 − 1 = 3 x^2 - 1 = 3 x 2 − 1 = 3 给出 x = 2 x = 2 x = 2 或 x = − 2 , x = -2\mathclose{\text{,}} x = − 2 , 但只有 x = 2 x = 2 x = 2 满足 x > 1 x > 1 x > 1 (事实上 f ( − 2 ) = − 3 )。 f(-2) = -3\mathclose{\text{)。}} f ( − 2 ) = − 3 )。 所以解为 x = 1 x = 1 x = 1 和 x = 2 。 x = 2\mathclose{\text{。}} x = 2 。
(c) 直线 y = 2 x + 1 y = 2x + 1 y = 2 x + 1 在 ( 1 , 3 ) (1, 3) ( 1 , 3 ) 处结束,该点在图上:实心点。在 x = 1 x = 1 x = 1 右侧,图沿着抛物线 y = x 2 − 1 y = x^2 - 1 y = x 2 − 1 进行,该抛物线朝向 ( 1 , 0 ) ; (1, 0)\mathclose{\text{;}} ( 1 , 0 ) ; 该点不在图上:空心点。图在 x = 1 x = 1 x = 1 处跳下。
练习 1.3 ★ 弧度和精确值
(a) 将 225 ∘ 225^\circ 22 5 ∘ 和 − 60 ∘ -60^\circ − 6 0 ∘ 转换为弧度,并将 5 π / 6 5\pi/6 5 π /6 转换为度数。
(b) 找出 sin θ \sin\theta sin θ 和 cos θ \cos\theta cos θ 在 θ = 3 π / 4 、 \theta = 3\pi/4\mathclose{\text{、}} θ = 3 π /4 、 7 π / 6 7\pi/6 7 π /6 和 − π / 3 -\pi/3 − π /3 的精确值。
查看解答✓ 已检验
(a) 将度数乘以 π / 180 : \pi/180\mathclose{\text{:}} π /180 :
225 ⋅ π 180 = 5 π 4 , − 60 ⋅ π 180 = − π 3 . \begin{aligned} 225 \cdot \frac{\pi}{180} &= \frac{5\pi}{4}, \\ -60 \cdot \frac{\pi}{180} &= -\frac{\pi}{3}. \end{aligned} 225 ⋅ 180 π − 60 ⋅ 180 π = 4 5 π , = − 3 π .
要转换回去,乘以 180 / π : 180/\pi\mathclose{\text{:}} 180/ π :
5 π 6 ⋅ 180 π = 150 ∘ . \frac{5\pi}{6} \cdot \frac{180}{\pi} = 150^\circ. 6 5 π ⋅ π 180 = 15 0 ∘ .
(b) 利用常用角的取值和圆的对称性。
3 π / 4 = π − π / 4 , 3\pi/4 = \pi - \pi/4\mathclose{\text{,}} 3 π /4 = π − π /4 , π / 4 \pi/4 π /4 关于 y y y 轴的镜像:sin 3 π 4 = sin π 4 = 2 2 , cos 3 π 4 = − cos π 4 = − 2 2 . \begin{aligned} \sin\frac{3\pi}{4} &= \sin\frac{\pi}{4} = \frac{\sqrt2}{2}, \\ \cos\frac{3\pi}{4} &= -\cos\frac{\pi}{4} = -\frac{\sqrt2}{2}. \end{aligned} sin 4 3 π cos 4 3 π = sin 4 π = 2 2 , = − cos 4 π = − 2 2 .
7 π / 6 = π + π / 6 , 7\pi/6 = \pi + \pi/6\mathclose{\text{,}} 7 π /6 = π + π /6 , π / 6 \pi/6 π /6 关于原点的反射:sin 7 π 6 = − sin π 6 = − 1 2 , cos 7 π 6 = − cos π 6 = − 3 2 . \begin{aligned} \sin\frac{7\pi}{6} &= -\sin\frac{\pi}{6} = -\frac12, \\ \cos\frac{7\pi}{6} &= -\cos\frac{\pi}{6} = -\frac{\sqrt3}{2}. \end{aligned} sin 6 7 π cos 6 7 π = − sin 6 π = − 2 1 , = − cos 6 π = − 2 3 .
− π / 3 -\pi/3 − π /3 是 π / 3 \pi/3 π /3 关于 x x x 轴的镜像:sin ( − π 3 ) = − sin π 3 = − 3 2 , cos ( − π 3 ) = cos π 3 = 1 2 . \begin{aligned} \sin\Big(-\frac{\pi}{3}\Big) &= -\sin\frac{\pi}{3} \\ &= -\frac{\sqrt3}{2}, \\ \cos\Big(-\frac{\pi}{3}\Big) &= \cos\frac{\pi}{3} = \frac12. \end{aligned} sin ( − 3 π ) cos ( − 3 π ) = − sin 3 π = − 2 3 , = cos 3 π = 2 1 .
练习 1.4 ★ 对数与指数
不使用计算器,求:
(a) log 3 81 \log_3 81 log 3 81
(b) log 10 0.001 \log_{10} 0.001 log 10 0.001
(c) ln ( e 5 ) \ln\big(e^5\big) ln ( e 5 )
(d) e ln 7 e^{\ln 7} e l n 7
(e) ln 12 − ln 3 + ln 2 , \ln 12 - \ln 3 + \ln 2\mathclose{\text{,}} ln 12 − ln 3 + ln 2 , 写成一个对数形式。
然后 (f) 解 e 2 x = 7 , e^{2x} = 7\mathclose{\text{,}} e 2 x = 7 , 给出精确答案及其三位小数近似值。
查看解答✓ 已检验
(a) 3 4 = 81 , 3^4 = 81\mathclose{\text{,}} 3 4 = 81 , 因此 log 3 81 = 4 。 \log_3 81 = 4\mathclose{\text{。}} log 3 81 = 4 。
(b) 0.001 = 10 − 3 , 0.001 = 10^{-3}\mathclose{\text{,}} 0.001 = 1 0 − 3 , 因此 log 10 0.001 = − 3 。 \log_{10} 0.001 = -3\mathclose{\text{。}} log 10 0.001 = − 3 。
(c) ln \ln ln 撤销 e x : e^x\mathclose{\text{:}} e x : ln ( e 5 ) = 5 。 \ln\big(e^5\big) = 5\mathclose{\text{。}} ln ( e 5 ) = 5 。
(d) e x e^x e x 撤销 ln , \ln\mathclose{\text{,}} ln , 对于正输入:e ln 7 = 7 。 e^{\ln 7} = 7\mathclose{\text{。}} e l n 7 = 7 。
(e) 由对数运算法则得 ln 12 − ln 3 = ln 12 3 = ln 4 , \ln 12 - \ln 3 = \ln\dfrac{12}{3} = \ln 4\mathclose{\text{,}} ln 12 − ln 3 = ln 3 12 = ln 4 , 且 ln 4 + ln 2 = ln 8 。 \ln 4 + \ln 2 = \ln 8\mathclose{\text{。}} ln 4 + ln 2 = ln 8 。 由于 8 = 2 3 , 8 = 2^3\mathclose{\text{,}} 8 = 2 3 , 结果也可以写为 3 ln 2 。 3\ln 2\mathclose{\text{。}} 3 ln 2 。
(f) 对两边取 ln : \ln\mathclose{\text{:}} ln : ln ( e 2 x ) = 2 x , \ln\big(e^{2x}\big) = 2x\mathclose{\text{,}} ln ( e 2 x ) = 2 x , 因此 2 x = ln 7 2x = \ln 7 2 x = ln 7 并且
x = ln 7 2 ≈ 0.973. x = \frac{\ln 7}{2} \approx 0.973. x = 2 ln 7 ≈ 0.973.
检查:e 2 ⋅ 0.973 = e 1.946 ≈ 7.00 。 e^{2 \cdot 0.973} = e^{1.946} \approx 7.00\mathclose{\text{。}} e 2 ⋅ 0.973 = e 1.946 ≈ 7.00 。
练习 1.5 ★★ 对平方根进行变换
从函数 y = x y = \sqrt x y = x 的图像开始。
(a) 将它向左平移 3 个单位,然后垂直拉伸 2 倍,再向下平移 1 个单位,写出变换后的图像公式。
(b) 找出新函数的定义域和值域。
(c) 它的图像在哪个点与 x x x 轴相交?
用第 1.5 节的函数探索器检查你的答案。
查看解答✓ 已检验
(a) 向左平移 3 个单位将 x x x 替换为 x + 3 : x + 3\mathclose{\text{:}} x + 3 : y = x + 3 。 y = \sqrt{x + 3}\mathclose{\text{。}} y = x + 3 。 垂直拉伸 2 倍将输出乘以 2:y = 2 x + 3 。 y = 2\sqrt{x + 3}\mathclose{\text{。}} y = 2 x + 3 。 向下平移 1 个单位则减去 1:
y = 2 x + 3 − 1. y = 2\sqrt{x + 3} - 1. y = 2 x + 3 − 1.
(b) 平方根需要 x + 3 ≥ 0 , x + 3 \ge 0\mathclose{\text{,}} x + 3 ≥ 0 , 因此定义域是 [ − 3 , ∞ ) 。 [-3, \infty)\mathclose{\text{。}} [ − 3 , ∞ ) 。 当 x x x 遍历 [ − 3 , ∞ ) [-3, \infty) [ − 3 , ∞ ) 时,x + 3 x + 3 x + 3 遍历 [ 0 , ∞ ) , [0, \infty)\mathclose{\text{,}} [ 0 , ∞ ) , 因此 x + 3 \sqrt{x + 3} x + 3 取 [ 0 , ∞ ) [0, \infty) [ 0 , ∞ ) 中的每一个值;乘以 2 保持 [ 0 , ∞ ) , [0, \infty)\mathclose{\text{,}} [ 0 , ∞ ) , 减去 1 得到 [ − 1 , ∞ ) 。 [-1, \infty)\mathclose{\text{。}} [ − 1 , ∞ ) 。 值域是 [ − 1 , ∞ ) : [-1, \infty)\mathclose{\text{:}} [ − 1 , ∞ ) : 图像的起始点 ( 0 , 0 ) (0, 0) ( 0 , 0 ) 移动到了 ( − 3 , − 1 ) 。 (-3, -1)\mathclose{\text{。}} ( − 3 , − 1 ) 。
(c) 解 2 x + 3 − 1 = 0 : 2\sqrt{x + 3} - 1 = 0\mathclose{\text{:}} 2 x + 3 − 1 = 0 : x + 3 = 1 2 , \sqrt{x + 3} = \tfrac12\mathclose{\text{,}} x + 3 = 2 1 , 因此 x + 3 = 1 4 x + 3 = \tfrac14 x + 3 = 4 1 (两边平方)和 x = − 11 4 = − 2.75 。 x = -\tfrac{11}{4} = -2.75\mathclose{\text{。}} x = − 4 11 = − 2.75 。 平方可能会引入假解,因此检查:2 0.25 − 1 = 2 ⋅ 0.5 − 1 = 0 。 2\sqrt{0.25} - 1 = 2 \cdot 0.5 - 1 = 0\mathclose{\text{。}} 2 0.25 − 1 = 2 ⋅ 0.5 − 1 = 0 。
在探索者中:f ( x ) = x , f(x) = \sqrt x\mathclose{\text{,}} f ( x ) = x , a = 2 , a = 2\mathclose{\text{,}} a = 2 , c = − 3 , c = -3\mathclose{\text{,}} c = − 3 , d = − 1 。 d = -1\mathclose{\text{。}} d = − 1 。
练习 1.6 ★★ 复合与定义域
设 f ( x ) = 1 x f(x) = \dfrac{1}{x} f ( x ) = x 1 和 g ( x ) = x 2 − 4 。 g(x) = x^2 - 4\mathclose{\text{。}} g ( x ) = x 2 − 4 。 找出每个复合函数及其定义域:
(a) f ∘ g f \circ g f ∘ g
(b) g ∘ f g \circ f g ∘ f
(c) f ∘ f f \circ f f ∘ f
查看解答✓ 已检验
(a) ( f ∘ g ) ( x ) = f ( x 2 − 4 ) = 1 x 2 − 4 。 (f \circ g)(x) = f(x^2 - 4) = \dfrac{1}{x^2 - 4}\mathclose{\text{。}} ( f ∘ g ) ( x ) = f ( x 2 − 4 ) = x 2 − 4 1 。 g g g 接受每一个 x , x\mathclose{\text{,}} x , 而 f f f 需要其输入 x 2 − 4 x^2 - 4 x 2 − 4 不为零,因此 x ≠ 2 x \ne 2 x = 2 和 x ≠ − 2 。 x \ne -2\mathclose{\text{。}} x = − 2 。 定义域是 ( − ∞ , − 2 ) ∪ ( − 2 , 2 ) ∪ ( 2 , ∞ ) 。 (-\infty, -2) \cup (-2, 2) \cup (2, \infty)\mathclose{\text{。}} ( − ∞ , − 2 ) ∪ ( − 2 , 2 ) ∪ ( 2 , ∞ ) 。
(b) ( g ∘ f ) ( x ) = g ( 1 x ) = 1 x 2 − 4 。 (g \circ f)(x) = g\Big(\dfrac1x\Big) = \dfrac{1}{x^2} - 4\mathclose{\text{。}} ( g ∘ f ) ( x ) = g ( x 1 ) = x 2 1 − 4 。 f f f 要求 x ≠ 0 , x \ne 0\mathclose{\text{,}} x = 0 , 而 g g g 可接受任何输入,因此定义域为 ( − ∞ , 0 ) ∪ ( 0 , ∞ ) 。 (-\infty, 0) \cup (0, \infty)\mathclose{\text{。}} ( − ∞ , 0 ) ∪ ( 0 , ∞ ) 。
(c) ( f ∘ f ) ( x ) = f ( 1 x ) = 1 1 / x = x , (f \circ f)(x) = f\Big(\dfrac1x\Big) = \dfrac{1}{1/x} = x\mathclose{\text{,}} ( f ∘ f ) ( x ) = f ( x 1 ) = 1/ x 1 = x , 但只在 x ≠ 0 x \ne 0 x = 0 时成立。f ( 0 ) f(0) f ( 0 ) 无定义,所以 f ( f ( 0 ) ) f\big(f(0)\big) f ( f ( 0 ) ) 也无定义。定义域是 ( − ∞ , 0 ) ∪ ( 0 , ∞ ) , (-\infty, 0) \cup (0, \infty)\mathclose{\text{,}} ( − ∞ , 0 ) ∪ ( 0 , ∞ ) , 而非 R 。 \R\mathclose{\text{。}} R 。 常见错误是从化简后的公式 x x x 直接读出 R ; \R\mathclose{\text{;}} R ; 实际上应由组成它的各个函数来确定定义域。(在定义域上,f f f 两次作用相互抵消,故 f f f 是自己的反函数。)
练习 1.7 ★★ 用对数表示反函数
设 f ( x ) = e x − 1 + 2 。 f(x) = e^{x - 1} + 2\mathclose{\text{。}} f ( x ) = e x − 1 + 2 。
(a) 求 f f f 的定义域和值域。
(b) 证明 f f f 是单射的,并求 f − 1 ( x ) 。 f^{-1}(x)\mathclose{\text{。}} f − 1 ( x ) 。
(c) 写出 f − 1 f^{-1} f − 1 的定义域和值域,并验证 f ( f − 1 ( x ) ) = x 。 f\big(f^{-1}(x)\big) = x\mathclose{\text{。}} f ( f − 1 ( x ) ) = x 。
查看解答✓ 已检验
(a) 对每个 x , x\mathclose{\text{,}} x , e x − 1 e^{x - 1} e x − 1 都有定义,因此定义域为 R 。 \R\mathclose{\text{。}} R 。 当 x x x 遍历 R \R R 时,x − 1 x - 1 x − 1 也遍历同一集合,e x − 1 e^{x-1} e x − 1 恰好取遍所有正数(每个 v > 0 v > 0 v > 0 都可在 u = ln v u = \ln v u = ln v 时写为 e u )。 e^u\mathclose{\text{)。}} e u )。 于是 e x − 1 + 2 e^{x - 1} + 2 e x − 1 + 2 取遍所有大于 2 的值,故值域为 ( 2 , ∞ ) 。 (2, \infty)\mathclose{\text{。}} ( 2 , ∞ ) 。
(b) 写出 y = e x − 1 + 2 y = e^{x - 1} + 2 y = e x − 1 + 2 并解出 x 。 x\mathclose{\text{。}} x 。 减去 2:y − 2 = e x − 1 。 y - 2 = e^{x - 1}\mathclose{\text{。}} y − 2 = e x − 1 。 对于 y y y 在范围内的值,y − 2 > 0 , y - 2 > 0\mathclose{\text{,}} y − 2 > 0 , 因此你可以对两边取 ln : \ln\mathclose{\text{:}} ln : ln ( y − 2 ) = x − 1 , \ln(y - 2) = x - 1\mathclose{\text{,}} ln ( y − 2 ) = x − 1 , 并且
x = 1 + ln ( y − 2 ) . x = 1 + \ln(y - 2). x = 1 + ln ( y − 2 ) .
每个 y y y 在范围内的值都恰好来自这一个 x , x\mathclose{\text{,}} x , 因此 f f f 是单射的。将 y y y 重命名为 x : x\mathclose{\text{:}} x : f − 1 ( x ) = 1 + ln ( x − 2 ) 。 f^{-1}(x) = 1 + \ln(x - 2)\mathclose{\text{。}} f − 1 ( x ) = 1 + ln ( x − 2 ) 。
(c) f − 1 f^{-1} f − 1 的定义域是 f f f 的值域,( 2 , ∞ ) ; (2, \infty)\mathclose{\text{;}} ( 2 , ∞ ) ; 这正是 ln ( x − 2 ) \ln(x - 2) ln ( x − 2 ) 被定义的地方。f − 1 f^{-1} f − 1 的值域是 f f f 的定义域,R 。 \R\mathclose{\text{。}} R 。 检查对于 x > 2 : x > 2\mathclose{\text{:}} x > 2 :
f ( f − 1 ( x ) ) = e ( 1 + ln ( x − 2 ) ) − 1 + 2 = e ln ( x − 2 ) + 2 = ( x − 2 ) + 2 = x . \begin{aligned} f\big(f^{-1}(x)\big) &= e^{(1 + \ln(x - 2)) - 1} + 2 \\ &= e^{\ln(x - 2)} + 2 \\ &= (x - 2) + 2 = x. \end{aligned} f ( f − 1 ( x ) ) = e ( 1 + l n ( x − 2 )) − 1 + 2 = e l n ( x − 2 ) + 2 = ( x − 2 ) + 2 = x .
练习 1.8 ★★ 立方体的平均变化率
设 f ( x ) = x 3 。 f(x) = x^3\mathclose{\text{。}} f ( x ) = x 3 。
(a) 求 f f f 在 [ 1 , 2 ] [1, 2] [ 1 , 2 ] 上的平均变化率,在 [ 1 , 1.1 ] [1, 1.1] [ 1 , 1.1 ] 上的平均变化率,在 [ 1 , 1.01 ] [1, 1.01] [ 1 , 1.01 ] 上的平均变化率。
(b) 简化差商 f ( 1 + h ) − f ( 1 ) h , \dfrac{f(1 + h) - f(1)}{h}\mathclose{\text{,}} h f ( 1 + h ) − f ( 1 ) , 对于 h ≠ 0 。 h \ne 0\mathclose{\text{。}} h = 0 。
(c) 当 h h h 趋近于零时,平均变化率趋近于什么数?
查看解答✓ 已检验
(a) 使用 f ( b ) − f ( a ) b − a : \dfrac{f(b) - f(a)}{b - a}\mathclose{\text{:}} b − a f ( b ) − f ( a ) :
8 − 1 2 − 1 = 7 , 1.331 − 1 0.1 = 3.31 , 1.030301 − 1 0.01 = 3.0301. \begin{aligned} \frac{8 - 1}{2 - 1} &= 7, \\ \frac{1.331 - 1}{0.1} &= 3.31, \\ \frac{1.030301 - 1}{0.01} &= 3.0301. \end{aligned} 2 − 1 8 − 1 0.1 1.331 − 1 0.01 1.030301 − 1 = 7 , = 3.31 , = 3.0301.
(b) 展开 ( 1 + h ) 3 : (1 + h)^3\mathclose{\text{:}} ( 1 + h ) 3 : 首先 ( 1 + h ) 2 = 1 + 2 h + h 2 , (1 + h)^2 = 1 + 2h + h^2\mathclose{\text{,}} ( 1 + h ) 2 = 1 + 2 h + h 2 , 然后乘以 1 + h 1 + h 1 + h 并合并同类项,得到 ( 1 + h ) 3 = 1 + 3 h + 3 h 2 + h 3 。 (1 + h)^3 = 1 + 3h + 3h^2 + h^3\mathclose{\text{。}} ( 1 + h ) 3 = 1 + 3 h + 3 h 2 + h 3 。 因此
f ( 1 + h ) − f ( 1 ) h = 3 h + 3 h 2 + h 3 h = 3 + 3 h + h 2 ( h ≠ 0 ) . \begin{aligned} \frac{f(1 + h) - f(1)}{h} &= \frac{3h + 3h^2 + h^3}{h} \\ &= 3 + 3h + h^2 \qquad (h \ne 0). \end{aligned} h f ( 1 + h ) − f ( 1 ) = h 3 h + 3 h 2 + h 3 = 3 + 3 h + h 2 ( h = 0 ) .
这与 (a) 一致:h = 1 , h = 1\mathclose{\text{,}} h = 1 , 0.1 和 0.01 分别得到 7,3.31 和 3.0301。
(c) 当 h h h 趋近于零时,3 h 3h 3 h 和 h 2 h^2 h 2 都趋近于零,因此平均变化率趋近于 3。这是曲线 y = x 3 y = x^3 y = x 3 在点 ( 1 , 1 ) (1, 1) ( 1 , 1 ) 处的瞬时变化率,即该点的斜率。
练习 1.9 ★★ 1/x 的差商
设 f ( x ) = 1 x , f(x) = \dfrac1x\mathclose{\text{,}} f ( x ) = x 1 , 并且设 a ≠ 0 。 a \ne 0\mathclose{\text{。}} a = 0 。
(a) 证明,对于 h ≠ 0 h \ne 0 h = 0 与 a + h ≠ 0 , a + h \ne 0\mathclose{\text{,}} a + h = 0 , f ( a + h ) − f ( a ) h = − 1 a ( a + h ) . \frac{f(a + h) - f(a)}{h} = -\frac{1}{a(a + h)}. h f ( a + h ) − f ( a ) = − a ( a + h ) 1 .
(b) 评估它在 a = 2 a = 2 a = 2 为 h = 0.1 h = 0.1 h = 0.1 和 h = − 0.1 h = -0.1 h = − 0.1 时的值,保留四位小数。
(c) 当 h h h 趋近于零时,它趋于什么?为什么是负数?
查看解答✓ 已检验
(a) 将两个分数通分到公分母 a ( a + h ) : a(a + h)\mathclose{\text{:}} a ( a + h ) :
f ( a + h ) − f ( a ) = 1 a + h − 1 a = a − ( a + h ) a ( a + h ) = − h a ( a + h ) . \begin{aligned} f(a + h) - f(a) &= \frac{1}{a + h} - \frac1a \\ &= \frac{a - (a + h)}{a(a + h)} \\ &= \frac{-h}{a(a + h)}. \end{aligned} f ( a + h ) − f ( a ) = a + h 1 − a 1 = a ( a + h ) a − ( a + h ) = a ( a + h ) − h .
除以 h h h (允许这样做,因为 h ≠ 0 ) h \ne 0\mathclose{\text{)}} h = 0 ) 得到 − 1 a ( a + h ) 。 -\dfrac{1}{a(a + h)}\mathclose{\text{。}} − a ( a + h ) 1 。
(b) 对于 a = 2 a = 2 a = 2 和 h = 0.1 , h = 0.1\mathclose{\text{,}} h = 0.1 ,
− 1 2 ⋅ 2.1 = − 1 4.2 ≈ − 0.2381 , -\frac{1}{2 \cdot 2.1} = -\frac{1}{4.2} \approx -0.2381, − 2 ⋅ 2.1 1 = − 4.2 1 ≈ − 0.2381 ,
并且对于 h = − 0.1 , h = -0.1\mathclose{\text{,}} h = − 0.1 ,
− 1 2 ⋅ 1.9 = − 1 3.8 ≈ − 0.2632. -\frac{1}{2 \cdot 1.9} = -\frac{1}{3.8} \approx -0.2632. − 2 ⋅ 1.9 1 = − 3.8 1 ≈ − 0.2632.
(c) 当 h h h 变小时,a + h a + h a + h 趋近 a , a\mathclose{\text{,}} a , 所以差商趋近 − 1 a 2 ; -\dfrac{1}{a^2}\mathclose{\text{;}} − a 2 1 ; 对于 a = 2 , a = 2\mathclose{\text{,}} a = 2 , 这个值为 − 1 4 = − 0.25 , -\tfrac14 = -0.25\mathclose{\text{,}} − 4 1 = − 0.25 , 在 (b) 的两个值之间。只要 a a a 与 a + h a + h a + h 在零的同一侧,差商就为负。一旦 ∣ h ∣ < ∣ a ∣ , \abs{h} < \abs{a}\mathclose{\text{,}} ∣ h ∣ < ∣ a ∣ , 两者就在同一侧,此时 a ( a + h ) > 0 。 a(a + h) > 0\mathclose{\text{。}} a ( a + h ) > 0 。 这是因为 1 / x 1/x 1/ x 在零的两侧各自递减,输入增大时输出减小,故 Δ y \Delta y Δ y 与 Δ x \Delta x Δ x 异号。如果跨越零点,则不成立。例如,对于 a = 2 a = 2 a = 2 和 h = − 3 , h = -3\mathclose{\text{,}} h = − 3 , 差商为 − 1 2 ⋅ ( − 1 ) = 1 2 。 -\dfrac{1}{2 \cdot (-1)} = \tfrac12\mathclose{\text{。}} − 2 ⋅ ( − 1 ) 1 = 2 1 。
练习 1.10 ★★★ 递增函数是单射的
如果对函数 f f f 定义域中任意的 x 1 x_1 x 1 和 x 2 , x_2\mathclose{\text{,}} x 2 , 由 x 1 < x 2 x_1 < x_2 x 1 < x 2 都能推出 f ( x 1 ) < f ( x 2 ) , f(x_1) < f(x_2)\mathclose{\text{,}} f ( x 1 ) < f ( x 2 ) , 则称该函数严格递增 。
(a) 证明严格递增函数是单射的。
(b) 证明其反函数也是严格递增的。
(c) 显示 f ( x ) = x 3 + x f(x) = x^3 + x f ( x ) = x 3 + x 在 R \R R 上是严格递增的,因此存在反函数。(提示:x 2 3 − x 1 3 = ( x 2 − x 1 ) ( x 2 2 + x 1 x 2 + x 1 2 ) 。) x_2^3 - x_1^3 = (x_2 - x_1)\big(x_2^2 + x_1 x_2 + x_1^2\big)\mathclose{\text{。)}} x 2 3 − x 1 3 = ( x 2 − x 1 ) ( x 2 2 + x 1 x 2 + x 1 2 ) 。)
查看解答✓ 已检验
(a) 取定义域中的 x 1 ≠ x 2 , x_1 \ne x_2\mathclose{\text{,}} x 1 = x 2 , 编号使得 x 1 < x 2 。 x_1 < x_2\mathclose{\text{。}} x 1 < x 2 。 因为 f f f 严格递增,故 f ( x 1 ) < f ( x 2 ) , f(x_1) < f(x_2)\mathclose{\text{,}} f ( x 1 ) < f ( x 2 ) , 特别地,f ( x 1 ) ≠ f ( x 2 ) 。 f(x_1) \ne f(x_2)\mathclose{\text{。}} f ( x 1 ) = f ( x 2 ) 。 不同的输入给出不同的输出,因此 f f f 是单射的。
(b) 根据 (a),f f f 有反函数。取 f f f 的值域中的 y 1 < y 2 , y_1 < y_2\mathclose{\text{,}} y 1 < y 2 , 令 x 1 = f − 1 ( y 1 ) 、 x_1 = f^{-1}(y_1)\mathclose{\text{、}} x 1 = f − 1 ( y 1 ) 、 x 2 = f − 1 ( y 2 ) , x_2 = f^{-1}(y_2)\mathclose{\text{,}} x 2 = f − 1 ( y 2 ) , 于是 f ( x 1 ) = y 1 、 f(x_1) = y_1\mathclose{\text{、}} f ( x 1 ) = y 1 、 f ( x 2 ) = y 2 。 f(x_2) = y_2\mathclose{\text{。}} f ( x 2 ) = y 2 。 若 x 1 = x 2 , x_1 = x_2\mathclose{\text{,}} x 1 = x 2 , 则 y 1 = y 2 ; y_1 = y_2\mathclose{\text{;}} y 1 = y 2 ; 若 x 2 < x 1 , x_2 < x_1\mathclose{\text{,}} x 2 < x 1 , 则 f ( x 2 ) < f ( x 1 ) , f(x_2) < f(x_1)\mathclose{\text{,}} f ( x 2 ) < f ( x 1 ) , 即 y 2 < y 1 。 y_2 < y_1\mathclose{\text{。}} y 2 < y 1 。 两种情形都与 y 1 < y 2 y_1 < y_2 y 1 < y 2 矛盾,因此 x 1 < x 2 , x_1 < x_2\mathclose{\text{,}} x 1 < x 2 , 即 f − 1 f^{-1} f − 1 严格递增。
(c) 令 x 1 < x 2 。 x_1 < x_2\mathclose{\text{。}} x 1 < x 2 。 由提示可得
f ( x 2 ) − f ( x 1 ) = ( x 2 3 − x 1 3 ) + ( x 2 − x 1 ) = ( x 2 − x 1 ) ( x 2 2 + x 1 x 2 + x 1 2 + 1 ) . \begin{aligned} &f(x_2) - f(x_1) \\ &\quad= \big(x_2^3 - x_1^3\big) + (x_2 - x_1) \\ &\quad= (x_2 - x_1)\big(x_2^2 + x_1 x_2 + x_1^2 + 1\big). \end{aligned} f ( x 2 ) − f ( x 1 ) = ( x 2 3 − x 1 3 ) + ( x 2 − x 1 ) = ( x 2 − x 1 ) ( x 2 2 + x 1 x 2 + x 1 2 + 1 ) .
第一个因子是正的。对于第二个因子,完成平方:
x 2 2 + x 1 x 2 + x 1 2 = ( x 2 + x 1 2 ) 2 + 3 4 x 1 2 ≥ 0 , x_2^2 + x_1 x_2 + x_1^2 = \Big(x_2 + \frac{x_1}{2}\Big)^2 + \frac34 x_1^2 \ge 0, x 2 2 + x 1 x 2 + x 1 2 = ( x 2 + 2 x 1 ) 2 + 4 3 x 1 2 ≥ 0 ,
所以第二个因子至少为 1。两个正数的乘积是正数,因此 f ( x 1 ) < f ( x 2 ) : f(x_1) < f(x_2)\mathclose{\text{:}} f ( x 1 ) < f ( x 2 ) : f f f 是严格递增的。根据 (a),它有一个反函数,而根据 (b),这个反函数也是严格递增的。对于 f − 1 f^{-1} f − 1 的一个公式意味着解三次方程 x 3 + x = y , x^3 + x = y\mathclose{\text{,}} x 3 + x = y , 但反函数仍然存在,定理 1.2 给出了它的图像。
练习 1.11 ★★★ 二次函数的对称区间
设 f ( x ) = p x 2 + q x + r , f(x) = px^2 + qx + r\mathclose{\text{,}} f ( x ) = p x 2 + q x + r , 其中 p 、 p\mathclose{\text{、}} p 、 q q q 和 r r r 是常数。
(a) 证明 f f f 在 [ a − h , a + h ] [a - h, a + h] [ a − h , a + h ] 上,对于 h > 0 , h > 0\mathclose{\text{,}} h > 0 , 平均变化率是 2 p a + q , 2pa + q\mathclose{\text{,}} 2 p a + q , 无论 h h h 的值如何。
(b) (a) 说明了图像上点 a − h a - h a − h 和 a + h a + h a + h 处的割线,以及 f f f 在 a a a 处的瞬时变化率有什么说法?
(c) 对于下落的球,s ( t ) = 4.9 t 2 , s(t) = 4.9t^2\mathclose{\text{,}} s ( t ) = 4.9 t 2 , 在 [ 0.5 , 1.5 ] [0.5, 1.5] [ 0.5 , 1.5 ] 和 [ 0.9 , 1.1 ] [0.9, 1.1] [ 0.9 , 1.1 ] 上求平均速度,不计算 s s s 的任何值。并与第 1.6 节进行比较。
查看解答✓ 已检验
(a) 区间长度为 Δ x = ( a + h ) − ( a − h ) = 2 h 。 \Delta x = (a + h) - (a - h) = 2h\mathclose{\text{。}} Δ x = ( a + h ) − ( a − h ) = 2 h 。 对于 f f f 的变化,将项分组如下:
f ( a + h ) − f ( a − h ) = p [ ( a + h ) 2 − ( a − h ) 2 ] + q [ ( a + h ) − ( a − h ) ] + ( r − r ) . \begin{aligned} &f(a + h) - f(a - h) \\ &\quad= p\big[(a + h)^2 - (a - h)^2\big] \\ &\qquad + q\big[(a + h) - (a - h)\big] + (r - r). \end{aligned} f ( a + h ) − f ( a − h ) = p [ ( a + h ) 2 − ( a − h ) 2 ] + q [ ( a + h ) − ( a − h ) ] + ( r − r ) .
展开 ( a + h ) 2 − ( a − h ) 2 = ( a 2 + 2 a h + h 2 ) − ( a 2 − 2 a h + h 2 ) = 4 a h , (a + h)^2 - (a - h)^2 = (a^2 + 2ah + h^2) - (a^2 - 2ah + h^2) = 4ah\mathclose{\text{,}} ( a + h ) 2 − ( a − h ) 2 = ( a 2 + 2 ah + h 2 ) − ( a 2 − 2 ah + h 2 ) = 4 ah , 并 ( a + h ) − ( a − h ) = 2 h 。 (a + h) - (a - h) = 2h\mathclose{\text{。}} ( a + h ) − ( a − h ) = 2 h 。 因此 f ( a + h ) − f ( a − h ) = 4 p a h + 2 q h , f(a + h) - f(a - h) = 4pah + 2qh\mathclose{\text{,}} f ( a + h ) − f ( a − h ) = 4 p ah + 2 q h , 并且
f ( a + h ) − f ( a − h ) 2 h = 4 p a h + 2 q h 2 h = 2 p a + q . \begin{aligned} \frac{f(a + h) - f(a - h)}{2h} &= \frac{4pah + 2qh}{2h} \\ &= 2pa + q. \end{aligned} 2 h f ( a + h ) − f ( a − h ) = 2 h 4 p ah + 2 q h = 2 p a + q .
h h h 完全抵消:对于每个 h > 0 , h > 0\mathclose{\text{,}} h > 0 , 答案相同。
(b) 所有这些割线都有相同的斜率 2 p a + q , 2pa + q\mathclose{\text{,}} 2 p a + q , 因此它们是平行的,无论区间多宽。当 h h h 缩小时,平均变化率保持为 2 p a + q , 2pa + q\mathclose{\text{,}} 2 p a + q , 因此它趋近于这个数值:f f f 在 a a a 处的瞬时变化率为 2 p a + q 。 2pa + q\mathclose{\text{。}} 2 p a + q 。 第 1.6 节中的差商也一致:f ( a + h ) − f ( a ) = p ( 2 a h + h 2 ) + q h , f(a + h) - f(a) = p(2ah + h^2) + qh\mathclose{\text{,}} f ( a + h ) − f ( a ) = p ( 2 ah + h 2 ) + q h , 因此差商为 2 p a + q + p h , 2pa + q + ph\mathclose{\text{,}} 2 p a + q + p h , 当 h h h 缩小时也趋近于 2 p a + q 。 2pa + q\mathclose{\text{。}} 2 p a + q 。
(c) 这里有 p = 4.9 p = 4.9 p = 4.9 与 q = r = 0 。 q = r = 0\mathclose{\text{。}} q = r = 0 。 在 h = 0.5 h = 0.5 h = 0.5 和 h = 0.1 h = 0.1 h = 0.1 的取值下,两个区间都以 a = 1 a = 1 a = 1 为中心,因此各自的平均速度都是 2 ⋅ 4.9 ⋅ 1 = 9.8 2 \cdot 4.9 \cdot 1 = 9.8 2 ⋅ 4.9 ⋅ 1 = 9.8 m/s,恰好等于第 1.6 节求出的瞬时速度。第 1.6 节中,从 t = 1 t = 1 t = 1 开始或结束的区间所给的平均速度只能趋近 9.8。模块 4 将中心区间用于其他函数,得到中心差分,结果通常很准确,但一般并非精确值。
1 f ( x ) = x − 3 x − 5 f(x) = \dfrac{\sqrt{x - 3}}{x - 5} f ( x ) = x − 5 x − 3 的定义域是
( 3 , 5 ) ∪ ( 5 , ∞ ) (3, 5) \cup (5, \infty) ( 3 , 5 ) ∪ ( 5 , ∞ ) [ 3 , ∞ ) [3, \infty) [ 3 , ∞ ) [ 3 , 5 ) ∪ ( 5 , ∞ ) [3, 5) \cup (5, \infty) [ 3 , 5 ) ∪ ( 5 , ∞ ) ( − ∞ , 5 ) ∪ ( 5 , ∞ ) (-\infty, 5) \cup (5, \infty) ( − ∞ , 5 ) ∪ ( 5 , ∞ ) 平方根需要
x ≥ 3 x \ge 3 x ≥ 3 (3 本身也是允许的,因为
0 = 0 ), \sqrt0 = 0\mathclose{\text{),}} 0 = 0 ), 分母需要
x ≠ 5 。 x \ne 5\mathclose{\text{。}} x = 5 。 [ 3 , ∞ ) [3, \infty) [ 3 , ∞ ) 忘记了
x = 5 x = 5 x = 5 会使分母为 0;
( 3 , 5 ) ∪ ( 5 , ∞ ) (3, 5) \cup (5, \infty) ( 3 , 5 ) ∪ ( 5 , ∞ ) 错误地遗漏了 3。
2 如果
f ( x ) = x 2 f(x) = x^2 f ( x ) = x 2 和
g ( x ) = x + 1 , g(x) = x + 1\mathclose{\text{,}} g ( x ) = x + 1 , 那么
( f ∘ g ) ( x ) (f \circ g)(x) ( f ∘ g ) ( x ) 是
x 2 + 1 x^2 + 1 x 2 + 1 ( x + 1 ) 2 (x + 1)^2 ( x + 1 ) 2 x 2 + x x^2 + x x 2 + x 2 x + 1 2x + 1 2 x + 1 f ∘ g f \circ g f ∘ g 首先应用
g : g\mathclose{\text{:}} g : f ( g ( x ) ) = f ( x + 1 ) = ( x + 1 ) 2 。 f\big(g(x)\big) = f(x + 1) = (x + 1)^2\mathclose{\text{。}} f ( g ( x ) ) = f ( x + 1 ) = ( x + 1 ) 2 。 答案
x 2 + 1 x^2 + 1 x 2 + 1 是
( g ∘ f ) ( x ) , (g \circ f)(x)\mathclose{\text{,}} ( g ∘ f ) ( x ) , 另一种顺序。
3 y = f ( x + 2 ) − 1 y = f(x + 2) - 1 y = f ( x + 2 ) − 1 的图像为
y = f ( x ) y = f(x) y = f ( x ) 的图像平移
向右平移 2 个单位,向下平移 1 个单位 向左平移 2 个单位,向上平移 1 个单位 向右平移 2 个单位,向上平移 1 个单位 2个单位向左和1个单位向下 在
f f f 内部,
x + 2 x + 2 x + 2 将图像向左移动2个单位:值
f ( 0 ) f(0) f ( 0 ) 现在在
x = − 2 x = -2 x = − 2 处达到。在外部减去1
f , f\mathclose{\text{,}} f , 使其向下移动1个单位。
4 cos 2 π 3 \cos\dfrac{2\pi}{3} cos 3 2 π 等于
− 1 2 -\dfrac12 − 2 1 1 2 \dfrac12 2 1 3 2 \dfrac{\sqrt3}{2} 2 3 − 3 2 -\dfrac{\sqrt3}{2} − 2 3 2 π 3 = π − π 3 , \dfrac{2\pi}{3} = \pi - \dfrac{\pi}{3}\mathclose{\text{,}} 3 2 π = π − 3 π , 且角度为
π − θ \pi - \theta π − θ 的点是
y y y 轴上
θ \theta θ 点的镜像,因此
cos 2 π 3 = − cos π 3 = − 1 2 。 \cos\dfrac{2\pi}{3} = -\cos\dfrac{\pi}{3} = -\dfrac12\mathclose{\text{。}} cos 3 2 π = − cos 3 π = − 2 1 。 角度为
120 ∘ , 120^\circ\mathclose{\text{,}} 12 0 ∘ , 位于
y y y 轴左侧,其中
x x x 坐标为负。
5 对于
x > 0 , x > 0\mathclose{\text{,}} x > 0 , ln ( x 3 ) − ln x \ln\big(x^3\big) - \ln x ln ( x 3 ) − ln x 等于
ln ( x 3 − x ) \ln\big(x^3 - x\big) ln ( x 3 − x ) 3 3 3 2 ln x 2\ln x 2 ln x ( ln x ) 2 (\ln x)^2 ( ln x ) 2 ln ( x 3 ) − ln x = ln x 3 x = ln ( x 2 ) = 2 ln x , \ln\big(x^3\big) - \ln x = \ln\dfrac{x^3}{x} = \ln\big(x^2\big) = 2\ln x\mathclose{\text{,}} ln ( x 3 ) − ln x = ln x x 3 = ln ( x 2 ) = 2 ln x , 根据对数的第二和第三法则。
ln ( x 3 − x ) \ln\big(x^3 - x\big) ln ( x 3 − x ) 是一个不同的数:这些法则涉及乘积、商和幂,而不是差。
6 如果
f ( x ) = 3 x − 6 , f(x) = 3x - 6\mathclose{\text{,}} f ( x ) = 3 x − 6 , 那么
f − 1 ( x ) f^{-1}(x) f − 1 ( x ) 等于
1 3 x − 6 \dfrac{1}{3x - 6} 3 x − 6 1 x 3 + 2 \dfrac{x}{3} + 2 3 x + 2 3 x + 6 3x + 6 3 x + 6 x 3 − 2 \dfrac{x}{3} - 2 3 x − 2 解
y = 3 x − 6 y = 3x - 6 y = 3 x − 6 求
x : x\mathclose{\text{:}} x : x = y + 6 3 = y 3 + 2 , x = \dfrac{y + 6}{3} = \dfrac{y}{3} + 2\mathclose{\text{,}} x = 3 y + 6 = 3 y + 2 , 然后将
y y y 重命名为
x 。 x\mathclose{\text{。}} x 。 1 3 x − 6 \dfrac{1}{3x - 6} 3 x − 6 1 是
1 f ( x ) , \dfrac{1}{f(x)}\mathclose{\text{,}} f ( x ) 1 , 不是反函数。检查:
f ( 4 ) = 6 , f(4) = 6\mathclose{\text{,}} f ( 4 ) = 6 , 且
6 3 + 2 = 4 。 \dfrac63 + 2 = 4\mathclose{\text{。}} 3 6 + 2 = 4 。
7 f ( x ) = x 2 f(x) = x^2 f ( x ) = x 2 在
[ 2 , 5 ] [2, 5] [ 2 , 5 ] 上的平均变化率是
7 7 7 21 21 21 3 3 3 14.5 14.5 14.5 f ( 5 ) − f ( 2 ) 5 − 2 = 25 − 4 3 = 21 3 = 7 . \dfrac{f(5) - f(2)}{5 - 2} = \dfrac{25 - 4}{3} = \dfrac{21}{3} = 7\mathclose{\text{.}} 5 − 2 f ( 5 ) − f ( 2 ) = 3 25 − 4 = 3 21 = 7 . 21 是
f f f 单独的变化量,不是除以
x x x 的变化量,3 是
x x x 单独的变化量;14.5 是
f ( 2 ) f(2) f ( 2 ) 和
f ( 5 ) f(5) f ( 5 ) 的平均值,是不同的概念。
8 对于
f ( x ) = x 2 f(x) = x^2 f ( x ) = x 2 和
h ≠ 0 , h \ne 0\mathclose{\text{,}} h = 0 , 差商
f ( 3 + h ) − f ( 3 ) h \dfrac{f(3 + h) - f(3)}{h} h f ( 3 + h ) − f ( 3 ) 可以简化为
h h h 6 6 6 9 + h 9 + h 9 + h 6 + h 6 + h 6 + h ( 3 + h ) 2 − 9 = 9 + 6 h + h 2 − 9 = 6 h + h 2 , (3 + h)^2 - 9 = 9 + 6h + h^2 - 9 = 6h + h^2\mathclose{\text{,}} ( 3 + h ) 2 − 9 = 9 + 6 h + h 2 − 9 = 6 h + h 2 , 除以
h h h 得到
6 + h 。 6 + h\mathclose{\text{。}} 6 + h 。 当
h h h 趋近于零时,它趋近于 6,但对于允许的
h h h 永远不等于 6。答案
h h h 来源于将
f ( 3 + h ) f(3 + h) f ( 3 + h ) 写成
9 + h 2 9 + h^2 9 + h 2 并丢弃中间项
6 h 。 6h\mathclose{\text{。}} 6 h 。
重新作答