I need to take the derivative with respect to p of an inverse of the sum of two symmetric matrices, where p is part of a constant in front of one of the matrices. That is, I have:
$$\left[\frac{1}{p^2}A+B\right]^{-1}$$
where $A$ is symmetric and $B$ is a diagonal matrix. I would like to be able to get the $\frac{1}{p^2}$ outside the inverse of the sum, similar to the Sherman-Morrison decomposition (which doesn't work because $B$ is a diagonal matrix).