Derivative of the determinant with respect to the vector

459 Views Asked by At

There is a vector $\boldsymbol{v}=[x, y, z]^T$ and a matrix $\boldsymbol{A}(x,y,z)$.

How is the derivative of a determinant of a matrix with respect to a vector calculated, i.e.:

$\frac{d|\boldsymbol{A}|}{d\boldsymbol{v}}=?$

Here are some calculations from Mathcad Prime. Here $A$ and $M$ are a matrix-function and a matrix of arbitrary numbers, and $v$ is a parameter vector. And $q$ is the function to be differentiated with respect to the vector $v$.

enter image description here

I differentiate the function $q$ with respect to each of the parameters $x,y,z$. I need to find a union operation that "packs" all in the function $f(trace(\cdot),\otimes,\partial_v A)$, I think, it probably includes the Kronecker product, tensor, etc. That's what I need to find if it exists.

EDIT №2:

enter image description here

2

There are 2 best solutions below

2
On BEST ANSWER

$ \def\a{\alpha} \def\p{\partial} \def\A{A^{-1}} \def\LR#1{\left(#1\right)} \def\trace#1{\operatorname{Tr}\LR{#1}} \def\qiq{\quad\implies\quad} \def\grad#1#2{\frac{\p #1}{\p #2}} \def\dgrad#1#2{\frac{d #1}{d #2}} \def\m#1{\left[\begin{array}{r}#1\end{array}\right]} \def\c#1{\color{red}{#1}} \def\vc#1{\operatorname{vec}\LR{#1}} \def\CLR#1{\c{\LR{#1}}} \def\gradLR#1#2{\LR{\grad{#1}{#2}}} \def\dgradLR#1#2{\LR{\frac{d #1}{d #2}}} \def\fracLR#1#2{\LR{\frac{#1}{#2}}} $Jacobi's formula for the determinant can be summarized as $$\eqalign{ \a &= \det(A) \qiq \dgrad{\a}{t}= \a\trace{\A\dgradLR{A}{t}} \\ }$$ where $t$ is some scalar parameter.

Sequentially setting $t$ to the components of the $v$ vector leads to the desired result $$\large\eqalign{ \grad{\a}{v} &= \a \pmatrix{ \trace{\A \gradLR{A}{x}} \\ \trace{\A \gradLR{A}{y}} \\ \trace{\A \gradLR{A}{z}} \\ } \\\\ }$$

Update

In response to the comments, let $$\eqalign{ &a=\vc A,\quad b=\vc{A^{-T}} \\ &J=\grad{a}{v}\qquad\big\{{\rm Jacobian\:of\:}a\big\} \\ }$$ then employing Jacobi's formula in differential form yields $$\eqalign{ d\a &= \a\;A^{-T}:dA \\ &= \a\;b:da \\ &= \a\;b:J\,dv \\ &= \a\;J^Tb:dv \\ \grad{\a}{v} &= \a\;J^Tb \\ }$$ where a colon denotes the Frobenius product, i.e. $$\eqalign{ F:G &= \sum_{i=1}^m\sum_{j=1}^n F_{ij}G_{ij} \;=\; \trace{F^TG} \\ G:G &= \|G\|^2_F \\ }$$ This is also called the double-dot or double contraction product.
When applied to vectors $(n=\tt1)$ it reduces to the standard dot product.

The properties of the underlying trace function allow the terms in a Frobenius product to be rearranged in many different ways, e.g. $$\eqalign{ F:G &= G:F \\ F:G &= F^T:G^T \\ H:\LR{FG} &= \LR{HG^T}:F \\&= \LR{F^TH}:G \\ }$$ As with the Hadamard product, the matrix on each side of the multiplication symbol $(:)$ must have exactly the same dimensions.

11
On

Jacobi's formula for the derivative of the determinant is usually stated as follows:

Theorem. For a path $t\mapsto A(t)$ of matrices, one has \begin{equation} \partial_t\det A(t)=\mathrm{Tr}\left(\mathrm{adj}(A(t))\,\dot{A}(t)\right). \end{equation}

This Wikipedia page explains where this formula comes from. To use this result for your question, consider your parameter-dependent matrix as a matrix-valued function $A:\mathbb{R}^3\to M_{n\times n}(\mathbb{C})$. The derivative $\partial_{v}A$ is the directional derivative of this function, so for any point $p\in\mathbb{R}^3$ we want to compute \begin{equation} \partial_v\det A(p)=\partial_t\Bigr|_{t=0}\det A(p+t\,v). \end{equation} Let $B(t)=A(p+t\,v)$ and we can apply Jacobi's formula to get \begin{equation} \partial_v\det A(p)=\partial_t\Bigr|_{t=0}\det B(t)=\mathrm{Tr}\left(\mathrm{adj}(B(0))\,\partial_t\Bigr|_{t=0}B(t)\right)=\mathrm{Tr}\left(\mathrm{adj}(A)\,\partial_vA\right)(p). \end{equation}

A more geometric way to think about this: "$\det$" is a function from the set of $n$ by $n$ matrices to the complex (or real) numbers. Jacobi's formula is telling us what the differential of this function is, namely \begin{equation} \begin{split} \mathrm{d}(\mathrm{det})_A:T_AM_{n\times n}(\mathbb{C})&\to\mathbb{C}\\ \dot{A}&\mapsto\mathrm{Tr}\left(\mathrm{adj}(A)\,\dot{A}\right). \end{split} \end{equation} What you want to compute is the differential of $\det$ composed with some function $A:\mathbb{R}^3\to M_{n\times n}(\mathbb{C})$, and the differential of the composition is the composition of the differentials \begin{equation} \mathrm{d}\big((x,y,z)\mapsto\det A(x,y,z)\big)_p(v)=\mathrm{d}(\mathrm{det})_{A(p)}\left(\partial_vA\right)=\mathrm{Tr}\left(\mathrm{adj}(A)\,\partial_vA\right)(p). \end{equation}

For example, assume that $A(x,y,z)$ is the simple matrix-valued function $$A(x,y,z)=\begin{pmatrix} x & 0 & 0 \\ 0 & y & 0\\ 0& 0 & z\end{pmatrix}.$$ Then the determinant is $\det A(x,y,z)= x y z$. Let's fix the vector $v=(a,b,c)$, then the derivative of the determinant is $\partial_v\left(\det A(x,y,z)\right)=ayz+bxz+cxy$. We can check that this agrees with the formula above: since $$\partial_vA(x,y,z)= \begin{pmatrix} a & 0 & \\ 0 & b & 0\\ 0& 0 & c\end{pmatrix}$$ we get \begin{equation} \begin{split}\partial_v&\left(\det A(x,y,z)\right)=\det (A)\,\mathrm{Tr}\left(A^{-1}\partial_vA\right)=\\ &=xyz\,\mathrm{Tr}\left( \begin{pmatrix} x^{-1} & 0 & 0 \\ 0 & y^{-1} & 0\\ 0& 0 & z^{-1}\end{pmatrix}\begin{pmatrix} a & 0 & \\ 0 & b & 0\\ 0& 0 & c\end{pmatrix} \right)=ayz+bxz+cxy. \end{split} \end{equation}