Variation of determinant of the metric tensor I have the metric tensor $g_{\mu\nu}$. I want to make the variation of $\sqrt{-g}$ where $g=detg_{\mu\nu}$.
How can I make this work? My attempt is the following:
$$\sqrt{-g}=\sqrt{-e^{Tr(log(g_{\mu\nu}))}}=\sqrt{-e^{-Tr(log(g^{\mu\nu}))}}$$ 
$$\rightarrow\delta\sqrt{-g}=\delta(\sqrt{-e^{-Tr(log(g^{\mu\nu}))})}=\delta(-e^{-\frac{1}{2}Tr(log(g^{\mu\nu}))})$$
$$=e^{-\frac{1}{2}Tr(log(g^{\mu\nu}))}\delta(-\frac{1}{2}Tr(log(g^{\mu\nu})))=-\frac{1}{2}\sqrt{-g}\delta g^{-1}Tr((log(g^{\mu\nu})))=$$
$$=-\frac{1}{2}\sqrt{-g}Tr(g_{\mu\nu}\delta g^{\mu\nu})=-\frac{1}{2}\sqrt{-g}\ g_{\mu\nu}\delta g^{\mu\nu}$$
But, there seems to be a problem of notation; I write $Tr(g_{\mu\nu}\delta g^{\mu\nu})$.
 A: I am assuming the final equality $-\sqrt{-g}g_{\mu\nu}\delta g^{\mu\nu}/2$ is a known result you are trying to check against your calculation of $-\sqrt{g}\ \text{tr}(g_{\mu\nu}\delta g^{\mu\nu})/2$.  If so, you have essentially arrived at the same result, but notice that the expression $g_{\mu\nu}\delta g^{\mu\nu}$ in your final equality is already a scalar, since there is an implied sum over repeated indices. Taking the trace of such a quantity is trivial since there is only one element. Actually, what you have in the last equality is already the trace that you probably intended since for a matrix product $g_{\mu\nu}\delta g^{\nu\rho}$ the trace is given by summing over the remaining free indices $\mu$ and $\rho$:
$$
\text{tr} \left(g_{\mu\nu}\delta g^{\nu\rho}\right) =  g_{\mu\nu}\delta g^{\nu\mu}=g_{\mu\nu}\delta g^{\mu\nu}
$$

I'll also add that there is an easier way to do the calculation in your question. Namely, you could use Jacobi's formula for invertible matrices, which gives that for an invertible matrix $A$:
$$
d \det A = \det A \ \text{tr}\left(A^{-1} dA\right) \ .
$$
In terms of the variation of the metric tensor this means you can quickly find that $\delta g = g \left(g^{\mu\nu}\delta g_{\mu\nu}\right)$, which lets you compute
$$
\delta\sqrt{-g} = -\frac{1}{2\sqrt{-g}}\delta g= \frac{1}{2}\frac{-g}{\sqrt{-g}}\left(g^{\mu\nu}\delta g_{\mu\nu}\right) = -\frac{1}{2}\sqrt{-g}\left(g_{\mu\nu}\delta g^{\mu\nu}\right)
$$
