This artilce looks at the process of deriving the variation of the metric determinant, which will be useful for deriving the Einstein equations from a variatioanl approach, in the next article Einstein-Hilbert action.

##### Matrix determinants and trace

Let us consider a matrix from a general form

Then **the trace of this matrix**, as for any square matrix, is **the sum of the elements on the main diagonal** (the diagonal from the upper left to the lower right), so

Trace(A) = tr(A)=a_{0} + a_{1}

so that

If we now consider** the exponential matrix e ^{A} **as:

then the **determinant of this matrix**, defined as the product of the elements on the main diagonal can be expressed as:

so that finally we can write

If we now define B = e^{A }

Taking the differential of both sides,

##### Metric determinant

If we now relate this last result to the metric g_{αβ}, we set B=g_{αβ}, B^{-1}=g^{αβ} and det(B)=g leading to

From which, applying to √-g, we get:

We can still write this equation in a slightly different style.

We know that the metric and its inverse are related in the following way

which leads to, applying the Leibniz rule:

So we finally arrive at the final expression for the variation of the metric, which we will use in the variational approach of General Relativity

You can watch the live demonstration of the previous result in this excellent video tutorial from Robert Davie