多元微积分笔记(三)多元函数的导数与微分

本文最后更新于:2022年4月30日 下午

第三讲 多元函数的导数与微分

求导数的目的是为了找到一个非线性的函数/映射在一点附近的局部线性近似。

由于维数升高,原有的导数定义需要修改,有两种解决方法:

  • 沿向量求导, 方向导数:(包括偏导数) \[ \lim _{t \rightarrow 0} \frac{f\left(\mathbf{x}_{0}+t \mathbf{v}\right)-f\left(\mathbf{x}_{0}\right)}{t} \]

  • 微分 \[ \begin{gathered} 类比\lim _{x \rightarrow x_{0}} \frac{f(x)-f\left(x_{0}\right)-f^{\prime}\left(x_{0}\right)\left(x-x_{0}\right)}{x-x_{0}}=0:\\ f(\mathbf{x})-f\left(\mathbf{x}_{0}\right)-L\left(\mathbf{x}-\mathbf{x}_{0}\right)=o\left(\mathbf{x}-\mathbf{x}_{0}\right), \quad \mathbf{x} \rightarrow \mathbf{x}_{0} . \end{gathered} \] \(L\) 是线性映射。

1.方向导数

先看函数/映射沿向量的导数:设 \(\mathbf{x}^{*}\)\(E\) 的一个内点, \(\mathbf{v} \in \mathbf{R}^{m}\) 。记 \[ \partial_{\mathbf{v}} f\left(\mathbf{x}^{*}\right)=\left.\frac{\mathrm{d} f\left(\mathbf{x}^{*}+t \mathbf{v}\right)}{\mathrm{d} t}\right|_{t=0}=\lim _{t \rightarrow 0} \frac{f\left(\mathbf{x}^{*}+t \mathbf{v}\right)-f\left(\mathbf{x}^{*}\right)}{t} \] 称为映射 \(f: E \rightarrow \mathbb{R}^{p}\)\(\mathbf{x}^{*}\) 处沿向量 \(\mathbf{v}\) 的导数。

内点:设 \(E \subseteq \mathbb{R}^{m}\), 称 \(\mathbf{x}^{*} \in \mathbb{R}^{m}\)\(E\) 的一个内点, 如果 \(\exists \delta>0\) 使得 \(\forall \mathbf{x} \in \mathbb{R}^{m},\left\|\mathbf{x}-\mathbf{x}^{*}\right\|<\delta \Rightarrow \mathbf{x} \in E\).

  1. 对映射 \(f(\mathbf{x})=\left(f^{1}(\mathbf{x}), \ldots, f^{p}(\mathbf{x})\right)^{T}, \quad \partial_{\mathbf{v}} f\left(\mathbf{x}^{*}\right) \in \mathbb{R}^{p}\), 且 \[ \partial_{\mathbf{v}} f\left(\mathbf{x}^{*}\right)=\left(\partial_{\mathbf{v}} f^{1}\left(\mathbf{x}^{*}\right), \ldots, \partial_{\mathbf{v}} f^{p}\left(\mathbf{x}^{*}\right)\right)^{T} \]
  2. \(\partial_{\mathbf{v}} f\left(\mathbf{x}^{*}\right)\) 并不依赖于原像空间 \(\mathbb{R}^{m}\) 中的任何范数。
  3. \(f\left(\mathbf{x}^{*}+t \mathbf{v}\right)\) 把多元函数 \(f\) 变成关于 \(t\) 的一元函数, 这是用一元微积分方法研究多元函数的一个常用方式。
  4. 对任何实数 \(\lambda, \partial_{\lambda \mathbf{v}} f\left(\mathbf{x}^{*}\right)=\lambda \partial_{\mathbf{v}} f\left(\mathbf{x}^{*}\right)\)

由此可以定义方向导数:映射 \(f: E \rightarrow \mathbb{R}^{p}\)\(\mathbf{x}^{*}\) 处沿向量 \(\mathbf{v}\) 的导数,且 \(\mathbf v\) 为单位向量。

在一元函数中,某点沿x轴正向的方向导数为该点函数的右导数;该点沿x轴负向的方向导数为该点左导数的相反数。但更多地,方向导数更强调函数在某一方向、某一固定点的性质,与一般导数不太相同。

2.偏导数

\(E \subseteq \mathbb{R}^{m}, \mathbf{x}^{*}\)\(E\) 的一个内点。 设 \(\mathbf{v}_{1}, \ldots, \mathbf{v}_{m} \in \mathbf{R}^{m}\) 是一组基底向量, \(\left(x^{1}, \ldots, x^{m}\right)\) 是相应的坐标, 即 \[ \mathbf{x}-\mathbf{x}^{*}=x^{1} \mathbf{v}_{1}+\cdots+x^{m} \mathbf{v}_{m} \] 此时记 \[ \partial_{k} f\left(\mathbf{x}^{*}\right)=\frac{\partial f}{\partial x^{k}}\left(\mathbf{x}^{*}\right)=\partial_{\mathbf{v}_{k}} f\left(\mathbf{x}^{*}\right)=\lim _{t \rightarrow 0} \frac{f\left(\mathbf{x}^{*}+t \mathbf{v}_{k}\right)-f\left(\mathbf{x}^{*}\right)}{t} \] 称为映射 \(f: E \rightarrow \mathbb{R}^{p}\)\(\mathrm{x}^{*}\) 处对坐标 \(x^{k}\) 的偏导数。

