# 标量场的梯度

\begin{align*} \newcommand{\dif}{\mathop{}\!\mathrm{d}} \newcommand{\p}{\partial} \end{align*}

# 方向导数

$\lim_{\Delta l \rightarrow 0} \frac{u(M) - u(M_0)}{\Delta l} = \frac{\partial u}{\partial l} \Big\vert_{M_0}$

计算公式

$u(M) - u(M_0) = \Delta u = \frac{\partial u}{\partial x}\Delta x + \frac{\partial u}{\partial y}\Delta y+ \frac{\partial u}{\partial z}\Delta z$

$\Delta x = \Delta l \cos \alpha,\; \Delta y = \Delta l \cos \beta,\; \Delta z = \Delta l \cos \gamma$

$\frac{\partial u}{\partial l} = \frac{\partial u}{\partial x} \cos \beta + \frac{\partial u}{\partial y} \cos \alpha+ \frac{\partial u}{\partial z} \cos \gamma$

$\frac{\partial u}{\partial l} = \Big( \frac{\partial u}{\partial x} \hat{a}_x + \frac{\partial u}{\partial y} \hat{a}_y+ \frac{\partial u}{\partial z} \hat{a}_z \Big) \cdot \hat{a}_l$

# 梯度矢量

$\text{令}\; \vec{G} = \frac{\partial u}{\partial x} \hat{a}_x + \frac{\partial u}{\partial y} \hat{a}_y+ \frac{\partial u}{\partial z} \hat{a}_z\\ \text{则}\; \frac{\partial u}{\partial l} = \vec{G} \cdot \hat{a}_l = \vert \vec{G} \vert \cos<\vec{G}, \hat{a}_l>$

• 与等电位面垂直
• 数值上等于最大方向导数
• 指向点位增加的方向

直角坐标系 $\text{grad}u = \frac{\partial u}{\partial x} \hat{a}_x + \frac{\partial u}{\partial y} \hat{a}_y+ \frac{\partial u}{\partial z} \hat{a}_z$

柱坐标系$\text{grad} u = \frac{\partial u}{\partial r} \vec{a}_r + \frac{1}{r}\frac{\partial u}{\partial \varphi} \vec{a}_\varphi + \frac{\partial u}{\partial z} \vec{a}_z$

\begin{align*} \dif \vec{l} &= \hat{a}_r \dif l_r + \hat{a}_\varphi r \dif \varphi + \hat{a}_z \dif z\\\\ \dif u &= \frac{\partial u}{\partial r} \dif r + \frac{\partial u}{\partial \varphi} \dif \varphi + \frac{\partial u}{\partial z} \dif z\\ &= \frac{\partial u}{\partial r} \dif r + \frac{1}{r}\frac{\partial u}{\partial \varphi} r\dif \varphi + \frac{\partial u}{\partial z} \dif z\\ &= \Big( \frac{\partial u}{\partial r} \vec{a}_r + \frac{1}{r}\frac{\partial u}{\partial \varphi} \vec{a}_\varphi + \frac{\partial u}{\partial z} \vec{a}_z \Big) \cdot \dif \vec{l}\\ &= \text{grad} u \cdot \dif \vec{l} \end{align*}

球坐标系 $\text{grad} u = \frac{\partial u}{\partial R} \vec{a}_R + \frac{1}{R}\frac{\partial u}{\partial \theta} \vec{a}_\theta + \frac{1}{R \sin \theta} \frac{\partial u}{\partial \varphi} \vec{a}_\varphi$

注意

1. 直角：$\frac{\partial u}{\partial x}+\frac{\partial u}{\partial y}+\frac{\partial u}{\partial z}$
2. 柱：$\frac{\partial u}{\partial r}+\frac{1}{r}\frac{\partial u}{\partial \varphi}+\frac{\partial u}{\partial z}$
3. 球：$\frac{\partial u}{\partial R}+\frac{1}{R}\frac{\partial u}{\partial \theta}+\frac{1}{R \sin \theta} \frac{\partial u}{\partial \varphi}$

• $\nabla C = 0$
• $\nabla (u\pm v) = \nabla u \pm \nabla v$
• $\nabla(uv)=u\nabla v+v \nabla u$
• $\nabla\left( \dfrac{u}{v} \right)=\frac{1}{v^2}(v\nabla u-u \nabla v)$
• $\nabla f(u) = f’(u)\nabla u$

$\frac{\partial u}{\partial l} = \hat{a}_l \cdot\text{grad} u$

（更严谨的推导请参考数学分析

\begin{align} \frac{\p}{\p x} \left( \frac{1}{R} \right)&=\frac{\p R}{\p x}\frac{\p}{\p R} \left( \frac{1}{R} \right)\\ &=-\frac{1}{R^2}\cdot \frac{2(x-x')}{2\sqrt{(x-x')^2+(y-y')^2+(z-z')^2}}\\ &=-\frac{1}{R^3}(x-x')\\ \therefore \nabla \left( \frac{1}{R} \right)&=-\frac{1}{R^3} \left[ (x-x')\vec{a}_x+(y-y')\vec{a}_y+(z-z')\vec{a}_z \right]\\ &=-\frac{\vec{R}}{R^3} \end{align} \begin{align} \frac{\p}{\p x'} \left( \frac{1}{R} \right)&=\frac{\p R}{\p x'}\frac{\p}{\p R} \left( \frac{1}{R} \right)\\ &=\frac{1}{R^2}\cdot \frac{2(x-x')}{2\sqrt{(x-x')^2+(y-y')^2+(z-z')^2}}\\ &=\frac{1}{R^3}(x-x')\\ \therefore \nabla \left( \frac{1}{R} \right)&=\frac{1}{R^3} \left[ (x-x')\vec{a}_x+(y-y')\vec{a}_y+(z-z')\vec{a}_z \right]\\ &=\frac{\vec{R}}{R^3} \end{align}