Let A and B be $m\times p$ and $n\times q$ matrices, respectively. Define the $mn \times mn$ matrix C as $$C=AA' \otimes BB'$$ with $A'$ denoting the transpose of $A$. Consider the scalar-valued function $f(C)= \log|C|$ with $|\cdot|$ denoting the matrix determinant. I am looking for the derivatives $\partial f(C)/\partial A$ and $\partial f(C)/\partial B$.
Any idea?
$ \def\l{f}\def\p{\partial} \def\LR#1{\left(#1\right)} \def\BR#1{\Big(#1\Big)} \def\trace#1{\operatorname{Tr}\LR{#1}} \def\rank#1{\operatorname{rank}\LR{#1}} \def\qiq{\quad\implies\quad} \def\grad#1#2{\frac{\p #1}{\p #2}} \def\c#1{\color{red}{#1}} \def\CLR#1{\c{\LR{#1}}} \def\fracLR#1#2{\LR{\frac{#1}{#2}}} $First, introduce the Frobenius product, which can be thought of as a product notation for the trace $$\eqalign{ A:B &= \sum_{i=1}^m\sum_{j=1}^n A_{ij}B_{ij} \;=\; \trace{A\cdot B^T} \\ A:A &= \|A\|^2_F \\ }$$ Then consider various combinations of Kronecker, Frobenius and Matrix products $$\eqalign{ &\LR{A\otimes B}\,\cdot\LR{E\otimes F} = \LR{A\cdot E}\otimes\LR{B\,\cdot F} \\ &\LR{A\otimes B}:\LR{E\otimes F} = \LR{A:E}\otimes\LR{B:F} = \LR{A:E}\LR{B:F} \\ &\LR{A\otimes B}^+ = \LR{A^+\otimes B^+} \\ &\LR{A\otimes B}^T \,=\, \LR{A^T\otimes B^T} \\ &A:B = B:A = A^T:B^T \\ &C:\LR{A\cdot B} = \LR{C\cdot B^T}:A = \LR{A^T\cdot C}:B \\ }$$ In the expressions above, the Matrix product has been shown explicitly, but it's usually omitted $$AB=A\cdot B$$ One final formula is for the rank of a matrix in terms of its pseudoinverse $$\eqalign{ \rank B &= \trace{B^+B} = B^+:B^T \\ &= B^T\LR{BB^T}^{-1}:{B^T} \\ &= \LR{BB^T}^{-1}:\LR{BB^T} \\ \\ }$$
Use Jacobi's formula to calculate the gradient of the function with respect to $A$ $$\eqalign{ C &= AA^T\otimes BB^T \;=\; C^T \\ dC &= \LR{A\;dA^T+dA\;A^T}\otimes BB^T \\ \\ \l &= \log(\det(C)) \\ d\l &= d\trace{\log(C)} \\ &= C^{-1}:dC \qquad\qquad \big\{{\rm Jacobi}\big\} \\ &= \LR{\LR{AA^T}^{-1}\otimes\LR{BB^T}^{-1}} :\BR{\LR{A\;dA^T+dA\;A^T}\otimes BB^T} \\ &= \rank{B}\;\LR{AA^T}^{-1}:\LR{A\;dA^T+dA\;A^T} \\ &= 2\rank{B}\;\BR{\LR{AA^T}^{-1}A}:dA \\ &= 2n\,\LR{A^+}^T:dA \\ \\ \grad{\l}{A} &= 2n\,\LR{A^+}^T \\ }$$ The calculation for the gradient wrt $B$ is exactly the same $$\eqalign{ \grad{\l}{B} &= 2m\,\LR{B^+}^T \qquad\qquad\qquad\qquad\qquad \qquad\qquad\qquad\qquad \quad \\ }$$
Update
On second thought, it might be simpler to start from the relationship $$\det(C) = {\det\!\LR{AA^T}^n}\;{\det\!\LR{BB^T}^m}$$