3.映射的可微性和微分

\(E \subseteq \mathbb{R}^{m}, \mathbf{x}^{*}\)\(E\) 的一个内点。 称 \(f: E \rightarrow \mathbb{R}^{p}\)\(\mathrm{x}^{*}\) 处可微, 如果存在线性映射 \(L: \mathbb{R}^{m} \rightarrow \mathbb{R}^{p}\) (称为 \(f: E \rightarrow \mathbb{R}^{p}\)\(\mathbf{x}^{*}\) 处的导数或微分, 记为 \(\mathrm{D} f\left(\mathbf{x}^{*}\right)\) ) 使得 \[ f\left(\mathbf{x}^{*}+\mathbf{v}\right)=f\left(\mathbf{x}^{*}\right)+L\mathbf{v}+o(\|\mathbf{v}\|), \quad \mathbf{v} \rightarrow \mathbf{0} . \]\(p=1\) 时更常称为微分, 记为 \(\mathrm{d} f\left(\mathbf{x}^{*}\right)\)

例:对仿射映射 \(f(\mathbf{x})=\mathbf{a}+A \mathbf{x}\), 它在任何点处都可微, 且 \[ \operatorname{D}f(\mathbf{x})=A \] 例 (乘法的可微性和Leibniz 公式): 求 \(h(\mathbf{x})=L_{2}(f(\mathbf{x}), g(\mathbf{x}))\) 的微分, 其中 \(L_{2}\) 是双线性型, \(f, g\) 可微。

解: \[ \begin{aligned} h(\mathbf{x}+\mathbf{v}) &=L_{2}(f(\mathbf{x}+\mathbf{v}), g(\mathbf{x}+\mathbf{v})) \\ &=L_{2}(f(\mathbf{x})+\operatorname{D} f(\mathbf{x}) \mathbf{v}+o(\mathbf{v}), g(\mathbf{x})+\operatorname{Dg}(\mathbf{x}) \mathbf{v}+o(\mathbf{v})) \\ &=h(\mathbf{x})+L_{2}(\operatorname{D} f(\mathbf{x}) \mathbf{v}, g(\mathbf{x}))+L_{2}(f(\mathbf{x}), \operatorname{Dg}(\mathbf{x}) \mathbf{v})+o(\mathbf{v}), \quad \mathbf{v} \rightarrow 0 \end{aligned} \] 所以 \(h\) 可微, 且 \[ \mathrm{D} h(\mathbf{x}) \mathbf{v}=L_{2}(\mathrm{D} f(\mathbf{x}) \mathbf{v}, g(\mathbf{x}))+L_{2}(f(\mathbf{x}), \mathrm{D} g(\mathbf{x}) \mathbf{v}) \]\(F, G\) 是可微向量场, \(\langle,\rangle\)内积, 求 \(h(\mathbf{x})=\langle F(\mathbf{x}), G(\mathbf{x})\rangle\) 的微分。

解:由上例知 \(h\) 可微, 且 \[ \begin{aligned} \mathrm{d} h(\mathbf{x}) \mathbf{v} &=\langle\mathrm{D} F(\mathbf{x}) \mathbf{v}, G(\mathbf{x})\rangle+\langle F(\mathbf{x}), \mathrm{D} G(\mathbf{x}) \mathbf{v}\rangle \\ &=\left\langle\mathbf{v},(\mathrm{D} F(\mathbf{x}))^{T} G(\mathbf{x})\right\rangle+\left\langle(\mathrm{D} G(\mathbf{x}))^{T} F(\mathbf{x}), \mathbf{v}\right\rangle \\ &=\left\langle\mathbf{v},(\mathrm{D} F(\mathbf{x}))^{T} G(\mathbf{x})+(\mathrm{D} G(\mathbf{x}))^{T} F(\mathbf{x})\right\rangle \end{aligned} \] (线性代数知识)设 \(A: \mathbb{R}^{m} \rightarrow \mathbb{R}^{n}\) 是一个线性映射, \(\langle,\rangle_{m}\)\(\langle,\rangle_{n}\) 分别是 \(\mathbb{R}^{m}\)\(\mathbb{R}^{n}\) 上的内积。定义 \(A^{T}: \mathbb{R}^{n} \rightarrow \mathbb{R}^{m}\) 是线性映射, 满足对任意 \(\mathbf{x} \in \mathbb{R}^{m}, \mathbf{y} \in \mathbb{R}^{n}\) 都有 \(\langle A \mathbf{x}, \mathbf{y}\rangle_{n}=\left\langle\mathbf{x}, A^{T} \mathbf{y}\right\rangle_{n}\)

