I have the following function $L=\mu_w^T\Sigma_w^{-1}\mu_w$ where both $\mu_w$ and $\Sigma_w$ are functions of a vector $w$. How do I differentiate this wrt. $w$.
$\Sigma$ is a positive definite symmetric matrix. Note that I already know how to get $\frac{\partial\Sigma}{\partial w}$ etc. The question is more about the functional form of the derivative.
We assume that $\mu$ is a vector in $\mathbb{R}^n$, $w$ is a vector in $\mathbb{R}^k$ and $\Sigma\in M_n$. Then $DL_w: h\in\mathbb{R}^k\rightarrow 2{\mu} ^T\Sigma^{-1}\dfrac{\partial\mu}{\partial w}h-{\mu}^T\Sigma^{-1}(\dfrac{\partial\Sigma}{\partial w}h)\Sigma^{-1}\mu$ and in other words: for every $i$, $\dfrac{\partial L}{\partial w_i}=2{\mu} ^T\Sigma^{-1}\dfrac{\partial\mu}{\partial w_i}-{\mu}^T\Sigma^{-1}(\dfrac{\partial\Sigma}{\partial w_i})\Sigma^{-1}\mu$.