# 链式法则

链式法则是微积分中给出复合函数导数的定理：如果一个量是第二个量的函数，而第二个量本身又是第三个量的函数，那么外层量的变化率等于沿链条各段变化率的乘积。在单变量形式下，若 \( f \) 在 \( c \) 处可微，\( g \) 在 \( f(c) \) 处可微，则复合函数 \( g \circ f \) 在 \( c \) 处可微，且

\[ (g \circ f)'(c) = g'(f(c)) \cdot f'(c). \]

用莱布尼茨记法，对于 \( y = g(u) \) 及 \( u = f(x) \)，此式写作 \( \dfrac{dy}{dx} = \dfrac{dy}{du} \cdot \dfrac{du}{dx} \)，这也是该法则最常被讲授和应用的形式。<sup>[1](https://www.math.ucdavis.edu/~hunter/m125a/intro_analysis_ch4.pdf)</sup>

| 关键事实 | 详情 |
|---|---|
| 陈述 | 若 \( f \) 在 \( c \) 处可微，\( g \) 在 \( f(c) \) 处可微，则 \( (g \circ f)'(c) = g'(f(c)) \cdot f'(c) \)<sup>[1](https://www.math.ucdavis.edu/~hunter/m125a/intro_analysis_ch4.pdf)</sup> |
| 线性映射解读 | 复合函数的导数是导数的复合：\( f \) 在 \( c \) 处按 \( f'(c) \) 缩放长度，\( g \) 在 \( f(c) \) 处按 \( g'(f(c)) \) 缩放长度，因此复合函数按两者乘积缩放<sup>[1](https://www.math.ucdavis.edu/~hunter/m125a/intro_analysis_ch4.pdf)</sup> |
| 反函数 | 若 \( f'(c) \neq 0 \)，链式法则给出 \( (f^{-1})'(f(c)) = 1/f'(c) \)<sup>[1](https://www.math.ucdavis.edu/~hunter/m125a/intro_analysis_ch4.pdf)</sup> |
| 多变量形式 | 对于 \( w = w(u,v) \) 及 \( u = u(x,y) \)、\( v = v(x,y) \)，令 \( \Delta y = 0 \) 并逐项应用链式法则，即得偏导数<sup>[2](https://www.math.lsu.edu/~rich/2057downloads/ChainRuleWithDifferentiabilityProof.pdf)</sup> |
| 首次明确表述 | 链式法则似乎直到1797年才由拉格朗日明确陈述，尽管它已隐含于莱布尼茨1676年的一篇论文中<sup>[3](https://hsm.stackexchange.com/questions/762/when-how-were-the-product-and-chain-rules-first-proved)</sup> |
| 随机类比 | 伊藤公式是随机分析中的链式法则，它在普通链式法则之上增加了一个含二阶导数的漂移项 \( \tfrac{1}{2}\sigma^2 f_{xx}\,dt \)<sup>[4](https://riskhub.org/maths-for-quants/course-content/stochastic-calculus-foundations/ito-calculus-essentials/itos-lemma-for-functions-of-stochastic-processes-2149)</sup> |
| 机器学习中的作用 | 链式法则是使自动微分——进而使神经网络的反向传播训练——得以实现的数学原理<sup>[5](https://arxiv.org/abs/2607.13973)</sup> |

## 为什么变化率的乘积是自然的

把导数看作线性映射时，这个结果便很直观。若 \( f \) 在 \( c \) 处可微，它按因子 \( f'(c) \) 缩放长度；若 \( g \) 在 \( f(c) \) 处可微，它在那里按因子 \( g'(f(c)) \) 缩放长度。因此复合函数 \( g \circ f \) 在 \( c \) 处按因子 \( g'(f(c)) \cdot f'(c) \) 缩放长度。等价地说，复合函数的导数是导数的复合。<sup>[1](https://www.math.ucdavis.edu/~hunter/m125a/intro_analysis_ch4.pdf)</sup>

严格证明使这一观察精确化。由于 \( f \) 在 \( c \) 处可微，可写 \( f(c+h) = f(c) + f'(c)h + r(h) \)，其中 \( r(h)/h \to 0 \)；对 \( g \) 在 \( f(c) \) 处同理；将一个展开式代入另一个，即知复合误差项在极限中消失，留下乘积公式。<sup>[1](https://www.math.ucdavis.edu/~hunter/m125a/intro_analysis_ch4.pdf)</sup> 同一定理可推广到多变量函数，此时导数是雅可比矩阵，链式法则说的是复合函数的雅可比矩阵是各雅可比矩阵的矩阵乘积。<sup>[2](https://www.math.lsu.edu/~rich/2057downloads/ChainRuleWithDifferentiabilityProof.pdf)</sup>

## 直接推论

两个标准结果直接来自链式法则。倒数的导数 \( (1/f)' = -f'/f^2 \) 来自将 \( f \) 与 \( g(y) = 1/y \) 复合，再与乘积法则结合便得到商法则。<sup>[1](https://www.math.ucdavis.edu/~hunter/m125a/intro_analysis_ch4.pdf)</sup> 反函数的导数同样来自链式法则：由于 \( f^{-1}(f(x)) = x \)，两边求导得 \( (f^{-1})'(f(c)) \cdot f'(c) = 1 \)，故当 \( f'(c) \neq 0 \) 时 \( (f^{-1})'(f(c)) = 1/f'(c) \)。非零条件是必要的：对于 \( f(x) = x^3 \)，其反函数 \( f^{-1}(y) = y^{1/3} \) 在 \( f(0) = 0 \) 处不可微，而那里 \( f'(0) = 0 \)。<sup>[1](https://www.math.ucdavis.edu/~hunter/m125a/intro_analysis_ch4.pdf)</sup>

**隐函数微分。** 对联系各变量而不解出其中之一的方程求导，是链式法则的一个应用：当诸如 \( y \) 这样的变量隐式地依赖于 \( x \) 时，每个含 \( y \) 的项都通过链条 \( y \to x \) 求导。<sup>[6](https://edtech.engineering.utoronto.ca/project-catalog/calculus-for-engineers-i/unit-6-sections-3-6-3-7-3-10/)</sup>

## 相关变化率

相关变化率问题是经典的课堂应用。当两个或多个量作为时间的隐函数变化时，它们的变化率通过对联系这些量本身的方程关于 \( t \) 隐式求导而相互关联。<sup>[7](https://www.utrgv.edu/cstem/utrgv-calculus/calculus-i/application-of-derivatives/related-rates/index.htm)</sup> 例如，若直角三角形的各边均随时间变化，且边长由勾股定理相联系，隐式求导便给出关于三个变化率的线性方程；已知某时刻两边的值和其中两个变化率，即可确定第三个。<sup>[7](https://www.utrgv.edu/cstem/utrgv-calculus/calculus-i/application-of-derivatives/related-rates/index.htm)</sup> 一个标准的例题是：空气以 \( 5 \, \mathrm{cm^3/min} \) 的速率泵入球形气球，当直径为20厘米时，半径增加得多快？<sup>[8](https://tutorial.math.lamar.edu/classes/calci/relatedrates.aspx)</sup> 麻省理工学院的单变量微积分课程将链式法则描述为求解此类问题的关键，例子包括水被泵入水箱以及锥形水箱随时间注水。<sup>[9](https://ocw.mit.edu/courses/18-01sc-single-variable-calculus-fall-2010/pages/unit-2-applications-of-differentiation/part-b-optimization-related-rates-and-newtons-method/session-31-related-rates/)</sup>

## 历史

这条法则的断代颇为奇特。它隐含于莱布尼茨1676年的一篇论文中，但据数学史家称，直到1797年约瑟夫-路易·拉格朗日在其《解析函数论》中发表它，才似乎有了明确陈述；正是这部著作将微积分以纯代数术语重新表述。<sup>[3](https://hsm.stackexchange.com/questions/762/when-how-were-the-product-and-chain-rules-first-proved)</sup><sup> • </sup><sup>[10](https://openlibrary.org/works/OL1794105W/Theorie_des_fonctions_analytiques)</sup> 莱布尼茨1672至1676年间在巴黎工作，到1677年已给出和、积、商、幂与根的正确求导法则，而链式法则的 \( dy/du \cdot du/dx \) 形式正是用他的微分记法写出的。<sup>[11](https://en.wikisource.org/wiki/A_History_of_Mathematics_%281893%29/Modern_Europe/Newton_to_Euler)</sup> 十九世纪分析学严格化期间，包括柯西和魏尔斯特拉斯在内的数学家将微分奠基于极限之上，链式法则遂被表述为关于可微性与极限行为的定理。<sup>[12](https://archania.org/p/the-symbolic-world/mathematics/theorems/chain-rule)</sup>

## 随机链式法则：伊藤公式

对于由布朗运动驱动的随机过程的函数，普通链式法则失效。随机分析的核心公式——伊藤引理——是它的替代品：对于 \( Y_t = f(X_t) \)，其中 \( X_t \) 是漂移为 \( \mu \)、波动率为 \( \sigma \) 的扩散过程，该公式保留普通链式法则的各项，并增加一个含二阶导数的漂移项 \( \tfrac{1}{2}\sigma^2 f_{xx}\,dt \)。<sup>[4](https://riskhub.org/maths-for-quants/course-content/stochastic-calculus-foundations/ito-calculus-essentials/itos-lemma-for-functions-of-stochastic-processes-2149)</sup> 额外项的出现是因为布朗运动具有非零二次变差，于是泰勒展开中在普通微积分里可忽略的二阶项在极限中得以保留。<sup>[13](https://www.sciencedirect.com/topics/engineering/ito-formula)</sup> 当一般陈述中 \( G_t^{ij} = 0 \) 时，伊藤法则退化为普通链式法则，理应如此。<sup>[14](https://web.math.princeton.edu/~rvan/acm217/ACM217.pdf)</sup> 另一种随机积分——斯特拉托诺维奇积分——服从普通链式法则，当这一性质重要时更受青睐。<sup>[15](https://arithmion.com/learn/en/depth-stochastic/ito-lemma-derivation/)</sup>

## 自动微分

自动微分是机器学习中反向传播背后的机制，它是将链式法则系统地应用于被视为基本运算复合的计算过程。对于光滑函数，经典链式法则保证梯度可以通过这样的复合来计算。<sup>[5](https://arxiv.org/abs/2607.13973)</sup>

链式法则的两种排序方式给出自动微分的两种模式，而该法则的结合性允许许多种排序，包括从两端出发在中间会合。<sup>[16](https://ocw.mit.edu/courses/18-s096-matrix-calculus-for-machine-learning-and-beyond-january-iap-2023/mit18_s096iap23_lec08.pdf)</sup> 在前向模式中，随着函数的求值，雅可比-向量积被逐个推过每个基本运算；内存开销与计算的深度无关，浮点运算开销约为函数本身求值开销的3倍。<sup>[17](https://docs.jax.dev/en/latest/jacobian-vector-products.html)</sup> 在反向模式中，对所有参数的梯度在单次导数追踪中算出，这正是使大规模优化问题可处理的原因：对于数百万或数十亿参数的标量损失函数，雅可比矩阵是一个非常宽的矩阵，用前向模式逐列构建它无法扩展。<sup>[18](https://www.frontiersin.org/journals/ecology-and-evolution/articles/10.3389/fevo.2022.1010278/full)</sup><sup> • </sup><sup>[17](https://docs.jax.dev/en/latest/jacobian-vector-products.html)</sup>

**非光滑情形。** 神经网络损失并非处处光滑，仅靠经典的Clarke次微分不足以理解非光滑情境下的自动微分。博尔特与波维尔斯引入了保守场——以沿曲线的链式法则成立为特征的集值映射——恢复了将微分学推广到光滑情形之外所需的结构；其应用之一是梯度型深度学习算法的收敛性分析。<sup>[19](https://arxiv.org/abs/2101.00699)</sup>

## References

1. [The chain rule (Theorem 4.20), Introduction to Analysis, UC Davis](https://www.math.ucdavis.edu/~hunter/m125a/intro_analysis_ch4.pdf)
2. [Proof of the Chain Rule with differentiability, Louisiana State University](https://www.math.lsu.edu/~rich/2057downloads/ChainRuleWithDifferentiabilityProof.pdf)
3. [When/how were the product and chain rules first proved? History of Science and Mathematics Stack Exchange](https://hsm.stackexchange.com/questions/762/when-how-were-the-product-and-chain-rules-first-proved)
4. [Itô's Lemma for Functions of Stochastic Processes, Risk Hub](https://riskhub.org/maths-for-quants/course-content/stochastic-calculus-foundations/ito-calculus-essentials/itos-lemma-for-functions-of-stochastic-processes-2149)
5. [Associated gradients: connection to conservative fields and application, arXiv](https://arxiv.org/abs/2607.13973)
6. [Unit 6: The Chain Rule and applications, University of Toronto Engineering](https://edtech.engineering.utoronto.ca/project-catalog/calculus-for-engineers-i/unit-6-sections-3-6-3-7-3-10/)
7. [Related Rates, UTRGV Calculus I](https://www.utrgv.edu/cstem/utrgv-calculus/calculus-i/application-of-derivatives/related-rates/index.htm)
8. [Calculus I, Section 3.11: Related Rates, Paul's Online Math Notes, Lamar University](https://tutorial.math.lamar.edu/classes/calci/relatedrates.aspx)
9. [Session 31: Related Rates, MIT OpenCourseWare 18.01SC](https://ocw.mit.edu/courses/18-01sc-single-variable-calculus-fall-2010/pages/unit-2-applications-of-differentiation/part-b-optimization-related-rates-and-newtons-method/session-31-related-rates/)
10. [Théorie des fonctions analytiques, Joseph Louis Lagrange, Open Library](https://openlibrary.org/works/OL1794105W/Theorie_des_fonctions_analytiques)
11. [A History of Mathematics (1893), Newton to Euler, Wikisource](https://en.wikisource.org/wiki/A_History_of_Mathematics_%281893%29/Modern_Europe/Newton_to_Euler)
12. [Chain rule, Archania](https://archania.org/p/the-symbolic-world/mathematics/theorems/chain-rule)
13. [Itô Formula, ScienceDirect Topics](https://www.sciencedirect.com/topics/engineering/ito-formula)
14. [The Itô calculus, ACM 217 notes, Princeton University](https://web.math.princeton.edu/~rvan/acm217/ACM217.pdf)
15. [Itô's Lemma: The Chain Rule for Random Processes, Arithmion Learning](https://arithmion.com/learn/en/depth-stochastic/ito-lemma-derivation/)
16. [Matrix Calculus for Machine Learning, MIT OpenCourseWare](https://ocw.mit.edu/courses/18-s096-matrix-calculus-for-machine-learning-and-beyond-january-iap-2023/mit18_s096iap23_lec08.pdf)
17. [Forward- and reverse-mode autodiff in JAX, JAX documentation](https://docs.jax.dev/en/latest/jacobian-vector-products.html)
18. [Automatic differentiation and the optimization of differential equation models in biology, Frontiers in Ecology and Evolution](https://www.frontiersin.org/journals/ecology-and-evolution/articles/10.3389/fevo.2022.1010278/full)
19. [The structure of conservative gradient fields, arXiv](https://arxiv.org/abs/2101.00699)

---
*Initially written Sep 17, 2026 · Reviewed: Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 数学分析与数学模型 › Differential calculus and derivatives

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/chain-rule

English original: https://www.edgepedia.org/chain-rule