\(k\)-重线性型 \(L_{k}\left(\mathbf{v}_{1}, \ldots, \mathbf{v}_{\mathbf{k}}\right)\) 关于 \(\left(\mathbf{v}_{1}, \ldots, \mathbf{v}_{k}\right)\) 是可微函数, 求 \(L_{k}\) 的微分。 解: \[ \begin{aligned} & L_{k}\left(\mathbf{v}_{1}+\mathbf{w}_{1}, \ldots, \mathbf{v}_{k}+\mathbf{w}_{k}\right) \\ =& L_{k}\left(\mathbf{v}_{1}, \mathbf{v}_{2}, \ldots, \mathbf{v}_{k}\right) \\ &+L_{k}\left(\mathbf{w}_{1}, \mathbf{v}_{2}, \ldots, \mathbf{v}_{k}\right)+L_{k}\left(\mathbf{v}_{1}, \mathbf{w}_{2}, \ldots, \mathbf{v}_{k}\right)+\cdots+L_{k}\left(\mathbf{v}_{1}, \mathbf{v}_{2}, \ldots, \mathbf{w}_{k}\right) \\ &+o(\|\mathbf{w}\|), \quad\|\mathbf{w}\| \rightarrow 0 . \end{aligned} \] 所以 \[ \begin{aligned} & \mathrm{D} L_{k}\left(\mathbf{v}_{1}, \ldots, \mathbf{v}_{k}\right)\left(\mathbf{w}_{1}, \ldots, \mathbf{w}_{k}\right) \\ =& L_{k}\left(\mathbf{w}_{1}, \mathbf{v}_{2}, \ldots, \mathbf{v}_{k}\right)+L_{k}\left(\mathbf{v}_{1}, \mathbf{w}_{2}, \ldots, \mathbf{v}_{k}\right)+\cdots+L_{k}\left(\mathbf{v}_{1}, \mathbf{v}_{2}, \ldots, \mathbf{w}_{k}\right) \end{aligned} \] 例:除法(逆)的可微性。考虑 \(\operatorname{inv}\) : \(\mathcal{G L}(m) \rightarrow \mathcal{G L}(m), \operatorname{inv}(A)=A^{-1}\) 。证明 \(\operatorname{inv}\) 是可微映射, 并求它的微分。

解:我们已经知道当 \(\|B\|<1\) 时, \(I-B\) 可逆, \((I-B)^{-1}=I+C\), 且 \(\|C\| \leq \frac{\|B\|}{1-\|B\|}\) 。由 \((I+C)(I-B)=I\)\(C=B+C B\) 。于是 \[ \operatorname{inv}(I-B)=I+C=I+B+C B, \] 其中 \(\|C B\| \leq\|C\|\|B\| \leq \frac{\|B\|^{2}}{1-\|B\|}\), 所以 \(C B=o(B) \quad(B \rightarrow 0)\) 。对 \(A_{0} \in \mathcal{G} \mathcal{L}(m)\), 以及 \(B \in \mathcal{L}(m)\), 当 \(\|B\|<\frac{1}{\left\|A_{0}^{-1}\right\|}\) 时, \[ \begin{aligned} \operatorname{inv}\left(A_{0}+B\right) &=\left(A_{0}\left(I+A_{0}^{-1} B\right)\right)^{-1}=\left(I-A_{0}^{-1} B+o(B)\right) A_{0}^{-1} \\ &=\operatorname{inv}\left(A_{0}\right)-A_{0}^{-1} B A_{0}^{-1}+o(B) . \end{aligned} \] 因此 \(\operatorname{inv}\) 可微, 且 \(\operatorname{Dinv}\left(A_{0}\right)(B)=-A_{0}^{-1} B A_{0}^{-1}\)

4.链索法则

定理内容:设 \(f\)\(\mathbf{x}\) 处可微, \(g\)\(\mathbf{y}=f(\mathbf{x})\) 处可微, 则 \(g \circ f\)\(\mathbf{x}\) 处可微, 且 \[ \mathrm{D}(g \circ f)(\mathbf{x})=\mathrm{D}g(\mathrm{D}f(\mathbf{x})) . \] 证明: \[ \begin{aligned} g(\mathbf{y}+\mathbf{w}) &=g(\mathbf{y})+\operatorname{Dg}(\mathbf{y}) \mathbf{w}+o(\mathbf{w}) \\ f(\mathbf{x}+\mathbf{v}) &=f(\mathbf{x})+\operatorname{D} f(\mathbf{x}) \mathbf{v}+o(\mathbf{v}) \end{aligned} \] 因此 \[ \begin{aligned} g(f(\mathbf{x}+\mathbf{v})) &=g(\mathbf{y})+\mathrm{Dg}(\mathbf{y})(f(\mathbf{x}+\mathbf{v})-f(\mathbf{x}))+o(f(\mathbf{x}+\mathbf{v})-f(\mathbf{x})) \\ &=g(\mathbf{y})+\mathrm{Dg}(\mathbf{y})(\mathrm{D} f(\mathbf{x}) \mathbf{v}+o(\mathbf{v}))+o(\mathrm{D} f(\mathbf{x}) \mathbf{v}+o(\mathbf{v})) \\ &=g(\mathbf{y})+\mathrm{Dg}(\mathbf{y}) \mathrm{D} f(\mathbf{x}) \mathbf{v}+o(\mathbf{v}) \end{aligned} \] 例:证明行列式函数 \(\operatorname{det}(A)\) 是关于 \(A\) 的可微函数, 并求它的微分。

