Derivative of the determinant of the metric I'm stuck in a part of my notes where they differentiate the Lagrangian density:
$$\mathcal{L}=-\frac{1}{4}\sqrt{-\det(g)}g^{\mu\nu}g^{\rho\sigma}F_{\mu\rho}F_{\nu\sigma}$$
with respect to the metric components $g_{\mu\nu}$. The notes just say that $\delta g^{-1}= -g^{-1}\delta g g^{-1}$ and $\delta \det(g)=\det(g)\operatorname{tr}(g^{-1}\delta g)$, and then skip all the calculations to arrive at:
$$\frac{\partial \mathcal{L}}{\partial g_{\mu\nu}}=\frac{\sqrt{-\det(g)}}{2}(F^{\mu\rho}{F^\nu}_\rho-\frac{1}{4}g^{\mu\nu}F^{\rho\sigma}F_{\rho\sigma})$$
I would like some clarifications on the notation of the $\delta g^{-1}$ and determinant things because I don't get what it means and I've been struggling to even start the calculation.
 A: The first claim comes from contracting the metric with its inverse and differentiating both sides.
$$
g_{mn} g^{nr} = \delta^r_m \\
\delta g_{mn} g^{nr} + g_{mn} \delta g^{nr} = 0 \\
g_{mn} \delta g^{nr} = -\delta g_{mn} g^{nr} \\
\delta g^{pr} = - g^{pm} \delta g_{mn} g^{nr} \quad (1)
$$
The second one is Jacobi's formula
$$
\delta \mathrm{det}(g) = \mathrm{det}(g) g^{ab} \delta g_{ab}. \quad (2)
$$
We are now ready to compute
$$
\delta \mathcal{L} = \frac{1}{4} \frac{\delta \mathrm{det}(g)}{2 \sqrt{-\mathrm{det}(g)}} g^{mn} g^{rs} F_{mr} F_{ns} + \frac{1}{4} \sqrt{-\mathrm{det}(g)} g^{ma} \delta g_{ab} g^{bn} g^{rs} F_{mr} F_{ns} + \frac{1}{4} \sqrt{-\mathrm{det}(g)} g^{mn} g^{ra} \delta g_{ab} g^{bs} F_{mr} F_{ns}
$$
where all derivatives of $g$ with upper indices have been rewritten using (1). Using (2) now leads to
$$
\delta \mathcal{L} = -\frac{1}{8} g^{ab} \delta g_{ab} \sqrt{-\mathrm{det}(g)} g^{mn} g^{rs} F_{mr} F_{ns} + \frac{1}{4} \sqrt{-\mathrm{det}(g)} g^{ma} \delta g_{ab} g^{bn} g^{rs} F_{mr} F_{ns} + \frac{1}{4} \sqrt{-\mathrm{det}(g)} g^{mn} g^{ra} \delta g_{ab} g^{bs} F_{mr} F_{ns}
$$
which can be recast into the form you want by raising and lowering indices.
