## Jacobian 矩陣與行列式

$F:\mathbb{R}^n\to\mathbb{R}^m$ 為一向量函數。對於 $n$ 維實向量 $\mathbf{x}=(x_1,\ldots,x_n)^T$$F(\mathbf{x})$ 具有下列形式：

$F(\mathbf{x})=\begin{bmatrix} f_1(x_1,\ldots,x_n)\\ \vdots\\ f_m(x_1,\ldots,x_n) \end{bmatrix}$

$\begin{bmatrix} x\\ y \end{bmatrix}=\begin{bmatrix} X(r,\theta)\\ Y(r,\theta) \end{bmatrix}=\begin{bmatrix} r\cos\theta\\ r\sin\theta \end{bmatrix}$

$T(\mathbf{x})=A\mathbf{x}+\mathbf{b}$

Carl Gustav Jacob Jacobi (1804-1851) From Wikimedia

Jacobian 矩陣

$T(\mathbf{x})=A(\mathbf{x}-\mathbf{p})+F(\mathbf{p})$

$\displaystyle \lim_{\mathbf{x}\to\mathbf{p}}\frac{F(\mathbf{x})-F(\mathbf{p})-A(\mathbf{x}-\mathbf{p})}{\Vert\mathbf{x}-\mathbf{p}\Vert}=\mathbf{0}$

$\displaystyle \lim_{h\to 0}\frac{F(\mathbf{p}+h\mathbf{e}_j)-F(\mathbf{p})-A(h\mathbf{e}_j)}{h}=\mathbf{0},~~~j=1,\ldots,n$

$\displaystyle \lim_{h\to 0}\frac{F(\mathbf{p}+h\mathbf{e}_j)-F(\mathbf{p})}{h}=A\mathbf{e}_j$

$\displaystyle\frac{\partial F}{\partial x_j}(\mathbf{p})=\begin{bmatrix} \displaystyle\frac{\partial f_1}{\partial x_j}(\mathbf{p})\\[1em] \displaystyle\frac{\partial f_2}{\partial x_j}(\mathbf{p})\\ \vdots\\ \displaystyle\frac{\partial f_m}{\partial x_j}(\mathbf{p}) \end{bmatrix}$

$\displaystyle A=\begin{bmatrix} \displaystyle\frac{\partial f_1}{\partial x_1}(\mathbf{p})&\displaystyle\frac{\partial f_1}{\partial x_2}(\mathbf{p})&\cdots&\displaystyle\frac{\partial f_1}{\partial x_n}(\mathbf{p})\\[1em] \displaystyle\frac{\partial f_2}{\partial x_1}(\mathbf{p})&\displaystyle\frac{\partial f_2}{\partial x_2}(\mathbf{p})&\cdots&\displaystyle\frac{\partial f_2}{\partial x_n}(\mathbf{p})\\ \vdots&\vdots&\ddots&\vdots\\ \displaystyle\frac{\partial f_m}{\partial x_1}(\mathbf{p})&\displaystyle\frac{\partial f_m}{\partial x_2}(\mathbf{p})&\cdots&\displaystyle\frac{\partial f_m}{\partial x_n}(\mathbf{p}) \end{bmatrix}$

$T(\mathbf{x})=F(\mathbf{p})+J(\mathbf{p})(\mathbf{x}-\mathbf{p})$

$T(\mathbf{x})-T(\mathbf{p})=J(\mathbf{p})(\mathbf{x}-\mathbf{p})$

$J(r,\theta)=\begin{bmatrix} \displaystyle\frac{\partial x}{\partial r}&\displaystyle\frac{\partial x}{\partial \theta}\\[1em] \displaystyle\frac{\partial y}{\partial r}&\displaystyle\frac{\partial y}{\partial \theta} \end{bmatrix}=\begin{bmatrix} \displaystyle\frac{\partial(r\cos\theta)}{\partial r}&\displaystyle\frac{\partial(r\cos\theta)}{\partial \theta}\\[1em] \displaystyle\frac{\partial(r\sin\theta)}{\partial r}&\displaystyle\frac{\partial(r\sin\theta)}{\partial \theta} \end{bmatrix}=\left[\!\!\begin{array}{cr} \cos\theta&-r\sin\theta\\ \sin\theta&r\cos\theta \end{array}\!\!\right]$

$\mathbf{u}(t)=\begin{bmatrix} r(t)\\ \theta(t) \end{bmatrix}$ 是極座標平面上的一曲線，$\mathbf{x}(t)=\begin{bmatrix} x(t)\\ y(t) \end{bmatrix}$ 是卡氏座標平面上的映射曲線，使用鏈式法則 (chain rule)，$d\mathbf{x}/dt$$d\mathbf{u}/dt$ 具有下列關係：