证明:记 \(\operatorname{col}_{j}(A)\) 为矩阵 \(A\) 的第 \(j\) 列, 则 \(\operatorname{col}_{j}: \mathcal{L}(m) \rightarrow \mathbb{R}^m\) 是线性映射, 从而可微。 \(\operatorname{det}(A)\) 是关于 \(\left(\operatorname{col}_{1}(A), \ldots, \operatorname{col}_{m}(A)\right)\)\(m\) 重线性型, 所以 \(\det\) : \(\mathcal{L}(m) \rightarrow \mathbb{R}\) 是可微函数。由链索法则, \[ \begin{aligned} \operatorname{Ddet}(A) B=& \operatorname{det}\left(\operatorname{col}_{1}(B), \operatorname{col}_{2}(A), \ldots, \operatorname{col}_{m}(A)\right) \\ &+\operatorname{det}\left(\operatorname{col}_{1}(A), \operatorname{col}_{2}(B), \ldots, \operatorname{col}_{m}(A)\right) \\ &+\cdots+\operatorname{det}\left(\operatorname{col}_{1}(A), \operatorname{col}_{2}(A), \ldots, \operatorname{col}_{m}(B)\right) \\ =& \sum_{i=1}^{m} \sum_{j=1}^{m} B_{i}^{j}\left(A^{*}\right)_{i}^{j}=\sum_{i=1}^{m} \sum_{j=1}^{m}\left(A^{* T}\right)_{j}^{i} B_{i}^{j}=\sum_{i=1}^{m}\left(A^{* T} B\right)_{i}^{i} \\ =& \operatorname{tr}\left(A^{* T} B\right) \end{aligned} \]

\(A^{*T}\) 代表 \(A\) 的伴随矩阵,\(A^*\) 每个元素是 \(A\) 中对应元素的代数余子式。

5.微分与方向导数

\(f\)\(\mathbf{x}^{*}\) 可微, \(\mathbf{x}:(-\delta, \delta) \rightarrow \mathbb{R}^{m}\) 是可微映射, 满足 \(\mathbf{x}(0)=\mathbf{x}^{*}, \mathbf{x}^{\prime}(0)=\mathbf{v}\) 。则 \(f\) 沿曲线 \(\mathbf{x}(t)\) 的导数 \[ \begin{aligned} \lim _{t \rightarrow 0} \frac{f(\mathbf{x}(t))-f\left(\mathbf{x}^{*}\right)}{t} &=\left.\frac{\mathrm{d} f(\mathbf{x}(t))}{\mathrm{d} t}\right|_{t=0} \\ &=\mathrm{D}(f \circ \mathbf{x})(0) 1=\mathrm{D} f\left(\mathbf{x}^{*}\right) \mathrm{D} \mathbf{x}(0) 1 \\ &=\mathrm{D} f\left(\mathbf{x}^{*}\right) \mathbf{x}^{\prime}(0)=\mathrm{D} f\left(\mathbf{x}^{*}\right) \mathbf{v} \end{aligned} \] 因此若 \(f\)\(\mathbf{x}^{*}\) 可微,则 \(\forall \mathbf{v} \in \mathbb{R}^{m}\), 方向导数 \(\partial_{\mathbf{v}} f\left(\mathbf{x}^{*}\right)=\operatorname{D} f\left(\mathbf{x}^{*}\right) \mathbf{v}\) 。 也就是说, \(\quad \partial_{\lambda \mathbf{u}+\mu \mathbf{v}} f\left(\mathbf{x}^{*}\right)=\lambda \partial_{\mathbf{u}} f\left(\mathbf{x}^{*}\right)+\mu \partial_{\mathbf{v}} f\left(\mathbf{x}^{*}\right)\)\(f\) 的微分使沿不同向量的导数之间建立了联系,为沿任意方向的方向导数表示为固定方向的几个方向导数提供了可能。

另,即使函数 \(f(\mathbf {x_0})\)\(A\) 点沿每个方向都有方向导数,也可能不可微。重点在于沿 \(\mathbf x-\mathbf{x_0}\) 的方向导数是否关于 \(\mathbf x-\mathbf{x_0}\) 是线性的。

6.微分和偏导数

如果 \(\mathbf{v}_{1}, \ldots, \mathbf{v}_{m}\)\(\mathbb{R}^{m}\) 的一组基, 则在 \(\mathbf {x^*}\) 附近可以引入局部坐标 \[ \mathbf{x}=\mathbf{x}^{*}+x^{1} \mathbf{v}_{1}+\cdots+x^{m} \mathbf{v}_{m} \]\(\mathbf{v}^{* 1}, \ldots, \mathbf{v}^{* m}\)\(\mathbf{v}_{1}, \ldots, \mathbf{v}_{m}\)对偶基, 即 \[ \mathbf{v}^{* k}: \mathbb{R}^{m} \rightarrow \mathbb{R} \] 是线性函数,使得 \[ \mathbf{v}^{* k}\left(\mathbf{v}_{j}\right)= \begin{cases}1, & k=j \\ 0, & k \neq j\end{cases}\\x^{k}=\mathbf{v}^{* k}\left(\mathbf{x}-\mathbf{x}^{*}\right)=x^{k}(\mathbf{x}) \] 这里面 \(x^k,\mathbf{v}^{*k}\) 都可以看作函数。

