How is the following formula true: $\frac{\partial |g|}{\partial g_{ij}}=|g|g_{ij}$, where $g$ is a metric and $|g|$ its determinant? This document says the following: 
If $g$ is a metric (which may be thought of as an $n\times n$ matrix, and $|g|$ is its determinant, then $$\frac{\partial |g|}{\partial g_{ij}}=|g|g_{ij}$$
I don't understand why this is. For instance, let $g$ be a diagonal matrix. Then $$\frac{\partial |g|}{\partial g_{11}}=g_{22}\dots g_{nn}$$ How is this equal to $|g|g_{11}=g_{11}^2g_{22}\dots g_{nn}$

Look closer: it said $\dfrac{\partial|g|}{\partial g_{ij}}=|g|g^{ij}$. The upper indices indicate the entry is of the inverse matrix. Going back to your diagonal example, $g^{ii}=\left(g_{ii}\right)^{-1}$.