$\displaystyle\frac{d\mathbf{x}}{dt}=\begin{bmatrix} \displaystyle\frac{dx}{dt}\\[1em] \displaystyle\frac{dy}{dt} \end{bmatrix}=\begin{bmatrix} \displaystyle\frac{\partial x}{\partial r}\displaystyle\frac{dr}{dt}+\displaystyle\frac{\partial x}{\partial\theta}\displaystyle\frac{d\theta}{dt}\\[1em] \displaystyle\frac{\partial y}{\partial r}\displaystyle\frac{dr}{dt}+\displaystyle\frac{\partial y}{\partial\theta}\displaystyle\frac{d\theta}{dt} \end{bmatrix}=\begin{bmatrix} \displaystyle\frac{\partial x}{\partial r}&\displaystyle\frac{\partial x}{\partial\theta}\\[1em] \displaystyle\frac{\partial y}{\partial r}&\displaystyle\frac{\partial y}{\partial\theta} \end{bmatrix}\begin{bmatrix} \displaystyle\frac{dr}{dt}\\[1em] \displaystyle\frac{d\theta}{dt} \end{bmatrix}=J(r,\theta)\displaystyle\frac{d\mathbf{u}}{dt}$

Jacobian 行列式

$F:\mathbb{R}^n\to\mathbb{R}^n$ 是一可導函數，則 Jacobian 是一 $n\times n$ 階矩陣，因此可計算行列式。下面我們討論 Jacobian 行列式的意義和用途。為方便說明，設 $n=2$，向量函數 $F$$\mathbf{u}=\begin{bmatrix} u\\ v \end{bmatrix}$ 映至 $\mathbf{x}=\begin{bmatrix} x\\ y \end{bmatrix}$，則 $F$ 的 Jacobian 行列式為

$\det J(u,v)=\begin{vmatrix} \displaystyle\frac{\partial x}{\partial u}&\displaystyle\frac{\partial x}{\partial v}\\[1em] \displaystyle\frac{\partial y}{\partial u}&\displaystyle\frac{\partial y}{\partial v} \end{vmatrix}=\displaystyle\frac{\partial x}{\partial u}\displaystyle\frac{\partial y}{\partial v}- \displaystyle\frac{\partial x}{\partial v}\displaystyle\frac{\partial y}{\partial u}$

$R$ 表示 $\begin{bmatrix} du\\ 0 \end{bmatrix}$$\begin{bmatrix} 0\\ dv \end{bmatrix}$ 所張的長方形，其中 $du$$dv$ 是微小量。若 $du$$dv$ 足夠接近 $0$，則 $F(R)=\{F(\mathbf{u})\vert\mathbf{u}\in R\}$ 近似下列向量所張的平行四邊形 (見“線性變換把面積伸縮了”)：

$J(u,v)\begin{bmatrix} du\\ 0 \end{bmatrix}=\begin{bmatrix} \displaystyle\frac{\partial x}{\partial u}&\displaystyle\frac{\partial x}{\partial v}\\[1em] \displaystyle\frac{\partial y}{\partial u}&\displaystyle\frac{\partial y}{\partial v} \end{bmatrix}\begin{bmatrix} du\\ 0 \end{bmatrix}=\begin{bmatrix} \displaystyle\frac{\partial x}{\partial u}du\\[1em] \displaystyle\frac{\partial y}{\partial u}du \end{bmatrix}$

$J(u,v)\begin{bmatrix} 0\\ dv \end{bmatrix}=\begin{bmatrix} \displaystyle\frac{\partial x}{\partial u}&\displaystyle\frac{\partial x}{\partial v}\\[1em] \displaystyle\frac{\partial y}{\partial u}&\displaystyle\frac{\partial y}{\partial v} \end{bmatrix}\begin{bmatrix} 0\\ dv \end{bmatrix}=\begin{bmatrix} \displaystyle\frac{\partial x}{\partial v}dv\\[1em] \displaystyle\frac{\partial y}{\partial v}dv \end{bmatrix}$

$dA$ 代表平行四邊形 $F(R)$ 的面積。因為二階行列式的行向量所張的平行四邊形面積等於行列式的絕對值 (見“行列式的運算公式與性質”)，

$dA=\begin{vmatrix}\det\begin{bmatrix} \displaystyle\frac{\partial x}{\partial u}du&\displaystyle\frac{\partial x}{\partial v}dv\\[1em] \displaystyle\frac{\partial y}{\partial u}du&\displaystyle\frac{\partial y}{\partial v}dv \end{bmatrix}\end{vmatrix}=\begin{vmatrix}\det\begin{bmatrix} \displaystyle\frac{\partial x}{\partial u}&\displaystyle\frac{\partial x}{\partial v}\\[1em] \displaystyle\frac{\partial y}{\partial u}&\displaystyle\frac{\partial y}{\partial v} \end{bmatrix}\end{vmatrix}dudv=\vert\det J(u,v)\vert dudv$

Jacobian 行列式最主要的應用在多重積分的換元積分法 (integration by substitution)。令 $f:\mathbb{R}^2\to\mathbb{R}$ 為一連續實函數，且 $x=X(u,v)$$y=Y(u,v)$ 是一對一可導函數。根據上述面積變化關係式，可推得下面的變數變換積分公式：

$\displaystyle\int_{F(R)}f(x,y)dxdy=\int_{R}f\left(X(u,v),Y(u,v)\right)\vert\det J(u,v)\vert dudv$