所以对可微函数 \(f\)\[ \mathrm{d} f\left(\mathbf{x}^{*}\right) \mathbf{v}=\sum_{k=1}^{m} x^{k} \mathrm{~d} f\left(\mathbf{x}^{*}\right) \mathbf{v}_{k}=\sum_{k=1}^{m} x^{k} \partial_{k} f\left(\mathbf{x}^{*}\right)=\sum_{k=1}^{m} \partial_{k} f\left(\mathbf{x}^{*}\right) \mathrm{d} x^{k}(\mathbf v) \] 所以 \[ \mathrm{d} f\left(\mathbf{x}^{*}\right)=\sum_{k=1}^{m} \partial_{k} f\left(\mathbf{x}^{*}\right) \mathrm{d} x^{k}=\left(\begin{array}{lll} \partial_{1} f & \cdots & \partial_{m} f \end{array}\right)\left(\begin{array}{c} \mathrm{d} x^{1} \\ \vdots \\ \mathrm{d} x^{m} \end{array}\right) \] 例:\(\det\) 函数的导数

我们已经知道 \(\displaystyle D \operatorname{det}(A) E_{i, j}=\lim _{t \rightarrow 0} \frac{\operatorname{det}\left(A+t E_{i, j}\right)-\operatorname{det}(A)}{t}=\left(A^{*}\right)_{j}^{i}\) ,因此 \[ \operatorname{D} \operatorname{det}(A) B=\sum_{i, j} B_{j}^{i}\left(A^{*}\right)_{j}^{i}=\sum_{j=1}^{m} \sum_{i=1}^{m}\left(A^{* T}\right)_{i}^{j} B_{j}^{i}=\operatorname{tr}\left(A^{* T} B\right) \] 由此式可以得到 \(\det(A+B)\approx\det(A)+\tr(A^{*T}B),B\to0\) ,特别地, \[ \det(I+B)\approx1+\tr(B),B\to0 \]

\[ \begin{aligned} \det(e^{tA})&=\det(I+tA+o(t))=1+t\tr(A)-o(t),t\to 0\\ \frac{\rm{d}\det(\it e^{tA})}{\rm d \it t} &= \lim_{s\to 0}\frac{\det{e^{(t+s)A}}-\det{e^{tA}}}{s}\\ &= \ \lim _{s \rightarrow 0} \frac{\operatorname{det}\left(e^{t A}\right) \operatorname{det}\left(e^{s A}\right)-\operatorname{det}\left(e^{t A}\right)}{s}\\ &= \ \left.\operatorname{det}\left(e^{t A}\right) \frac{d \operatorname{det}\left(e^{s A}\right)}{d s}\right|_{s=0}=\operatorname{tr}(A) \operatorname{det}\left(e^{t A}\right) \end{aligned} \]

这是一个一元微分方程,解之得 \(\det(\rm{e}^{\it tA})=\rm{e}^{\it t\tr(A)}\) 。因此 \(\det(\rm{e}^{\it A})=\rm{e}^{\it \tr(A)}\)

7.链锁法则的坐标形式

由上一小节的结论可以推出,对可微映射 \[ \begin{gathered} f\left(x^{1}, \ldots, x^{m}\right)=\left(f^{1}\left(x^{1}, \ldots, x^{m}\right), \ldots, f^{n}\left(x^{1}, \ldots, x^{m}\right)\right)^{T} \\ D f\left(\mathbf x^{*}\right)\rm{d}\mathbf x=\left(\begin{array}{ccc} \partial_{1} f^{1}\left(x^{*}\right) & \cdots & \partial_{m} f^{1}\left(x^{*}\right) \\ \vdots & \ddots & \vdots \\ \partial_{1} f^{n}\left(x^{*}\right) & \cdots & \partial_{m} f^{n}\left(x^{*}\right) \end{array}\right)\left(\begin{array}{c} \mathrm{d} x^{1} \\ \vdots \\ \mathrm{d} x^{m} \end{array}\right) \end{gathered} \] 等式中的大矩阵 \(\partial_{j} f^{i}\left(\mathbf{x}^{*}\right)\) 称为 \(f\) 在点 \(x^{*}\) 处的 Jacobi 矩阵

用 Jacobi 矩阵表示链锁法则: \[ \partial_{j}(g \circ f)^{i}\left(\mathbf{x}^{*}\right)=\partial_{j}\left(g^{i} \circ f\right)\left(\mathbf{x}^{*}\right)=\sum_{k=1}^{n} \partial_{k} g^{i}\left(f\left(\mathbf{x}^{*}\right)\right) \partial_{j} f^{k}\left(\mathbf{x}^{*}\right) \]

坐标系的引入使得抽象的数学概念可以被更方便地计算, 但同时也带来困扰: 同一对象在不同坐标系下具有不同的形式, 使得数学对象的本质属性被淹没在形式的外表之下。

8.极坐标变换

