# A closed-form formula for the derivative of the matrix absolute value


Denote by $$\psym$$ the space of symmetric positive-definite $$n \times n$$ matrices, and by $$\GLp$$ the group of real $$n \times n$$ invertible matrices with positive determinant.

Let $$P:\GLp \to \psym$$ map each matrix $$A$$ to its unique positive factor in the polar decomposition, i.e. $$P(A)=\sqrt{A^TA}$$.

I am trying to find a nice "closed-form algebraic expression" for the differential $$dP_A$$, where $$A \in \psym$$ is symmetric positive-definite. (So I am fine with using positive square roots, but not integral formulas or vectorization operations like here or here).

In other words: I want to find a formula for $$dP_A(B)$$, where $$A$$ is positive-definite and $$B$$ is an arbitrary matrix. Here is a partial result:

$$dP_A(B)=\operatorname{sym}(B) \iff B \in V_P:=\{B\in M_n \, | \, BP + P B^T=B^T P+ P B\}$$.

Proof: Differentiating $$P^2=A^TA$$ we get $$\dot PP + P \dot P = B^TA + A^TB.$$ Since we assumed $$A \in \psym$$, we have $$A=P$$ at time $$t=0$$, so our equation becomes

$$\dot PP + P \dot P = B^TP + PB,$$

and $$\dot P$$ is the unique solution of this equation. Now it is easy to verify that $$\dot P=\operatorname{sym}(B)$$ is a solution if and only if:

$$\frac{B+B^T}{2}P + P \frac{B+B^T}{2} = P B + B^T P \iff BP + P B^T=B^T P+ P B \iff B \in V_p$$

Note that the presence of the "symmetrization operator" is natural here; $$B \to dP_A(B)$$ is something which eats arbitrary matrices and returns symmetric matrices. (We also have the special case where $$B$$ is symmetric, and then $$dP_A(B)=B$$; this is also immediate from the fact that $$P_{\psym}=Id_{\psym}$$ and $$B \in T_A{\psym}$$).

The result mentioned above does not cover all the cases, since in general $$V_p \subsetneq M_n$$.

Unfortunately, I couldn't come up with an expression for the general case. Since $$dP_A$$ is linear, and we always have $$\sym \subseteq V_P$$, it suffices to consider skew-symmetric matrices $$B$$ as inputs.

However, I don't see a clear pattern fur such matrices. In the simplest case of $$n=2$$, and

$$A=\begin{pmatrix} \sigma_1 & 0 \\\ 0 & \sigma_2 \end{pmatrix}, B=\begin{pmatrix} 0 & a \\\ -a & 0 \end{pmatrix}, \, \, \text{ where } \, \, \sigma_1 \ge \sigma_2$$ a short calculation shows that

$$\dot P=dP_A(B)=\begin{pmatrix} 0 & a\frac{\sigma_1-\sigma_2}{\sigma_1+\sigma_2} \\\ a\frac{\sigma_1-\sigma_2}{\sigma_1+\sigma_2} & 0 \end{pmatrix}=\frac{\sigma_1-\sigma_2}{\sigma_1+\sigma_2}\begin{pmatrix} 0 & a \\\ a & 0 \end{pmatrix}.$$

So, the map $$B \to dP_A(B)$$, considered as a map $$\text{skew} \to \sym$$ is of the form $$\begin{pmatrix} 0 & a \\\ -a & 0 \end{pmatrix} \to c(A)\begin{pmatrix} 0 & a \\\ a & 0 \end{pmatrix}$$, where $$C(A)=\frac{\sigma_1-\sigma_2}{\sigma_1+\sigma_2}=\sqrt{1-4\frac{\det A}{(\text{tr}A)^2}}$$ is a constant depending only on $$A$$.

I don't see an immediate way to write $$\begin{pmatrix} 0 & a \\\ -a & 0 \end{pmatrix} \to \begin{pmatrix} 0 & a \\\ a & 0 \end{pmatrix}$$ in "algebraic way", i.e. involving only matrix addition, multiplication, and square roots.