## Exercise $1$:

Question $1$: Show that if $\nabla$ and $\tilde{\nabla}$ are two different covariant derivatives on the spacetime manifold and $\omega$ is some cotangent dual field then \begin{eqnarray} \nabla_{\mu}\omega_{\nu}=\tilde{\nabla}\omega_{\nu}-C_{\mu\nu}^{\gamma}\omega_{\gamma}.\nonumber \end{eqnarray} Question $2$: By using the torsion free condition show that $C_{\mu\nu}^{\gamma}=C_{\nu\mu}^{\gamma}$.
Question $3$: By demanding that the inner product of two vectors $v^{\mu}$ and $w^{\mu}$ is invariant under parallel transport show that the metric must be covariantly constant.
Question $4$: Determine the form of the tensor $C_{\mu\nu}^{\gamma}$ in terms of the metric $g_{\mu\nu}$.
Question $5$: By noting that the action of $\nabla_a\nabla_b-\nabla_b\nabla_a$ on tangent dual vectors is equivalent to the action of a tensor of type (1,3) determine the Riemann curvature tensor $R_{abc}^d$ in terms of the Christoffel symbols $\Gamma_{ab}^{c}$.

## Solution $1$:

Question $1$

The covariant derivative acting on scalars must be consistent with tangent vectors being directional derivatives. Indeed, for all $f\in {\cal F}$ and $t^{\mu}\in V_p$ we must have
\begin{eqnarray}
t^{\mu}\nabla_{\mu} f=t(f)\equiv t^{\mu}\partial_{\mu}f.
\end{eqnarray}
In other words, if $\nabla$ and $\tilde{\nabla}$ be two covariant derivative operators, then their action on scalar functions must coincide, viz
\begin{eqnarray}
t^{\mu}\nabla_{\mu} f=t^{\mu}\tilde{\nabla}_{\mu} f=t(f).
\end{eqnarray}
We compute now the difference $\tilde{\nabla}_{\mu} (f\omega_{\nu})-{\nabla}_{\mu} (f\omega_{\nu})$ where $\omega$ is some cotangent dual vector. We have
\begin{eqnarray}
\tilde{\nabla}_{\mu} (f\omega_{\nu})-{\nabla}_{\mu} (f\omega_{\nu})&=&\tilde{\nabla}_{\mu}f.\omega_{\nu}+f\tilde{\nabla}_{\mu}\omega_{\nu}-\nabla_{\mu}f.\omega_{\nu}-f\nabla_{\mu}\omega_{\nu}\nonumber\\
&=&f(\tilde{\nabla}_{\mu}\omega_{\nu}-\nabla_{\mu}\omega_{\nu}).\label{100}
\end{eqnarray}
We use without proof the following result. Let $\omega_{\nu}^{'}$ be the value of the cotangent dual vector $\omega_{\nu}$ at a nearby point $p^{'}$, i.e. $\omega_{\nu}^{'}-\omega_{\nu}$ is zero at $p$. Since the cotangent dual vector $\omega_{\nu}$ is a smooth function on the manifold, then for each $p^{'}\in M$, there must exist smooth functions $f_{(\alpha)}$ which vanish at the point $p$ and cotangent dual vectors $\mu_{\nu}^{(\alpha)}$ such that
\begin{eqnarray}
\omega_{\nu}^{'}-\omega_{\nu}=\sum_{\alpha}f_{(\alpha)}\mu_{\nu}^{(\alpha)}.
\end{eqnarray}
We compute immediately
\begin{eqnarray}
\tilde{\nabla}_{\mu}(\omega_{\nu}^{'}-\omega_{\nu})-{\nabla}_{\mu}(\omega_{\nu}^{'}-\omega_{\nu})=\sum_{\alpha}f_{(\alpha)}(\tilde{\nabla}_{\mu}\mu_{\nu}^{(\alpha)}-{\nabla}_{\mu}\mu_{\nu}^{(\alpha)}).
\end{eqnarray}
This is $0$ since by assumption $f_{(\alpha)}$ vanishes at $p$. Hence we get the result
\begin{eqnarray}
\tilde{\nabla}_{\mu}\omega_{\nu}^{'}-\nabla_{\mu}\omega_{\nu}^{'}=\tilde{\nabla}_{\mu}\omega_{\nu}-\nabla_{\mu}\omega_{\nu}.
\end{eqnarray}
In other words, the difference $\tilde{\nabla}_{\mu}\omega_{\nu}-\nabla_{\mu}\omega_{\nu}$ depends only on the value of $\omega_{\nu}$ at the point $p$ although both  $\tilde{\nabla}_{\mu}\omega_{\nu}$ and $\nabla_{\mu}\omega_{\nu}$ depend on how $\omega_{\nu}$ changes as we go away from the point $p$ since they are derivatives. Putting this differently we say that the operator  $\tilde{\nabla}_{\mu}-\nabla_{\mu}$ is a linear map which takes cotangent dual vectors at a point $p$ into tensors, of type $(0,2)$, at $p$ and not into tensor fields defined in a neighborhood of $p$. We write
\begin{eqnarray}
{\nabla}_{\mu}\omega_{\nu}=\tilde{\nabla}_{\mu}\omega_{\nu}-C^{\gamma}~_{\mu\nu}\omega_{\gamma}.\label{104}
\end{eqnarray}
The tensor $C^{\gamma}~_{\mu\nu}$ stands for the map  $\tilde{\nabla}_{\mu}-\nabla_{\mu}$ and it is clearly a tensor of type $(1,2)$. By setting $\omega_{\mu}=\nabla_{\mu}f=\tilde{\nabla}_{\mu}f$ we get ${\nabla}_{\mu}\nabla_{\nu}f=\tilde{\nabla}_{\mu}\tilde{\nabla}_{\nu}f-C^{\gamma}~_{\mu\nu}\nabla_{\gamma}f$.

Question $2$

By employing now the torsion free condition $\nabla_{\mu}\nabla_{\nu} f=\nabla_{\nu}\nabla_{\mu} f$ we get immediately
\begin{eqnarray}
C^{\gamma}~_{\mu\nu}=C^{\gamma}~_{\nu\mu}.
\end{eqnarray}

Question $3$

Let $C$ be a curve with a tangent vector $t^{\mu}$.  Let $v^{\mu}$ be some tangent vector defined at each point on the curve. The vector $v^{\mu}$ is parallelly transported along the curve $C$ iff
\begin{eqnarray}
t^{\mu}\nabla_{\mu}v^{\nu}|_{\rm curve}=0.
\end{eqnarray}
If $t$ is the parameter along the curve $C$ then $t^{\mu}=dx^{\mu}/dt$ are the components of the vector $t^{\mu}$ in the coordinate basis. The parallel transport condition  reads explicitly
\begin{eqnarray}
\frac{dv^{\nu}}{dt}+\Gamma^{\nu}~_{\mu\lambda}t^{\mu}v^{\lambda}=0.\label{am}
\end{eqnarray}
By demanding that the inner product of two vectors $v^{\mu}$ and $w^{\mu}$ is invariant under parallel transport we obtain, for all curves and all vectors,  the condition
\begin{eqnarray}
t^{\mu}\nabla_{\mu}(g_{\alpha\beta}v^{\alpha}w^{\beta})=0\Rightarrow \nabla_{\mu} g_{\alpha\beta}=0.
\end{eqnarray}
Thus given a metric $g_{\mu\nu}$ on a manifold $M$ the most natural covariant derivative operator is the one under which the metric is covariantly  constant.

Question $4$:

There exists a unique covariant derivative operator $\nabla_{\mu}$ which satisfies $\nabla_{\mu}g_{\alpha\beta}=0$. The proof goes as follows. We know that $\nabla_{\mu}g_{\alpha \beta}$ is given by (from question $1$)
\begin{eqnarray}
\nabla_{\mu} g_{\alpha \beta}=\tilde{\nabla}_{\mu}g_{\alpha \beta}-C^{\gamma}~_{\mu \alpha}g_{\gamma\beta}-C^{\gamma}~_{\mu \beta}g_{\alpha \gamma}.
\end{eqnarray}
By imposing  $\nabla_{\mu}g_{\alpha \beta}=0$ we get
\begin{eqnarray}
\tilde{\nabla}_{\mu} g_{\alpha \beta}=C^{\gamma}~_{\mu \alpha}g_{\gamma\beta}+C^{\gamma}~_{\mu \beta}g_{\alpha \gamma}.
\end{eqnarray}
Equivalently
\begin{eqnarray}
\tilde{\nabla}_{\alpha}g_{\mu \beta}=C^{\gamma}~_{\alpha \mu}g_{\gamma\beta}+C^{\gamma}~_{\alpha \beta}g_{\mu \gamma}.
\end{eqnarray}
\begin{eqnarray}
\tilde{\nabla}_{\beta}g_{\mu \alpha}=C^{\gamma}~_{\mu \beta}g_{\gamma\alpha }+C^{\gamma}~_{\alpha \beta}g_{\mu \gamma}.
\end{eqnarray}
Immediately, we conclude that
\begin{eqnarray}
\tilde{\nabla}_{\mu}g_{\alpha \beta}+\tilde{\nabla}_{\alpha}g_{\mu \beta}-\tilde{\nabla}_{\beta}g_{\mu \alpha}=2C^{\gamma}~_{\mu \alpha}g_{\gamma\beta}.
\end{eqnarray}
In other words,
\begin{eqnarray}
C^{\gamma}~_{\mu \alpha}=\frac{1}{2}g^{\gamma\beta}(\tilde{\nabla}_{\mu}g_{\alpha\beta}+\tilde{\nabla}_{\alpha}g_{\mu \beta}-\tilde{\nabla}_{\beta}g_{\mu \alpha}).
\end{eqnarray}
This choice of $C^{\gamma}~_{\mu\alpha}$ which solves $\nabla_{\mu}g_{\alpha\beta}=0$ is unique. In other words, the corresponding covariant derivative operator is unique.

The most important case corresponds to the choice $\tilde{\nabla}_a=\partial_a$ for which case $C^c~_{ab}$ is denoted $\Gamma^c~_{ab}$ and is called the Christoffel symbol.

Question $5$:

Since the action of $\nabla_a\nabla_b-\nabla_b\nabla_a$ on tangent dual vectors is equivalent to the action of a tensor of type $(1,3)$. Thus we can write
\begin{eqnarray}
(\nabla_a\nabla_b-\nabla_b\nabla_a)\omega_c=R_{abc}~^d\omega_d.
\end{eqnarray}
The tensor $R_{abc}~^d$ is precisely the  Riemann curvature tensor. We compute explicitly

\begin{eqnarray}
\nabla_a\nabla_b\omega_c&=&\nabla_a(\partial_b\omega_c-\Gamma^d~_{bc}\omega_d)\nonumber\\
&=&\partial_a(\partial_b\omega_c-\Gamma^d~_{bc}\omega_d)-\Gamma^e~_{ab}(\partial_e\omega_c-\Gamma^d~_{ec}\omega_d)-\Gamma^e~_{ac}(\partial_b\omega_e-\Gamma^d~_{be}\omega_d)\nonumber\\
&=&\partial_a\partial_b\omega_c-\partial_a\Gamma^d~_{bc}.\omega_d-\Gamma^d~_{bc}\partial_a\omega_d-\Gamma^e~_{ab}\partial_e\omega_c+\Gamma^e~_{ab}\Gamma^d~_{ec}\omega_d-\Gamma^e~_{ac}\partial_b\omega_e+\Gamma^e~_{ac}\Gamma^d~_{be}\omega_d.\nonumber\\
\end{eqnarray}
Thus
\begin{eqnarray}
(\nabla_a\nabla_b-\nabla_b\nabla_a)\omega_c
&=&\bigg(\partial_b\Gamma^d~_{ac}-\partial_a\Gamma^d~_{bc}+\Gamma^e~_{ac}\Gamma^d~_{be}-\Gamma^a~_{bc}\Gamma^d~_{ae}\bigg)\omega_d.
\end{eqnarray}
We get then the components
\begin{eqnarray}
R_{abc}~^d
&=&\partial_b\Gamma^d~_{ac}-\partial_a\Gamma^d~_{bc}+\Gamma^e~_{ac}\Gamma^d~_{be}-\Gamma^e~_{bc}\Gamma^d~_{ae}.
\end{eqnarray}

## Exercise $2$:

Show that $dV=\sqrt{-g}d^4x$ is a scalar quantity under diffeomorphisms.

## Solution $2$:

Let us recall the familiar Levi-Civita symbol in $n$ dimensions defined by
\begin{eqnarray}
\tilde{\epsilon}_{\mu_1...\mu_n}&=&+1~{\rm even}~{\rm permutation}\nonumber\\
&=&-1~{\rm odd}~~{\rm permutation}\nonumber\\
&=&~~0~{\rm otherwise}.
\end{eqnarray}
This is a symbol and not a tensor since it does not change under coordinate transformations. The determinant of a matrix $M$ can be given by the formula
\begin{eqnarray}
\tilde{\epsilon}_{\nu_1^{}...\nu_n^{}}{\rm det} M&=&\tilde{\epsilon}_{\mu_1^{}...\mu_n^{}}M^{\mu_1^{}}~_{\nu_1^{}}...M^{\mu_n^{}}~_{\nu_n^{}}.
\end{eqnarray}
By choosing $M^{\mu}~_{\nu^{}}=\partial x^{\mu}/\partial y^{\nu^{}}$ we get the transformation law
\begin{eqnarray}
\tilde{\epsilon}_{\nu_1^{}...\nu_n^{}}&=&{\rm det}\frac{\partial y^{}}{\partial x}~ \tilde{\epsilon}_{\mu_1^{}...\mu_n^{}}\frac{\partial x^{\mu_1}}{\partial y^{\nu_1^{}}}...\frac{\partial x^{\mu_n}}{\partial y^{\nu_n^{}}}.
\end{eqnarray}
In other words $\tilde{\epsilon}_{\mu_1^{}...\mu_n^{}}$ is not a tensor because of the determinant appearing in this equation. This is an example of a tensor density. Another example of a tensor density is ${\rm det} g$. Indeed, from the tensor transformation law of the metric $g^{'}_{\alpha\beta}=g_{\mu\nu}(\partial x^{\mu}/\partial y^{\alpha})( \partial x^{\nu}/\partial y^{\beta})$ we can show in a straightforward way that
\begin{eqnarray}
{\rm det} g^{'}&=&({\rm det}\frac{\partial y^{}}{\partial x})^{-2}~ {\rm det} g.
\end{eqnarray}
The actual Levi-Civita tensor can then be defined by
\begin{eqnarray}
\epsilon_{\mu_1...\mu_n}=\sqrt{{\rm det} g^{}}~\tilde{\epsilon}_{\mu_1...\mu_n}.
\end{eqnarray}
Next under a coordinate transformation $x\longrightarrow y$ the volume element transforms as
\begin{eqnarray}
d^nx\longrightarrow d^ny={\rm det}\frac{\partial y}{\partial x}~d^nx.\label{ele}
\end{eqnarray}
In other words the volume element transforms as a tensor density and not as a tensor. We verify this important point in our language as follows. We write
\begin{eqnarray}
d^nx&=&dx^0\wedge dx^1\wedge ...\wedge dx^{n-1}\nonumber\\
&=&\frac{1}{n!}\tilde{\epsilon}_{\mu_1...\mu_n}dx^{\mu_1}\wedge ...\wedge dx^{\mu_n}.\label{sdf}
\end{eqnarray}
Recall that a differential $p-$form is a $(0,p)$ tensor which is completely antisymmetric. For example scalars are $0-$forms and dual cotangent vectors are $1-$forms. The  Levi-Civita tensor $\epsilon_{\mu_1...\mu_n}$ is a $4-$form. The differentials $dx^{\mu}$ appearing in the second line of equation  (\ref{sdf}) are $1-$forms and hence under a coordinate transformation $x\longrightarrow y$ we have $dx^{\mu}\longrightarrow dy^{\mu}=dx^{\nu}\partial y^{\mu}/\partial x^{\nu}$.  By using this  transformation law we can immediately show that $dx^n$ transforms to $d^ny$ exactly as in equation (\ref{ele}).

It is not difficult to see now that an invariant volume element can be given by the $n-$form defined by the equation
\begin{eqnarray}
dV=\sqrt{{\rm det} g}~ d^nx.
\end{eqnarray}
We can show that
\begin{eqnarray}
dV&=&\frac{1}{n!}\sqrt{{\rm det} g}~\tilde{\epsilon}_{\mu_1...\mu_n}dx^{\mu_1}\wedge ...\wedge dx^{\mu_n}\nonumber\\
&=&\frac{1}{n!}{\epsilon}_{\mu_1...\mu_n}dx^{\mu_1}\wedge ...\wedge dx^{\mu_n}\nonumber\\
&=&{\epsilon}_{\mu_1...\mu_n}dx^{\mu_1}\otimes ...\otimes dx^{\mu_n}\nonumber\\
&=&\epsilon.
\end{eqnarray}
In other words the  invariant volume element is precisely the  Levi-Civita tensor. In the case of Lorentzian signature we replace ${\rm det} g$ with  $-{\rm det} g$.

## Exercise $3$:

- Derive equation (1) and then derive the vacuum Einstein’s equations (2).
- Add matter fields to the Hilbert-Einstein action and derive the Einstein’s equations (3).
- Determine the energy-momentum tensor $T_{\mu\nu}$.
- Calculate the energy-momentum tensor for scalar and electromagnetic fields.
- Calculate the energy-momentum tensor for the cosmological constant and determine the corresponding form of the Einstein’s equations.

## Solution $3$:

We compute
\begin{eqnarray}
\delta S
&=&\int d^n x\delta \sqrt{-{\rm det} g}~g^{\mu\nu}R_{\mu\nu}+\int d^n x \sqrt{-{\rm det} g}~\delta g^{\mu\nu}R_{\mu\nu}+\int d^n x \sqrt{-{\rm det} g}~g^{\mu\nu}\delta R_{\mu\nu}.\nonumber\\
\end{eqnarray}
We have
\begin{eqnarray}
\delta R_{\mu\nu}&=&\delta R_{\mu\rho\nu}~^{\rho}\nonumber\\
&=&\partial_{\rho}\delta \Gamma^{\rho}~_{\mu\nu}-\partial_{\mu}\delta\Gamma^{\rho}~_{\rho\nu}+\delta (\Gamma^{\lambda}~_{\mu\nu}\Gamma^{\rho}~_{\rho\lambda}-\Gamma^{\lambda}~_{\rho\nu}\Gamma^{\rho}~_{\mu\lambda})\nonumber\\
&=&(\nabla_{\rho}\delta \Gamma^{\rho}~_{\mu\nu}-\Gamma^{\rho}~_{\rho\lambda}\delta\Gamma^{\lambda}~_{\mu\nu}+\Gamma^{\lambda}~_{\rho\mu}\delta\Gamma^{\rho}~_{\lambda\nu}+\Gamma^{\lambda}~_{\rho\nu}\delta \Gamma^{\rho}~_{\lambda\mu})-(\nabla_{\mu}\delta \Gamma^{\rho}~_{\rho\nu}-\Gamma^{\rho}~_{\mu\lambda}\delta\Gamma^{\lambda}~_{\rho\nu}+\Gamma^{\lambda}~_{\mu\rho}\delta\Gamma^{\rho}~_{\lambda\nu}\nonumber\\
&+&\Gamma^{\lambda}~_{\mu\nu}\delta \Gamma^{\rho}~_{\rho\lambda})+\delta (\Gamma^{\lambda}~_{\mu\nu}\Gamma^{\rho}~_{\rho\lambda}-\Gamma^{\lambda}~_{\rho\nu}\Gamma^{\rho}~_{\mu\lambda})\nonumber\\
&=&\nabla_{\rho}\delta \Gamma^{\rho}~_{\mu\nu}-\nabla_{\mu}\delta \Gamma^{\rho}~_{\rho\nu}.
\end{eqnarray}
In the second line of the above equation we have used the fact that $\delta \Gamma^{\rho}~_{\mu\nu}$ is a tensor since it is the difference of two connections. Thus

\begin{eqnarray}
\int d^n x \sqrt{-{\rm det} g}~g^{\mu\nu}\delta R_{\mu\nu}&=&\int d^n x \sqrt{-{\rm det} g}~g^{\mu\nu}\bigg(\nabla_{\rho}\delta \Gamma^{\rho}~_{\mu\nu}-\nabla_{\mu}\delta \Gamma^{\rho}~_{\rho\nu}\bigg)\nonumber\\
&=&\int d^n x \sqrt{-{\rm det} g}~\nabla_{\rho}\bigg(g^{\mu\nu}\delta \Gamma^{\rho}~_{\mu\nu}-g^{\rho\nu}\delta \Gamma^{\mu}~_{\mu\nu}\bigg).
\end{eqnarray}
We compute also (with $\delta g_{\mu\nu}=-g_{\mu\alpha}g_{\nu\beta}\delta g^{\alpha \beta}$)
\begin{eqnarray}
\delta\Gamma^{\rho}~_{\mu\nu}&=&\frac{1}{2}g^{\rho\lambda}\bigg(\nabla_{\mu}\delta g_{\nu\lambda}+\nabla_{\nu}\delta g_{\mu\lambda}-\nabla_{\lambda}\delta g_{\mu\nu}\bigg)\nonumber\\
&=&-\frac{1}{2}\bigg(g_{\nu\lambda}\nabla_{\mu}\delta g^{\lambda\rho}+g_{\mu\lambda}\nabla_{\nu}\delta g^{\lambda\rho}-g_{\mu\alpha}g_{\nu\beta}\nabla^{\rho}\delta g^{\alpha\beta}\bigg).
\end{eqnarray}
Thus
\begin{eqnarray}
\int d^n x \sqrt{-{\rm det} g}~g^{\mu\nu}\delta R_{\mu\nu}
&=&\int d^n x \sqrt{-{\rm det} g}~\nabla_{\rho}\bigg(g_{\mu\nu}\nabla^{\rho}\delta g^{\mu\nu}-\nabla_{\mu}\delta g^{\mu\rho}\bigg).
\end{eqnarray}
By Stokes's theorem this integral is equal to the integral over the boundary of spacetime of the expression $g_{\mu\nu}\nabla^{\rho}\delta g^{\mu\nu}-\nabla_{\mu}\delta g^{\mu\rho}$ which is $0$ if we assume that the metric and its first derivatives are held fixed on the boundary. The variation of the action reduces to
\begin{eqnarray}
\delta S
&=&\int d^n x\delta \sqrt{-{\rm det} g}~g^{\mu\nu}R_{\mu\nu}+\int d^n x \sqrt{-{\rm det} g}~\delta g^{\mu\nu}R_{\mu\nu}.
\end{eqnarray}
Next we use the result
\begin{eqnarray}
\delta \sqrt{-{\rm det} g}=-\frac{1}{2}\sqrt{-{\rm det} g}~ g_{\mu\nu}\delta g^{\mu\nu}.
\end{eqnarray}
Hence
\begin{eqnarray}
\delta S
&=&\int d^n x \sqrt{-{\rm det} g}~\delta g^{\mu\nu}(R_{\mu\nu}-\frac{1}{2}g_{\mu\nu}R).
\end{eqnarray}
This will obviously lead to Einstein's equations in vacuum  which is partially our goal. We want also to include the effect of matter  which requires considering the more general actions of the form
\begin{eqnarray}
S=\frac{1}{16\pi G}\int d^nx~\sqrt{-{\rm det}g}~R+S_M.\label{HE}
\end{eqnarray}
\begin{eqnarray}
S_M=\int d^nx~\sqrt{-{\rm det}g}~\hat{\cal L}_M.
\end{eqnarray}
The variation of the action becomes
\begin{eqnarray}
\delta S
&=&\frac{1}{16\pi G}\int d^n x \sqrt{-{\rm det} g}~\delta g^{\mu\nu}(R_{\mu\nu}-\frac{1}{2}g_{\mu\nu}R)+\delta S_M\nonumber\\
&=&\int d^n x \sqrt{-{\rm det} g}~\delta g^{\mu\nu}\bigg[\frac{1}{16\pi G}(R_{\mu\nu}-\frac{1}{2}g_{\mu\nu}R)+\frac{1}{\sqrt{-{\rm det} g}}\frac{\delta S_M}{\delta g^{\mu\nu}} \bigg].
\end{eqnarray}
In other words
\begin{eqnarray}
\frac{1}{\sqrt{-{\rm det} g}}\frac{\delta S}{\delta g^{\mu\nu}} &=&\frac{1}{16\pi G}(R_{\mu\nu}-\frac{1}{2}g_{\mu\nu}R)+\frac{1}{\sqrt{-{\rm det} g}}\frac{\delta S_M}{\delta g^{\mu\nu}}.
\end{eqnarray}
Einstein's equations are therefore given by
\begin{eqnarray}
R_{\mu\nu}-\frac{1}{2}g_{\mu\nu}R=8\pi G T_{\mu\nu}.
\end{eqnarray}
The stress-energy-momentum tensor must therefore be defined by the equation
\begin{eqnarray}
T_{\mu\nu}=-\frac{2}{\sqrt{-{\rm det} g}}\frac{\delta S_M}{\delta g^{\mu\nu}}.
\end{eqnarray}
As a first example we consider the action of a scalar field in curved spacetime given by
\begin{eqnarray}
S_{\phi}=\int d^nx \sqrt{-{\rm det} g}~\bigg[-\frac{1}{2}g^{\mu\nu}\nabla_{\mu}\phi\nabla_{\nu}\phi-V(\phi)\bigg].
\end{eqnarray}
The corresponding stress-energy-momentum tensor is calculated to be given by
\begin{eqnarray}
T_{\mu\nu}^{(\phi)}=\nabla_{\mu}\phi\nabla_{\nu}\phi-\frac{1}{2}g_{\mu\nu}g^{\rho\sigma}\nabla_{\rho}\phi\nabla_{\sigma}\phi-g_{\mu\nu}V(\phi).
\end{eqnarray}
As a second example we consider the action of the  electromagnetic field in curved spacetime given by
\begin{eqnarray}
S_{A}=\int d^nx \sqrt{-{\rm det} g}~\bigg[-\frac{1}{4}g^{\mu\nu}g^{\alpha\beta}F_{\mu\nu}F_{\alpha\beta}\bigg].
\end{eqnarray}
In this case the  stress-energy-momentum tensor is calculated to be given by
\begin{eqnarray}
T_{\mu\nu}^{(A)}=F^{\mu\lambda}F^{\nu}~_{\lambda}-\frac{1}{4}g^{\mu\nu}F_{\alpha\beta}F^{\alpha\beta}.
\end{eqnarray}
The cosmological constant is one of the simplest matter action that one can add to the Hilbert-Einstein action. It is given by
\begin{eqnarray}
S_{\rm cc}=-\frac{1}{8\pi G}\int d^4x\sqrt{-{\rm det}g}\Lambda.
\end{eqnarray}
In this case the energy-momentum tensor and the Einstein equations read
\begin{eqnarray}
T_{\mu\nu}=-\frac{\Lambda}{8\pi G}g_{\mu\nu}.
\end{eqnarray}
\begin{eqnarray}
R_{\mu\nu}-\frac{1}{2}g_{\mu\nu}R+\Lambda g_{\mu\nu}=0.
\end{eqnarray}