I am trying to understand why the identity
$$ d|X| = |X|\text{tr}(X^{-1}dX) $$
How can we mathematically prove this?
I am not sure how to do this, so I tried to verify this for a small example:
$$ X = \begin{bmatrix} x & y \\ z & w \end{bmatrix} $$
Step 1: Calculate $|X|$
$$ |X| = xw - yz $$
Step 2: Calculate $d|X|$
$$ d|X| = \frac{\partial |X|}{\partial x}dx + \frac{\partial |X|}{\partial y}dy + \frac{\partial |X|}{\partial z}dz + \frac{\partial |X|}{\partial w}dw $$
Calculate each partial derivative:
$$ \frac{\partial |X|}{\partial x} = w $$ $$ \frac{\partial |X|}{\partial y} = -z $$ $$ \frac{\partial |X|}{\partial z} = -y $$ $$ \frac{\partial |X|}{\partial w} = x $$
Substituting these back into theequation:
$$ d|X| = w\,dx - z\,dy - y\,dz + x\,dw $$
Step 3: Now, to verify $d|X| = |X|\text{tr}(X^{-1}dX)$:
Calculate $X^{-1}$
$$ X^{-1} = \frac{1}{xw-yz} \begin{bmatrix} w & -y \\ -z & x \end{bmatrix} $$
Step 4: Express $dX$
$$ dX = \begin{bmatrix} dx & dy \\ dz & dw \end{bmatrix} $$
Step 5: Calculate $X^{-1}dX$
$$ X^{-1}dX = \frac{1}{xw-yz} \begin{bmatrix} w & -y \\ -z & x \end{bmatrix} \begin{bmatrix} dx & dy \\ dz & dw \end{bmatrix} $$
$$ = \frac{1}{xw-yz} \begin{bmatrix} w\,dx - y\,dz & w\,dy - y\,dw \\ -z\,dx + x\,dz & -z\,dy + x\,dw \end{bmatrix} $$
Step 6: Calculate $\text{tr}(X^{-1}dX)$
$$ \text{tr}(X^{-1}dX) = \frac{1}{xw-yz} (w\,dx - y\,dz - z\,dy + x\,dw) $$
Step 7: Calculate $|X|\text{tr}(X^{-1}dX)$
$$ |X|\text{tr}(X^{-1}dX) = (xw-yz) \cdot \frac{1}{xw-yz} (w\,dx - y\,dz - z\,dy + x\,dw) $$
$$ = w\,dx - y\,dz - z\,dy + x\,dw $$
After a lot of manipulation, I hope I have done this correctly. But can someone please help me prove this?