关于矩阵微商的定义都是建立在一个矩阵对一个标量微商的定义之上.
设$mathbf{A}$和$mathbf{B}$是$n imes m$矩阵,$mathbf{C}$是$m imes k$矩阵, $eta$是标量.
$mathbf{A}$和$eta$的偏微商定义为
egin{equation}label{eq1}
frac{partial mathbf{A}}{partial eta}=left[frac{partial a_{ij}}{partial eta}
ight],
end{equation}
由定义易知
egin{equation}label{eq2}
frac{partial }{partial eta}(mathbf A+mathbf B)=frac{partial mathbf A}{partial eta}+frac{partialmathbf B}{partial eta},
end{equation}
egin{equation}label{eq3}
frac{partial}{partialeta}({mathbf {AC}})=frac{partialmathbf A}{partial eta}mathbf C+mathbf Afrac{partial mathbf C}{partial eta}.
end{equation}
设$mathbf A$为$n$阶可逆方阵, $mathbf I$ 为$n$阶单位阵.
由$mathbf {AA}^{-1}=mathbf I$知
egin{equation}label{eq4}
frac{partial mathbf A^{-1}}{partialeta}=-mathbf A^{-1}frac{partial mathbf A}{partialeta}mathbf A^{-1}.
end{equation}
现在讨论对向量的微商.
设$mathbf x=[x_1,x_2,dots,x_n]^T$,其中$T$表示转置,$Q$为一标量,$Q$对$mathbf{x}$的微商定义为
egin{equation}label{eq5}
frac{partial Q}{partialmathbf x}=
egin{bmatrix}
frac{partial Q}{partial x_1}\ vdots \ frac{partial Q}{partial x_n}
end{bmatrix}
end{equation}
设$mathbf A$是$n imes n$数量矩阵,$Q=mathbf x^T mathbf A mathbf x$,考虑$dfrac{partial Q}{partialmathbf x}$.
先计算对标量$x_k$的微商.
egin{align*}
frac{partial Q}{partial x_k}
= frac{partial(mathbf x^T mathbf A mathbf x)}{partial x_k}
=frac{partialmathbf x^T}{partial x_k}(mathbf A mathbf x)+mathbf x^T mathbf Afrac{partialmathbf x}{partial x_k}
= mathbf e_k^T mathbf Amathbf x+mathbf x^T mathbf A mathbf e_k ,
end{align*}
其中
[
frac{partialmathbf x^T}{partial x_k}=[0,cdots,0,1,0,cdots,0]=mathbf e_k^T,
]
注意到$mathbf x^T mathbf A mathbf e_k$是一个标量,所以
[
mathbf x^T mathbf Amathbf e_k=(mathbf x^T mathbf A mathbf e_k)^T=mathbf e_k^T mathbf A^Tmathbf x,
]
因此
egin{equation}label{eq6}
frac{partial Q}{partial x_k}=mathbf e_k^T(mathbf A+mathbf A^T)mathbf x.
end{equation}
从而有
egin{equation}label{eq7}
frac{partial Q}{partialmathbf x}=
egin{bmatrix}
frac{partial Q}{partial x_1}\ vdots \ frac{partial Q}{partial x_n}
end{bmatrix}=
egin{bmatrix}
mathbf e_1^T(mathbf A+mathbf A^T)mathbf x\ vdots \ mathbf e_n^T(mathbf A+mathbf A^T)mathbf x
end{bmatrix}=
mathbf I(mathbf A+mathbf A^T)mathbf x=(mathbf A+mathbf A^T)mathbf x.
end{equation}
若$mathbf A$为$n$阶对称方阵,则进一步有
egin{equation}label{eq8}
frac{partial Q}{partial mathbf x}=2mathbf Amathbf x.
end{equation}