# Derivative of $\log |AA^T|$ with respect to $A$

What is the derivative of $\log |AA^T|$ with respect to $A$, where $|A|$ denotes the determinant of $A$?

#### Solutions Collecting From Web of "Derivative of $\log |AA^T|$ with respect to $A$"

Let $f : \mathbb{R}^{m \times n} \to \mathbb{R}$ be defined by

$$f (X) = \log |X X^T|$$

The directional derivative of $f$ in the direction of $V \in \mathbb{R}^{m \times n}$ is

$$\begin{array}{rl} D_V f (X) &= \displaystyle\lim_{h \to 0} \frac{1}{h} \left( \log |(X + h V) (X + h V)^T| – \log |X X^T| \right)\\\\ &= \displaystyle\lim_{h \to 0} \frac{1}{h} \left( \log |X X^T + h V X^T + h X V^T + h^2 V V^T| – \log |X X^T| \right)\end{array}$$

If $X$ has full row rank, i.e., if $\operatorname{rank} (X) = m$, then $X X^T$ is invertible. Hence,

$$\begin{array}{rl} D_V f (X) &= \displaystyle\lim_{h \to 0} \frac{1}{h} \left( \log |X X^T + h V X^T + h X V^T + h^2 V V^T| – \log |X X^T| \right)\\\\ &= \displaystyle\lim_{h \to 0} \frac{1}{h} \left( \log |X X^T| + \log | I_m + h (X X^T)^{-1} \left( V X^T + X V^T + h V V^T \right)| – \log |X X^T| \right)\\\\ &= \displaystyle\lim_{h \to 0} \frac{1}{h} \, \log | I_m + h (X X^T)^{-1} \left( V X^T + X V^T + h V V^T \right)|\\\\ &= \displaystyle\lim_{h \to 0} \frac{1}{h} \, \log ( 1 + h \operatorname{tr} ((X X^T)^{-1} \left( V X^T + X V^T + h V V^T \right)))\\\\ &= \displaystyle\lim_{h \to 0} \operatorname{tr} ((X X^T)^{-1} \left( V X^T + X V^T + h V V^T \right))\\\\ &= \operatorname{tr} ((X X^T)^{-1} \left( V X^T + X V^T \right))\\\\ &= 2 \, \operatorname{tr} (X^T (X X^T)^{-1} V)\end{array}$$

Assume that $A\in M_{n,m}$ where $n\leq m$ and $rank(A)=n$ and let $f(A)=\log(\det(AA^T))$. Then $Df_A:H\rightarrow tr((AA^T)^{-1}(HA^T+AH^T))$ or, if $A$ is a derivable matrix function, then $f'(A)=tr((AA^T)^{-1}(A’A^T+AA’^T))$.

Hint 1:

$\partial \log\det(M)=trace(M^{-1} \partial M)$

Hint 2:

Use the chain rule.

I hope this helps. Please let us know if you couldn’t figure it out.