Let $\phi = \text{log}|PWP^T|$, where $P = J + XU^T$.
Except $W$ others are rectangular matrices. Further $W$ is positive definite.
I want to find the second partial derivative of $\phi$ with respect to $X$ and $W$. After referring some posts in the stack exchange my approach is as follows:
Let $Y = PWP^T$ and $dP = dXU^T$.
\begin{align*} d\phi & = \operatorname{tr}[Y^{-1}(dPWP^T + PWdP^T)]\\ &= \operatorname{tr}(Y^{-1}(dXU^TWP^T + PWUdX^T))\\ \Phi = \frac{d\phi}{dX} & = 2Y^{-1}PWU \end{align*}
\begin{align*} d\Phi & = 2(-Y^{-1}PdWP^TY^{-1}PWU + Y^{-1}PdWU)\\ \vec{d\Phi} &= 2(-U^TWP^TY^{-1}P \otimes Y^{-1}P + U^T \otimes Y^{-1}P)\vec{dW} \end{align*}
Hence the second partial derivative w.r.t $X$ and $W$ is given by $$ 2(-U^TWP^TY^{-1}P \otimes Y^{-1}P + U^T \otimes Y^{-1}P) $$
Is it the correct way to do?