# 梯度定理

## 定理

${\displaystyle \int _{\gamma }\nabla \phi ({\vec {r}})\cdot d{\vec {r}}=\phi ({\vec {q}})-\phi ({\vec {p}})}$

## 證明

${\displaystyle \mathbb {R} ^{n}}$ 裏面嘅所有維度分別叫做 ${\displaystyle x_{i}}$，所有單位向量分別叫做 ${\displaystyle {\vec {e_{i}}}}$，其中 ${\displaystyle i\in \mathbb {N} :1\leq i\leq n}$。噉樣 ${\displaystyle \phi }$全微分可以寫做：

${\displaystyle d\phi =\sum _{i=1}^{n}{\frac {\partial {\phi }}{\partial x_{i}}}dx_{i}}$

${\displaystyle \mathbb {R} ^{n}}$ 裏面梯度嘅定義係：

${\displaystyle \nabla \phi =\sum _{i=1}^{n}{\frac {\partial {\phi }}{\partial x_{i}}}{\vec {e_{i}}}}$

{\displaystyle {\begin{aligned}&{\vec {r}}=\sum _{i=1}^{n}x_{i}{\vec {e_{i}}}\\&d{\vec {r}}=\sum _{i=1}^{n}dx_{i}{\vec {e_{i}}}\end{aligned}}}

${\displaystyle d\phi =\nabla \phi \cdot d{\vec {r}}}$

{\displaystyle {\begin{aligned}&\int _{\gamma }\nabla \phi ({\vec {r}})\cdot d{\vec {r}}\\&=\int _{\phi ({\vec {p}})}^{\phi ({\vec {q}})}d\phi ({\vec {r}})\end{aligned}}} （積分上下界轉換）

{\displaystyle {\begin{aligned}&=[\phi ]_{\phi ({\vec {p}})}^{\phi ({\vec {q}})}\\&=\phi ({\vec {q}})-\phi ({\vec {p}})\end{aligned}}}