lauantai 7. marraskuuta 2015

Derivative of determinant

An expression for the derivative of the determinant function is useful occasionally in mechanics (e.g. when solving hyperelastic models by the FEM). Derivation of the identity is, however, pretty annoying. Fortunately there is a trick you can employ:
$$\det(A+\epsilon B)=\det(A)\det(I+\epsilon A^{-1}B).$$Let $C=A^{-1}B$. Then
$$\det(I+\epsilon C)=\exp\log\det(I+\epsilon C) = \exp \mathrm{tr} \log(I+\epsilon C).$$Using the series definition of matrix logarithm
$$\log(I+\epsilon C) = \sum_{m=1}^\infty \frac{(-1)^{m+1}(\epsilon C)^m}{m}.$$Thus,
$$\frac{\mathrm{d}}{\mathrm{d} \epsilon} \det(I+\epsilon C) = \mathrm{tr}(\sum_{m=1}^\infty (-1)^{m+1}\epsilon^{m-1} C^m) \exp \mathrm{tr} \log(I+\epsilon C)$$implying
$$D_G(\det(A))B = \det(A) \mathrm{tr}(A^{-1}B) \det(I) =\det(A) \mathrm{tr}(A^{-1}B).$$What we have obtained is the Gateaux derivative of $\det(A)$ at $A$ into direction $B$. In this case the operator $D_G(\det(A))$ is linear (to see this, write $\mathrm{tr}(A^{-1}B)=A^{-T}:B$) and, hence, we have also obtained the Frechet derivative:
$$D_F(\det(A)) = \det(A)A^{-T}$$
Note that $\log(\det(A)) = \mathrm{tr}(\log(A))$ follows by considering the eigenvalues of $A$ (determinant is the product of eigenvalues) and $\log(A)$ (trace is the sum of eigenvalues).