从平面极坐标到直角坐标的变换 \[ \left(\begin{array}{l} \rho \\ \theta \end{array}\right) \mapsto\left(\begin{array}{l} x \\ y \end{array}\right)=\left(\begin{array}{l} \rho \cos \theta \\ \rho \sin \theta \end{array}\right)=\rho\left(\begin{array}{c} \cos \theta \\ \sin \theta \end{array}\right) \] 是以下可微映射的复合 \[ (\rho, \theta) \mapsto \rho, \quad(\rho, \theta) \mapsto \theta, \quad \theta \mapsto(\cos \theta, \sin \theta)^{T}, \quad(\rho, \mathbf{x}) \mapsto \rho \mathbf{x}, \] 所以极坐标变换是可微映射。对此映射求导: \[ \left(\begin{array}{l} \mathrm{d} x(\rho, \theta)\\ \mathrm{d} y(\rho, \theta) \end{array}\right)=\left(\begin{array}{cc} \cos \theta & -\rho \sin \theta \\ \sin \theta & \rho \cos \theta \end{array}\right)\left(\begin{array}{l} d\rho \\ d\theta \end{array}\right) \] 其中若 \((r, \varphi)^{T}=(1,0)^{T}\)\((\rho, \theta)\) 平面中的沿 \(\rho\) 方向的单位向量,它对应于 \((x, y)\) 坐标平面中点 \((x, y)\) 处沿径向的单位向量 \((\cos \theta, \sin \theta)^{T}=(\dfrac{x}{\sqrt{x^{2}+y^{2}}}, \dfrac{y}{\sqrt{x^{2}+y^{2}}})^{T}\);若 \((r, \varphi)^{T}=(0,1)^{T}\)\((\rho, \theta)\) 平面中的沿 \(\theta\) 方向的单位向量,则它对应于 \((x, y)\) 坐标平面中点 \((x, y)\) 处沿切向的向量 \(\rho(-\sin \theta, \cos \theta)^{T}=(-y, x)^{T}\)

从直角坐标到极坐标

类似的, 在半平面 \(\left\{(x, y) \mid x_{0} x+y_{0} y>0\right\}\) 中可以定义 \(r(x, y)=\sqrt{x^{2}+y^{2}}, \quad \theta(x, y)=\theta_{0}+\arccos \dfrac{x_{0} x+y_{0} y}{\sqrt{x_{0}^{2}+y_{0}^{2}} \sqrt{x^{2}+y^{2}}}\) ,显然两者都是可微的。有 \[ \left(\begin{array}{l} \mathrm{d} r(x, y) \\ \mathrm{d} \theta(x, y) \end{array}\right)=\left(\begin{array}{cc} \dfrac{x}{\sqrt{x^{2}+y^{2}}}& \dfrac{y}{\sqrt{x^{2}+y^{2}}} \\ -\dfrac{y}{y^2-x^2} & \dfrac{x}{y^2-x^2} \end{array}\right)\left(\begin{array}{l} \mathrm{d}x \\ \mathrm{d}y \end{array}\right)\\ \] 微分在不同坐标系下的形式

如果 \(f(x, y)\) 是直角坐标系下的可微函数, 则 \(g(\rho, \varphi)=f(\rho \cos \theta, \rho \sin \theta)\) 是极坐标系下的可微函数, 则 \[ \begin{gathered} \mathrm{d} g(\rho, \theta)\left(\begin{array}{l} d\rho \\ d\theta \end{array}\right)=\mathrm{d} f(\rho \cos \theta, \rho \sin \theta)\left(\begin{array}{l} \mathrm{d} x \\ \mathrm{d} y \end{array}\right) \\ \left(\begin{array}{ll} \partial_{\rho} g & \partial_{\theta} g \end{array}\right)=\left(\begin{array}{ll} \partial_{x} f & \partial_{y} f \end{array}\right)\left(\begin{array}{cc} \cos \theta & -\rho \sin \theta \\ \sin \theta & \rho \cos \theta \end{array}\right) \end{gathered} \] 微分的形式不变性

\(g\left(y^{1}, \ldots, y^{n}\right), f^{i}\left(x^{1}, \ldots, x^{m}\right) \quad(1 \leq i \leq n)\) 是可微函数。记 \(h\left(x^{1}, \ldots, x^{m}\right)=g\left(f^{1}\left(x^{1}, \ldots, x^{m}\right), \ldots, f^{n}\left(x^{1}, \ldots, x^{m}\right)\right)\) 一方面,\(\mathrm{d} h=\sum\limits_{j=1}^{n} \partial_{j} h \mathrm{~d} x^{j}\);另一方面,由链索法则,\(\mathrm{d}(g \circ f)=\sum\limits_{i=1}^{n} \sum\limits_{j=1}^{m} \partial_{y^{i}} g \partial_{x^{j}} f^{i} \mathrm{d} x^{j}\)

如果用变量表示函数,比如 \(u=g(y), y=f(x)\) ,显然有 \(\mathrm{d}y^i=\partial_{x^{j}} f^{i} \mathrm{d} x^{j}\) ,于是: \[ \mathrm{d} u=\sum_{j=1}^{m} \partial_{x^{j}} u \mathrm{d} x^{j}=\sum_{k=1}^{n} \partial_{y^{k}} u \mathrm{d} y^{k} \] 这叫做可微函数的“一阶微分的形式不变性”。(感觉比较显然?)

9.微分与梯度

