# The derivative of det(X'A) when X is a non-square matrix

For a non-square matrix $X$ of size $n \times p$ ($n>p$) and another non-square matrix $A$ of size $p \times n$, what is the derivative of $\det(X^TA)$ w.r.t. $X$? i.e.,

$\frac{\partial\det(X^TA)}{\partial X}$

It'd be a matrix of size $n \times p$ while I got stuck in some intermediate steps of using chain rules.

Update: I think I got the solution. Thanks to AlexR and Bob.

Reference: The Matrix Cookbook; Section 2.1.2; Equation (45)

$\frac{\partial\det(AXB)}{\partial X} = \det(AXB){(X^{-1})}^T = \det(AXB){(X^T)}^{-1}$

This is, actually, a special case when A and B are non-singular matrices.

The more general form, according to matrix reference manual, is

$\frac{\partial\det(A^TXB)}{\partial X} = \frac{\partial\det(B^TX^TA)}{\partial X} = A\operatorname{adj}(A^TXB)^TB^T = A(\det(A^TXB)(A^TXB)^{-1})^TB^T = \det(A^TXB)A(B^TX^TA)^{-1}B^T$

When $B = B^T= I$

$\frac{\partial\det(X^TA)}{\partial X} = A\operatorname{adj}(A^TX)^T = A(\det(A^TX)(A^TX)^{-1})^T = \det(X^TA)A(X^TA)^{-1}$

• Did you find $\partial_X \det X$ already? If not, you can compute $\partial_X \log \det X$ by using $\det X = \prod_{i=1}^p \lambda_i$ where $X\in\mathbb R^{p\times p}$. Then use the generalisation of the logarithmic derivative trick to obtain what you're looking for. – AlexR May 28 '15 at 22:02
• @AlexR. Thanks for your suggestions first. However, $\det(X)$ is not meaningful given that $X$ is not a square matrix. – Will Yongxin Yang May 28 '15 at 22:29
• Note I write $\log \det : \mathbb R^{p\times p} \to \mathbb R$ wich is meaningful. – AlexR May 28 '15 at 22:30
• Hi AlexR. Sorry I don't really get the idea behind $\log\det$. Can you name a reference? Cheers! – Will Yongxin Yang May 28 '15 at 22:36
• It's used in Convex Optimisation. The matrix cookbook is a better source if you don't need to prove it. – AlexR May 28 '15 at 22:40

We know that $\frac{\partial\det(XA)}{\partial X}=\det(XA)(X^T)^{-1}$ (see The Matrix Cookbook, for example). Thus,
$\frac{\partial\det(X^TA)}{\partial X}=\det(XA)(X)^{-1}$.
• Hi Bob. Thanks for your answer first. I have noticed that a similar form in The Matrix Cookbook but I don't think it's that straightforward as $X^{-1}$ suggests that X is a square matrix. – Will Yongxin Yang May 28 '15 at 22:23