Suppose we have a non-singular matrix-valued function of a scalar defined element-wise $$V:\mathbb{R}\rightarrow \mathbb{R}^{n\times n}\qquad V(\gamma)=\left\{v_{ij}(\gamma) \right\}$$ and a map $$Q:\mathbb{R}^{n\times n} \rightarrow \mathbb{R}\qquad Q(X) = y^T X y.$$
What is the derivative of the composition $$\frac{\partial}{\partial \gamma}\left( Q\circ V^{-1}\right)?$$
Note: My specific case involves the matrix $V = \gamma G + I $, where $G$ is symmetric positive definite, and comes up in calculating the score function for variance components of a linear mixed model.
The gradient of the scalar function is just $$\eqalign{ G &= \frac{\partial V}{\partial\gamma} \cr }$$ Knowing this quantity, you can calculate the differential and gradient of $Q$ as follows
$$\eqalign{ Q &= y^TV^{-1}y \cr\cr dQ &= y^TdV^{-1}y \cr &= -y^TV^{-1}\,dV\,V^{-1}y \cr &= -y^TV^{-1}GV^{-1}y\,d\gamma \cr\cr \frac{\partial Q}{\partial\gamma} &= -y^TV^{-1}GV^{-1}y \cr\cr }$$