\(L: \mathbb{R}^{m} \rightarrow \mathbb{R}\) 是线性函数, $,$ 是 \(\mathbb{R}^{m}\) 上的内积。则存在唯一的向量 \(\nabla L \in \mathbb{R}^{m}\) 使得 \[ L(\mathbf{v})=\langle\mathbf{v}, \nabla L\rangle, \quad \forall \mathbf{v} \in \mathbb{R}^{m} . \] 这个唯一的向量 \(\nabla L \in \mathbb{R}^{m}\) 称为 \(L\) (在内积 \(\langle,\rangle\) 下) 的梯度

如图,由于已经规定 \(L\) 是线性映射,其图像必然是 \(m+1\) 维空间中的一个 \(m\) 维“平面”。现取此“平面”与自变量“平面”(同样是 \(m\) 维空间)的 \(m-1\) “交线”,此“交线”也自然是“直线”。由于此 \(m-1\) 维”交线“在 \(m\) 维自变量空间中,在该空间中必然只有唯一一个方向与其垂直。\(\nabla L\) 就在这个方向。由几何学可以知道,图像上任意一点的高度,等于其在自变量空间的投影向量与 \(\nabla L\) 的内积与 \(\nabla L\) 点对应的高度的乘积。

可微函数的梯度

\(f\)\(\mathbf{x}^{*} \in E\) 处可微, 称 \(\mathrm{d} f\left(\mathbf{x}^{*}\right)\) 的梯度为 \(f\)\(\mathbf{x}^{*} \in E\) 处的梯度, 记为 \(\nabla f\left(\mathbf{x}^{*}\right)\), 即对任意向量 \(\mathbf{v}\), \[ \partial_{\mathbf{v}} f\left(\mathbf{x}^{*}\right)=\left\langle\mathbf{v}, \nabla f\left(\mathbf{x}^{*}\right)\right\rangle \] 对以 \(\mathbf{v}_{1}, \ldots, \mathbf{v}_{m}\) 为基的内积空间,要想求 \(\nabla f\left(\mathbf{x}^{*}\right)\) 在这组基底下的坐标。

\[ \nabla f\left(\mathbf{x}^{*}\right)=c^{1} \mathbf{v}_{1}+\cdots+c^{m} \mathbf{v}_{m}, \quad \mathbf{v}=\xi^{1} \mathbf{v}_{1}+\cdots+\xi^{m} \mathbf{v}_{m} \] 这里 \(\mathbf v\) 是任意向量。则有 \(\left\langle\mathbf{v}, \nabla f\left(\mathbf{x}^{*}\right)\right\rangle=\sum_{1 \leq i, j \leq m} \xi^{i}\left\langle\mathbf{v}_{i}, \mathbf{v}_{j}\right\rangle c^{j}=\left(\xi^{1}, \ldots, \xi^{m}\right)\left(\left\langle\mathbf{v}_{i}, \mathbf{v}_{j}\right\rangle\right)_{m \times m}\left(\begin{array}{c}c^{1} \\ \vdots \\ c^{m}\end{array}\right)\) \(\mathrm{d} f\left(\mathbf{x}^{*}\right) \mathbf{v}=\partial_{1} f\left(\mathbf{x}^{*}\right) \xi^{1}+\cdots+\partial_{m} f\left(\mathbf{x}^{*}\right) \xi^{m}=\left(\xi^{1}, \ldots, \xi^{m}\right)\left(\begin{array}{c}\partial_{1} f\left(\mathbf{x}^{*}\right) \\ \vdots \\ \partial_{m} f\left(\mathbf{x}^{*}\right)\end{array}\right)\)

由梯度定义知以上两式应对任意 \(\xi^{1}, \ldots, \xi^{m}\) 恒等, 所以 \[ \left(\left\langle\mathbf{v}_{i}, \mathbf{v}_{j}\right\rangle\right)_{m \times m}\left(\begin{array}{c} c^{1} \\ \vdots \\ c^{m} \end{array}\right)=\left(\begin{array}{c} \partial_{1} f\left(\mathbf{x}^{*}\right) \\ \vdots \\ \partial_{m} f\left(\mathbf{x}^{*}\right) \end{array}\right) \] 因此梯度的表达式: \[ \begin{aligned} \nabla f\left(\mathbf{x}^{*}\right) &=\left(\mathbf{v}_{1}, \ldots, \mathbf{v}_{m}\right)\left(\begin{array}{c} c^{1} \\ \vdots \\ c^{m} \end{array}\right)=\left(\mathbf{v}_{1}, \ldots, \mathbf{v}_{m}\right)\left(\left\langle\mathbf{v}_{i}, \mathbf{v}_{j}\right\rangle\right)_{m \times m}^{-1}\left(\begin{array}{c} \partial_{1} f\left(\mathbf{x}^{*}\right) \\ \vdots \\ \partial_{m} f\left(\mathbf{x}^{*}\right) \end{array}\right) \\ &=\sum_{i, j} g^{i j} \partial_{j} f \mathbf{v}_{i} \end{aligned} \] 其中 \(\left(g^{i j}\right)_{m \times m}=\left(\left\langle\mathbf{v}_{i}, \mathbf{v}_{j}\right\rangle\right)_{m \times m}^{-1}\)