$r=\sqrt{x^2+y^2},~~~\cos\theta=\displaystyle\frac{x}{\sqrt{x^2+y^2}}$

$\cos\theta$$0\le\theta\le\pi/2$ 是一對一函數。Jacobian 行列式為

$\det J(u,v)=\left|\!\!\begin{array}{cr} \cos\theta&-r\sin\theta\\ \sin\theta&r\cos\theta \end{array}\!\!\right|=r\cos^2\theta+r\sin^2\theta=r$

$\displaystyle \int_{F(R)}(x^2+y^2)dxdy=\int_{R}r^2rdrd\theta=\int_{1}^{2}r^3dr\int_0^{\pi/2}d\theta=\displaystyle\frac{15\pi}{8}$

Jacobian 與 Hessian

$\displaystyle H(\mathbf{x})=\begin{bmatrix} \displaystyle\frac{\partial^2f}{\partial x_1\partial x_1}&\displaystyle\frac{\partial^2f}{\partial x_1\partial x_2}&\cdots&\displaystyle\frac{\partial^2f}{\partial x_1\partial x_n}\\[1em] \displaystyle\frac{\partial^2 f}{\partial x_2\partial x_1}&\displaystyle\frac{\partial^2 f}{\partial x_2\partial x_2}&\cdots&\displaystyle\frac{\partial^2 f}{\partial x_2\partial x_n}\\ \vdots&\vdots&\ddots&\vdots\\ \displaystyle\frac{\partial^2 f}{\partial x_n\partial x_1}&\displaystyle\frac{\partial^2f}{\partial x_n\partial x_2}&\cdots&\displaystyle\frac{\partial^2 f}{\partial x_n\partial x_n} \end{bmatrix}$

$f$$\mathbf{x}$ 的梯度 (gradient) $\nabla f(\mathbf{x})$ 定義為一 $n$ 維向量，其中第 $i$ 元是 $f$$x_i$ 的一次偏導數，即

$\displaystyle \nabla f(\mathbf{x})=\begin{bmatrix} \displaystyle\frac{\partial f}{\partial x_1}\\[1em] \displaystyle\frac{\partial f}{\partial x_2}\\ \vdots\\ \displaystyle\frac{\partial f}{\partial x_n} \end{bmatrix}$

$J(\mathbf{x})=\begin{bmatrix} \displaystyle\frac{\partial}{\partial x_1}\left(\frac{\partial f}{\partial x_1}\right)&\displaystyle\frac{\partial}{\partial x_2}\left(\frac{\partial f}{\partial x_1}\right)&\cdots&\displaystyle\frac{\partial}{\partial x_n}\left(\frac{\partial f}{\partial x_1}\right)\\[1em] \displaystyle\frac{\partial}{\partial x_1}\left(\frac{\partial f}{\partial x_2}\right)&\displaystyle\frac{\partial}{\partial x_2}\left(\frac{\partial f}{\partial x_2}\right)&\cdots&\displaystyle\frac{\partial}{\partial x_n}\left(\frac{\partial f}{\partial x_2}\right)\\ \vdots&\vdots&\ddots&\vdots\\ \displaystyle\frac{\partial}{\partial x_1}\left(\frac{\partial f}{\partial x_n}\right)&\displaystyle\frac{\partial}{\partial x_2}\left(\frac{\partial f}{\partial x_n}\right)&\cdots&\displaystyle\frac{\partial}{\partial x_n}\left(\frac{\partial f}{\partial x_n}\right) \end{bmatrix}=H(\mathbf{x})$

This entry was posted in 線性代數專欄, 應用之道 and tagged , , , , , , , , . Bookmark the permalink.

### 8 則回應給 Jacobian 矩陣與行列式

1. 黃顗融 說：

老師，jacobian行列式為轉換因子從幾何證明最多證到三維，那要如何證明推廣到n維依舊是轉換因子@@?

2. 黃顗融 說：

老師，我看了你上面的文章，所以是dxdydz…..這式子成立必須dx,dy,dz彼此間互相正交(因為才不會互相影響)，在不同座標系微分後有(dx,dy,dz)^T=A(du,dv,dt,)^T，(A為一矩陣)，將dx,dy,dz取出後視為向量再將各向量正交化後由上面文章知道dxdydz=|A|dudvdt而|A|即為Jacobian。
老師這樣想是對的嗎@@?

• ccjou 說：

我們不能說「dx,dy,dz彼此間互相正交」，dx,dy,dz是微小的純量，應該說$(dx,0,0)$$(0,dy,0)$$(0,0,dz)$三個向量彼此正交。請再仔細讀一遍上文 $dA$ 表達式的推導過程，$dA$ 代表微小長方形 $R$ 經線性變換 $J$ (Jacobian) 後的面積。

• 黃顗融 說：

老師 我不懂什麼是平行多面體，如果只是在二維跟三維可以用平行四邊形跟平行六面體的體積來解釋，可是四維以上後平行多面體的體積是什麼東西@@?