「
偏微分 」重定向至此。關於含有未知函數及其偏導數的方程,請見「
偏微分方程 」。
偏微分 (英語:partial derivative ,在嚴謹數學體系中亦稱為偏導數 [ 註 1] )在數學 中是指對一個多元函數 (多變量函數)中的某一個變數 進行微分 ,同時保持其他變數恆定不變的運算[ 註 2] 。
偏導數在向量分析 、微分幾何 、物理學 及機器學習 等領域中皆有極其廣泛且重要的應用。[ 1]
對於函數
f
{\displaystyle f}
,其關於變量
x
{\displaystyle x}
的偏導數通常記作
f
x
{\displaystyle f_{x}}
、
f
x
′
{\displaystyle f_{x}'}
、
∂
x
f
{\displaystyle \partial _{x}f}
或
∂
f
∂
x
{\displaystyle {\frac {\partial f}{\partial x}}}
。其中的偏導數符號 「
∂
{\displaystyle \partial }
」是全導數符號「
d
{\displaystyle \mathrm {d} }
」的變體,由阿德里安-馬里·勒讓德 於1786年首次引入,[ 2] 後經卡爾·雅可比 於1841年重新引入後,才獲得數學界的普遍接受。[ 3]
定義
二元函數
給定二元函數
f
(
x
,
y
)
{\displaystyle f(x,y)}
,其對變數
x
{\displaystyle x}
與
y
{\displaystyle y}
的偏微分分別定義為以下極限 :
∂
f
∂
x
(
x
,
y
)
=
lim
h
→
0
f
(
x
+
h
,
y
)
−
f
(
x
,
y
)
h
,
∂
f
∂
y
(
x
,
y
)
=
lim
h
→
0
f
(
x
,
y
+
h
)
−
f
(
x
,
y
)
h
.
{\displaystyle {\begin{aligned}{\frac {\partial f}{\partial x}}(x,y)&=\lim _{h\to 0}{\frac {f(x+h,y)-f(x,y)}{h}},\\[0.3em]{\frac {\partial f}{\partial y}}(x,y)&=\lim _{h\to 0}{\frac {f(x,y+h)-f(x,y)}{h}}.\end{aligned}}}
在實務計算時,求對某個變數的偏微分,只需將其他變數視為常數 ,並直接套用一般一元函數的求導法則。
以二元函數
f
(
x
,
y
)
=
x
2
+
x
y
+
y
2
{\displaystyle f(x,y)=x^{2}+xy+y^{2}}
為例:
對
x
{\displaystyle x}
求偏微分 :將
y
{\displaystyle y}
視為常數(此時
x
y
{\displaystyle xy}
項視為
x
{\displaystyle x}
的常數倍、
y
2
{\displaystyle y^{2}}
項視為純常數),微分得:
∂
f
∂
x
(
x
,
y
)
=
2
x
+
y
.
{\displaystyle {\frac {\partial f}{\partial x}}(x,y)=2x+y.}
對
y
{\displaystyle y}
求偏微分 :將
x
{\displaystyle x}
視為常數(此時
x
2
{\displaystyle x^{2}}
項視為純常數、
x
y
{\displaystyle xy}
項視為
y
{\displaystyle y}
的常數倍),微分得:
∂
f
∂
y
(
x
,
y
)
=
x
+
2
y
.
{\displaystyle {\frac {\partial f}{\partial y}}(x,y)=x+2y.}
多元函數
給定
n
{\displaystyle n}
維歐幾里得空間
R
n
{\displaystyle \mathbb {R} ^{n}}
的標準基底 為
e
1
,
…
,
e
n
{\displaystyle \mathbf {e} _{1},\dots ,\mathbf {e} _{n}}
,
R
n
{\displaystyle \mathbb {R} ^{n}}
內的一個開集
U
{\displaystyle U}
,函數
f
:
U
→
R
{\displaystyle f:U\to \mathbb {R} }
,以及
U
{\displaystyle U}
中一點
A
=
(
a
1
,
…
,
a
n
)
=
∑
i
=
1
n
a
i
e
i
{\displaystyle \mathbf {A} =(a_{1},\dots ,a_{n})=\sum _{i=1}^{n}a_{i}\mathbf {e} _{i}}
。定義
f
{\displaystyle f}
在點
A
{\displaystyle \mathbf {A} }
關於第
i
{\displaystyle i}
個變數
x
i
{\displaystyle x_{i}}
的偏微分為:[ 4] [ 5]
∂
f
∂
x
i
(
A
)
=
lim
h
→
0
f
(
A
+
h
e
i
)
−
f
(
A
)
h
=
lim
h
→
0
f
(
a
1
,
…
,
a
i
−
1
,
a
i
+
h
,
a
i
+
1
,
…
,
a
n
)
−
f
(
a
1
,
…
,
a
n
)
h
.
{\displaystyle {\frac {\partial f}{\partial x_{i}}}(\mathbf {A} )=\lim _{h\to 0}{\frac {f(\mathbf {A} +h\mathbf {e} _{i})-f(\mathbf {A} )}{h}}=\lim _{h\to 0}{\frac {f(a_{1},\dots ,a_{i-1},a_{i}+h,a_{i+1},\dots ,a_{n})-f(a_{1},\dots ,a_{n})}{h}}.}
在上述的差商中,除了
x
i
{\displaystyle x_{i}}
以外的所有變數都是固定的。這種固定值的選擇決定了一個一元函數:
F
(
x
i
)
=
f
(
X
)
,
X
=
x
i
e
i
+
∑
j
≠
i
a
j
e
j
.
{\displaystyle F(x_{i})=f(\mathbf {X} ),\quad \mathbf {X} =x_{i}\mathbf {e} _{i}+\sum _{j\neq i}a_{j}\mathbf {e} _{j}.}
根據定義,此一元函數在
x
i
=
a
i
{\displaystyle x_{i}=a_{i}}
處的微分即為原多元函數的偏微分:
d
F
d
x
i
(
a
i
)
=
∂
f
∂
x
i
(
A
)
.
{\displaystyle {\frac {\mathrm {d} F}{\mathrm {d} x_{i}}}(a_{i})={\frac {\partial f}{\partial x_{i}}}(\mathbf {A} ).}
這個表達式說明了多元函數偏微分的計算,可以簡化為一般一元函數微分的計算。
記法
偏微分符號「
∂
{\displaystyle \partial }
」在中文中通常直接讀作「偏 」;在英文中標準讀作「partial 」或「partial d 」,口語中亦常因其外形稱為「curly d 」、「del 」或「der 」。[ 6]
以三元函數
g
(
x
,
y
,
z
)
{\displaystyle g(x,y,z)}
為例。其對
x
{\displaystyle x}
的一階偏微分記為:
∂
g
∂
x
=
g
x
=
∂
x
g
.
{\displaystyle {\frac {\partial g}{\partial x}}=g_{x}=\partial _{x}g.}
對
x
{\displaystyle x}
的二階偏微分記為:
∂
2
g
∂
x
2
=
g
x
x
=
∂
x
x
g
.
{\displaystyle {\frac {\partial ^{2}g}{\partial x^{2}}}=g_{xx}=\partial _{xx}g.}
先對
x
{\displaystyle x}
進行偏微分,再對
y
{\displaystyle y}
進行偏微分的二階混合偏微分記為:
∂
2
g
∂
y
∂
x
=
∂
∂
y
(
∂
g
∂
x
)
=
g
x
y
=
∂
y
x
g
.
{\displaystyle {\frac {\partial ^{2}g}{\partial y\,\partial x}}={\frac {\partial }{\partial y}}\left({\frac {\partial g}{\partial x}}\right)=g_{xy}=\partial _{yx}g.}
對
x
{\displaystyle x}
偏微分
i
{\displaystyle i}
次,對
y
{\displaystyle y}
偏微分
j
{\displaystyle j}
次,對
z
{\displaystyle z}
偏微分
k
{\displaystyle k}
次的高階混合偏微分則記為:
∂
i
+
j
+
k
g
∂
x
i
∂
y
j
∂
z
k
=
g
(
i
,
j
,
k
)
.
{\displaystyle {\frac {\partial ^{i+j+k}g}{\partial x^{i}\,\partial y^{j}\,\partial z^{k}}}=g^{(i,j,k)}.}
不過有些變數 間可能互相有關,此時需要指明哪些變數是固定的。在諸如統計力學 與熱力學的領域中,
g
{\displaystyle g}
對
x
{\displaystyle x}
的偏微分通常記為:[ 7]
(
∂
g
∂
x
)
y
,
z
.
{\displaystyle \left({\frac {\partial g}{\partial x}}\right)_{y,z}.}
相關概念
梯度與Nabla算子
給定
n
{\displaystyle n}
維歐幾里得空間
R
n
{\displaystyle \mathbb {R} ^{n}}
內的一個開集
U
{\displaystyle U}
,函數
f
:
U
→
R
{\displaystyle f:U\to \mathbb {R} }
,以及
U
{\displaystyle U}
中一點
A
{\displaystyle \mathbf {A} }
。若
f
{\displaystyle f}
在點
A
{\displaystyle \mathbf {A} }
上關於每一個變數
x
i
{\displaystyle x_{i}}
的偏微分皆存在,我們定義如下向量 :
∇
f
(
A
)
=
∑
i
=
1
n
∂
f
∂
x
i
(
A
)
e
i
,
{\displaystyle \nabla f(\mathbf {A} )=\sum _{i=1}^{n}{\frac {\partial f}{\partial x_{i}}}(\mathbf {A} )\mathbf {e} _{i},}
此向量被稱為
f
{\displaystyle f}
在點
A
{\displaystyle \mathbf {A} }
的梯度 。若對於定義域中的每一個點
a
{\displaystyle \mathbf {a} }
,
∇
f
(
a
)
{\displaystyle \nabla f(\mathbf {a} )}
皆存在,則梯度形成了一個向量值函數
∇
f
:
U
→
R
n
{\displaystyle \nabla f:U\to \mathbb {R} ^{n}}
,並決定了一個向量場 。
一個常見的符號濫用 是在三維歐幾里得空間
R
3
{\displaystyle \mathbb {R} ^{3}}
中,利用單位向量
i
^
,
j
^
,
k
^
{\displaystyle \mathbf {\hat {i}} ,\mathbf {\hat {j}} ,\mathbf {\hat {k}} }
將Nabla算子 (
∇
{\displaystyle \nabla }
)形式化地定義為:
∇
=
∂
∂
x
i
^
+
∂
∂
y
j
^
+
∂
∂
z
k
^
,
{\displaystyle \nabla ={\frac {\partial }{\partial x}}\mathbf {\hat {i}} +{\frac {\partial }{\partial y}}\mathbf {\hat {j}} +{\frac {\partial }{\partial z}}\mathbf {\hat {k}} ,}
或者更一般地,對於
n
{\displaystyle n}
維歐幾里得空間
R
n
{\displaystyle \mathbb {R} ^{n}}
,將其標準基底 記為
e
1
,
…
,
e
n
{\displaystyle \mathbf {e} _{1},\dots ,\mathbf {e} _{n}}
,可定義Nabla算子為:
∇
=
∑
i
=
1
n
∂
∂
x
i
e
i
=
∂
∂
x
1
e
1
+
∂
∂
x
2
e
2
+
⋯
+
∂
∂
x
n
e
n
.
{\displaystyle \nabla =\sum _{i=1}^{n}{\frac {\partial }{\partial x_{i}}}\mathbf {e} _{i}={\frac {\partial }{\partial x_{1}}}\mathbf {e} _{1}+{\frac {\partial }{\partial x_{2}}}\mathbf {e} _{2}+\dots +{\frac {\partial }{\partial x_{n}}}\mathbf {e} _{n}.}
方向導數
給定
n
{\displaystyle n}
維歐幾里得空間
R
n
{\displaystyle \mathbb {R} ^{n}}
內的一個開集
U
{\displaystyle U}
,函數
f
:
U
→
R
{\displaystyle f:U\to \mathbb {R} }
,點
A
∈
U
{\displaystyle \mathbf {A} \in U}
,以及非零向量
v
∈
R
n
{\displaystyle \mathbf {v} \in \mathbb {R} ^{n}}
。若函數
f
v
:
R
→
R
,
h
↦
f
(
A
+
h
v
)
{\displaystyle f_{\mathbf {v} }:\mathbb {R} \to \mathbb {R} ,\ h\mapsto f(\mathbf {A} +h\mathbf {v} )}
對
h
{\displaystyle h}
的微分在
h
=
0
{\displaystyle h=0}
時存在,則定義
f
{\displaystyle f}
在點
A
{\displaystyle \mathbf {A} }
沿向量
v
{\displaystyle \mathbf {v} }
的方向導數為:
D
v
f
(
A
)
=
d
f
v
d
h
|
h
=
0
=
lim
h
→
0
f
(
A
+
h
v
)
−
f
(
A
)
h
.
{\displaystyle D_{\mathbf {v} }f(\mathbf {A} )=\left.{\frac {\mathrm {d} f_{\mathbf {v} }}{\mathrm {d} h}}\right|_{h=0}=\lim _{h\to 0}{\frac {f(\mathbf {A} +h\mathbf {v} )-f(\mathbf {A} )}{h}}.}
可以看出
f
{\displaystyle f}
在點
A
{\displaystyle \mathbf {A} }
關於
x
i
{\displaystyle x_{i}}
的偏導數,只是
v
{\displaystyle \mathbf {v} }
取標準基底
e
i
{\displaystyle \mathbf {e} _{i}}
的特例,換句話說,
∂
f
∂
x
i
(
A
)
=
D
e
i
f
(
A
)
.
{\displaystyle {\frac {\partial f}{\partial x_{i}}}(\mathbf {A} )=D_{\mathbf {e} _{i}}f(\mathbf {A} ).}
性質
連續性與可微性
給定函數
f
:
U
→
R
{\displaystyle f:U\to \mathbb {R} }
及點
A
∈
U
{\displaystyle \mathbf {A} \in U}
,即使函數在點
A
{\displaystyle \mathbf {A} }
上所有的偏微分均存在(亦即梯度
∇
f
(
A
)
{\displaystyle \nabla f(\mathbf {A} )}
存在),該函數在此點仍不一定連續 。[ 8]
然而,若所有的偏微分在點
A
{\displaystyle \mathbf {A} }
的一個鄰域 內均存在且連續 ,則
f
{\displaystyle f}
在該鄰域內完全可微(全導數存在),且其全導數亦連續。在這種情況下,我們稱
f
{\displaystyle f}
為一個連續可微函數(
C
1
{\displaystyle C^{1}}
函數)。
高階偏導數與對稱性
給定函數
f
:
U
→
R
{\displaystyle f:U\to \mathbb {R} }
,偏微分
∂
x
i
f
{\displaystyle \partial _{x_{i}}f}
本身可視為定義在
U
{\displaystyle U}
內的新函數,並可對其再次求偏導數。如果函數
f
{\displaystyle f}
的所有混合二階偏導數在某點(或集合)上均連續,我們便稱
f
{\displaystyle f}
在該點(或集合)上為一個
C
2
{\displaystyle C^{2}}
函數。
對於
C
2
{\displaystyle C^{2}}
函數,根據克萊羅定理 (Clairaut's theorem,又稱史瓦茲定理),二階混合偏導數的求導順序可以互相交換:[ 9]
∂
2
f
∂
x
i
∂
x
j
=
∂
2
f
∂
x
j
∂
x
i
.
{\displaystyle {\frac {\partial ^{2}f}{\partial x_{i}\partial x_{j}}}={\frac {\partial ^{2}f}{\partial x_{j}\partial x_{i}}}.}
示例
z
=
h
(
x
,
y
)
=
x
2
+
x
y
+
y
2
{\displaystyle z=h(x,y)=x^{2}+xy+y^{2}}
的函數圖像。欲求函數在點
(
1
,
1
)
{\displaystyle (1,1)}
關於
x
{\displaystyle x}
的偏導數,其對應的切線與
x
O
z
{\displaystyle xOz}
平面平行。
此為上圖在固定
y
=
1
{\displaystyle y=1}
時的截面曲線圖像。
假設
h
{\displaystyle h}
是一個多元函數。例如:
h
(
x
,
y
)
=
x
2
+
x
y
+
y
2
.
{\displaystyle h(x,y)=x^{2}+xy+y^{2}.}
因為曲面
z
=
h
(
x
,
y
)
{\displaystyle z=h(x,y)}
上的每一點都有無窮多條切線 ,描述這種函數的導數 相當困難。偏導數就是選擇其中一條切線,並求出它的斜率 。通常,最感興趣的是垂直於
y
{\displaystyle y}
軸(平行 於
x
O
z
{\displaystyle xOz}
平面 )的切線,以及垂直於
x
{\displaystyle x}
軸(平行於
y
O
z
{\displaystyle yOz}
平面)的切線。[ 10]
一種求出這些切線的好辦法是把其他變數視為常數。例如,欲求出以上的函數在點
(
1
,
1
)
{\displaystyle (1,1)}
的與
x
O
z
{\displaystyle xOz}
平面平行的切線。右圖中顯示了函數的圖像以及這個平面。左圖中顯示了函數在平面
y
=
1
{\displaystyle y=1}
上是什麼樣的。我們把變數
y
{\displaystyle y}
視為常數,通過對方程求導,我們可以發現
h
{\displaystyle h}
在點
(
x
,
y
)
{\displaystyle (x,y)}
的導數,記為:
∂
h
∂
x
=
2
x
+
y
.
{\displaystyle {\frac {\partial h}{\partial x}}=2x+y.}
於是在點
(
1
,
1
)
{\displaystyle (1,1)}
的
x
O
z
{\displaystyle xOz}
平面平行的切線的斜率是3。
∂
h
∂
x
=
3.
{\displaystyle {\frac {\partial h}{\partial x}}=3.}
在點
(
1
,
1
)
{\displaystyle (1,1)}
,或稱「
h
{\displaystyle h}
在
(
1
,
1
)
{\displaystyle (1,1)}
的關於
x
{\displaystyle x}
的偏導數是3」。
圓錐體積與其高度和半徑有關
再來考慮一個圓錐 的體積
V
{\displaystyle V}
。其與高度
h
{\displaystyle h}
和半徑
r
{\displaystyle r}
有以下的關係:
V
(
r
,
h
)
=
π
r
2
h
3
.
{\displaystyle V(r,h)={\frac {\pi r^{2}h}{3}}.}
而
V
{\displaystyle V}
關於
r
{\displaystyle r}
的偏微分,與
V
{\displaystyle V}
關於
h
{\displaystyle h}
的偏微分分別為:
∂
V
∂
r
=
2
π
r
h
3
,
∂
V
∂
h
=
π
r
2
3
.
{\displaystyle {\frac {\partial V}{\partial r}}={\frac {2\pi rh}{3}},\quad {\frac {\partial V}{\partial h}}={\frac {\pi r^{2}}{3}}.}
兩式分別描述了「高度固定而半徑變化」時,與「半徑固定而高度變化」時,圓錐體積的變化率。
當半徑
r
{\displaystyle r}
與高度
h
{\displaystyle h}
同時發生微小變化時,
V
{\displaystyle V}
的全微分 (英語:total differential )定義為:
d
V
=
∂
V
∂
r
d
r
+
∂
V
∂
h
d
h
=
2
π
r
h
3
d
r
+
π
r
2
3
d
h
.
{\displaystyle \mathrm {d} V={\frac {\partial V}{\partial r}}\mathrm {d} r+{\frac {\partial V}{\partial h}}\mathrm {d} h={\frac {2\pi rh}{3}}\mathrm {d} r+{\frac {\pi r^{2}}{3}}\mathrm {d} h.}
若變數之間存在依賴關係(例如圓錐在變形過程中保持固定的高寬比
k
=
h
r
{\displaystyle k={\tfrac {h}{r}}}
,即
h
=
k
r
{\displaystyle h=kr}
),則
V
{\displaystyle V}
關於
r
{\displaystyle r}
的變化率應使用多變數連鎖律 計算,此時稱為
V
{\displaystyle V}
關於
r
{\displaystyle r}
的全導數 (英語:total derivative ):
d
V
d
r
=
∂
V
∂
r
+
∂
V
∂
h
d
h
d
r
=
2
π
r
h
3
+
π
r
2
3
⋅
k
.
{\displaystyle {\frac {\mathrm {d} V}{\mathrm {d} r}}={\frac {\partial V}{\partial r}}+{\frac {\partial V}{\partial h}}{\frac {\mathrm {d} h}{\mathrm {d} r}}={\frac {2\pi rh}{3}}+{\frac {\pi r^{2}}{3}}\cdot k.}
將
h
=
k
r
{\displaystyle h=kr}
代入化簡後可得:
d
V
d
r
=
2
π
r
(
k
r
)
3
+
k
π
r
2
3
=
k
π
r
2
.
{\displaystyle {\frac {\mathrm {d} V}{\mathrm {d} r}}={\frac {2\pi r(kr)}{3}}+{\frac {k\pi r^{2}}{3}}=k\pi r^{2}.}
同理,若將
r
{\displaystyle r}
表示為
h
{\displaystyle h}
的函數,即
r
(
h
)
=
1
k
h
⟹
d
r
d
h
=
1
k
,
{\displaystyle r(h)={\frac {1}{k}}h\implies {\frac {\mathrm {d} r}{\mathrm {d} h}}={\frac {1}{k}},}
則
V
{\displaystyle V}
關於
h
{\displaystyle h}
的全導數為:
d
V
d
h
=
∂
V
∂
h
+
∂
V
∂
r
d
r
d
h
=
π
r
2
3
+
(
2
π
r
h
3
)
(
1
k
)
=
π
r
2
3
+
2
π
r
(
k
r
)
3
k
=
π
r
2
.
{\displaystyle {\frac {\mathrm {d} V}{\mathrm {d} h}}={\frac {\partial V}{\partial h}}+{\frac {\partial V}{\partial r}}{\frac {\mathrm {d} r}{\mathrm {d} h}}={\frac {\pi r^{2}}{3}}+\left({\frac {2\pi rh}{3}}\right)\left({\frac {1}{k}}\right)={\frac {\pi r^{2}}{3}}+{\frac {2\pi r(kr)}{3k}}=\pi r^{2}.}
含有未知函數偏導數的方程稱為偏微分方程 ,它在物理 、工程學及其他應用科學中有著廣泛的應用。
在圓錐體積的例子中,梯度向量為
∇
V
=
(
∂
V
∂
r
,
∂
V
∂
h
)
=
(
2
3
π
r
h
,
1
3
π
r
2
)
{\displaystyle \nabla V=\left({\frac {\partial V}{\partial r}},{\frac {\partial V}{\partial h}}\right)=\left({\frac {2}{3}}\pi rh,{\frac {1}{3}}\pi r^{2}\right)}
。
參考文獻
^ Goodfellow, Ian; Bengio, Yoshua; Courville, Aaron. Deep Learning. MIT Press. 2016: 199–205. ISBN 978-0262035613.
^ Legendre, A.-M. Mémoire sur l'intégration des équations aux différences partielles. Histoire de l'Académie Royale des Sciences. 1786: 7–37.
^ Jacobi, C. G. J. De determinantibus functionalibus. Journal für die reine und angewandte Mathematik. 1841, 22 (4): 319–359. doi:10.1515/crll.1841.22.319 .
^ Spivak, Michael. Calculus on Manifolds: A Modern Approach to Classical Theorems of Advanced Calculus. Westview Press. 1965: 15–16. ISBN 978-0805390216.
^ Rudin, Walter. Principles of Mathematical Analysis 3rd. McGraw-Hill. 1976: 211–212. ISBN 978-0070542358.
^ Higham, Nicholas J. Handbook of Writing for the Mathematical Sciences 2nd. SIAM. 1998: 312. ISBN 978-0-898714-20-3.
^ Callen, Herbert B. Thermodynamics and an Introduction to Thermostatistics 2nd. John Wiley & Sons. 1985: 35–37. ISBN 978-0471862567.
^ Stewart, James. Calculus: Early Transcendentals 8th. Cengage Learning. 2015: 921–923. ISBN 978-1285741550.
^ Marsden, Jerrold E.; Tromba, Anthony. Vector Calculus 6th. W. H. Freeman. 2012: 129–130. ISBN 978-1429215084.
^ Thomas, George Brinton; Finney, Ross L. Calculus and Analytic Geometry 8th. Reading, Mass.: Addison-Wesley. 1992: 833–840. ISBN 978-0-201-52929-6.
注釋
參見