对于单位正交基 \(\mathbf{v}_{1}, \ldots, \mathbf{v}_{m}\), 度量矩阵 \(\left(\left\langle\mathbf{v}_{i}, \mathbf{v}_{j}\right\rangle\right)_{m \times m}\) 是单位矩阵,在此坐标下,梯度向量为 \[ \nabla f\left(\mathbf{x}^{*}\right)=\left(\mathbf{v}_{1}, \ldots, \mathbf{v}_{m}\right)\left(\begin{array}{c} \partial_{1} f\left(\mathbf{x}^{*}\right) \\ \vdots \\ \partial_{m} f\left(\mathbf{x}^{*}\right) \end{array}\right) \] ###### 例:平面极坐标系 \((r, \theta)\) 下的梯度表示。

平面极坐标系 \((r, \theta)\) 下以 \[ \mathbf{e}_{r}=\left[\begin{array}{c} \partial_r{x} \\ \partial_r{y} \end{array}\right]=\left[\begin{array}{c} \cos \theta \\ \sin \theta \end{array}\right], \quad \mathbf{e}_{\theta}=\left[\begin{array}{c} \partial_\theta{x} \\ \partial_\theta{y} \end{array}\right]=\left[\begin{array}{c} -r \sin \theta \\ r \cos \theta \end{array}\right] \] 为基底向量。 \[ \left\langle\mathbf{e}_{r}, \mathbf{e}_{r}\right\rangle=1, \quad\left\langle\mathbf{e}_{r}, \mathbf{e}_{\theta}\right\rangle=0, \quad\left\langle\mathbf{e}_{\theta}, \mathbf{e}_{\theta}\right\rangle=r^{2} . \] 所以 \(f\) 的梯度为 \[ \nabla f(r, \theta)=\left(\mathbf{e}_{r}, \mathbf{e}_{\theta}\right)\left(\begin{array}{cc} 1 & 0 \\ 0 & r^{2} \end{array}\right)^{-1}\left(\begin{array}{c} \partial_{r} f \\ \partial_{\theta} f \end{array}\right)=\partial_{r} f \mathbf{e}_{r}+\frac{1}{r^{2}} \partial_{\theta} f \mathbf{e}_{\theta} \] ###### 课后练习:球坐标的变换规律与梯度

从三维直角坐标向球坐标变换 \[ \left(\begin{array}{c} r \\ \theta \\ \varphi \end{array}\right) \mapsto\left(\begin{array}{l} x \\ y\\z \end{array}\right)=\left(\begin{gathered} r \sin\theta\cos\varphi \\ r \sin \theta\sin\varphi\\ r\cos\theta \end{gathered}\right) \] 显然此映射可微,求导可得 \[ \left[\begin{gathered}\mathrm{d}x(r,\theta,\varphi)\\\mathrm{d}y(r,\theta,\varphi)\\\mathrm{d}z(r,\theta,\varphi)\end{gathered}\right]= \begin{bmatrix} \sin\theta\cos\varphi&r\cos\theta\cos\varphi&-r\sin\theta\sin\varphi\\ \sin\theta\sin\varphi&r\cos\theta\sin\varphi&r\sin\theta\cos\varphi\\ \cos\theta&-r\sin\theta&0 \end{bmatrix}\left[\begin{gathered}\mathrm{d}r\\\mathrm{d}\theta\\\mathrm{d}\varphi\end{gathered}\right] \] 因此此坐标系的一组基是 \[ \mathbf{e}_r=\left[\begin{gathered}\sin\theta\cos\varphi\\ \sin \theta\sin\varphi\\ \cos\theta\end{gathered}\right], \mathbf{e}_\theta=\left[\begin{gathered}r\cos\theta\cos\varphi\\ r\cos \theta\sin\varphi\\ -r\sin\theta\end{gathered}\right], \mathbf{e}_\varphi=\left[\begin{gathered}-r\sin\theta\sin\varphi\\ r\sin \theta\cos\varphi\\ 0\end{gathered}\right] \]\[ \begin{gathered}\langle\mathbf{e}_r,\mathbf{e}_r\rangle=1,\langle\mathbf{e}_r,\mathbf{e}_\theta\rangle=0,\langle\mathbf{e}_r,\mathbf{e}_\varphi\rangle=0,\\\langle\mathbf{e}_\theta,\mathbf{e}_\theta\rangle=r^2,\langle\mathbf{e}_\theta,\mathbf{e}_\varphi\rangle=0,\langle\mathbf{e}_\varphi,\mathbf{e}_\varphi\rangle=r^2\sin^2\theta\end{gathered} \] 所以球坐标下的梯度可以表示为 \[ \begin{gathered}\nabla f(r, \theta,\varphi)=\left(\mathbf{e}_{r}, \mathbf{e}_{\theta},\mathbf{e}_\varphi\right)\left(\begin{array}{ccc} 1 & 0 &0\\ 0 & r^{2}&0\\ 0&0&r^2\sin^2\theta \end{array}\right)^{-1}\left(\begin{array}{c} \partial_{r} f \\ \partial_{\theta} f\\ \partial_{\varphi} f \end{array}\right)\\=\partial_{r} f \mathbf{e}_{r}+\frac{1}{r^{2}} \partial_{\theta} f \mathbf{e}_{\theta}+\frac{1}{r^2\sin^2\theta}\partial_\varphi f\mathbf{e}_\varphi\end{gathered} \]