[proofplan]
We compute the time derivative of the [scalar curvature](/page/Scalar%20Curvature) $S = g^{ij}\operatorname{Ric}_{ij}$ at an arbitrary spacetime point. The inverse metric variation gives the zeroth-order term $2|\operatorname{Ric}|^2$. The remaining term is the trace of the [Ricci curvature](/page/Ricci%20Curvature) variation, which is obtained from the variation of the Christoffel symbols of the [Levi-Civita connection](/page/Levi-Civita%20Connection) under the metric variation $h_{ij} := \partial_t g_{ij} = -2\operatorname{Ric}_{ij}$. After tracing and using the [contracted second Bianchi identity](/page/Contracted%20Second%20Bianchi%20Identity), all first-order Ricci terms combine exactly into the [Laplace-Beltrami operator](/page/Laplace-Beltrami%20Operator) term $\Delta S$.
[/proofplan]
[step:Localize the computation at an arbitrary spacetime point]
Fix a point $p \in M$ and a time $t_0 \in I$. Since the claimed identity is tensorial, it suffices to prove it at $(p,t_0)$ in a coordinate chart $(U,\varphi)$ with coordinates $(x_1,\dots,x_n)$ centered at $p$ and normal for the metric $g(t_0)$ at $p$. Thus, at $(p,t_0)$, the metric components satisfy $g_{ij} = \delta_{ij}$, the first coordinate derivatives satisfy $\partial_{x_k}g_{ij} = 0$, and the Christoffel symbols satisfy $\Gamma_{ij}^k = 0$, where $\Gamma_{ij}^k$ are the Christoffel symbols of the [Levi-Civita connection](/page/Levi-Civita%20Connection) $\nabla$ of $g(t_0)$.
Define the symmetric $(0,2)$-tensor $h: U \times I \to \operatorname{Sym}^2 T^*U$ by
\begin{align*}
h(x,t) = \partial_t g(x,t).
\end{align*}
Because $g(t)$ satisfies Ricci flow, at every point of $U \times I$,
\begin{align*}
h_{ij} = -2\operatorname{Ric}_{ij}.
\end{align*}
[/step]
[step:Differentiate the scalar curvature and isolate the inverse metric contribution]
By definition of [scalar curvature](/page/Scalar%20Curvature),
\begin{align*}
S = g^{ij}\operatorname{Ric}_{ij}.
\end{align*}
Differentiating in $t$ gives
\begin{align*}
\partial_t S
= (\partial_t g^{ij})\operatorname{Ric}_{ij}
+ g^{ij}\partial_t\operatorname{Ric}_{ij}.
\end{align*}
The identity $g^{ik}g_{kj} = \delta^i_j$ gives, after differentiating,
\begin{align*}
(\partial_t g^{ik})g_{kj} + g^{ik}\partial_t g_{kj} = 0.
\end{align*}
Multiplying by $g^{j\ell}$ and using $h_{k j}=\partial_t g_{kj}$ yields
\begin{align*}
\partial_t g^{i\ell}
= -g^{ik}g^{j\ell}h_{kj}.
\end{align*}
Since $h_{kj} = -2\operatorname{Ric}_{kj}$, we obtain
\begin{align*}
\partial_t g^{ij} = 2\operatorname{Ric}^{ij},
\end{align*}
where $\operatorname{Ric}^{ij} = g^{ik}g^{j\ell}\operatorname{Ric}_{k\ell}$. Therefore
\begin{align*}
(\partial_t g^{ij})\operatorname{Ric}_{ij}
= 2\operatorname{Ric}^{ij}\operatorname{Ric}_{ij}
= 2|\operatorname{Ric}|^2.
\end{align*}
Thus
\begin{align*}
\partial_t S
= 2|\operatorname{Ric}|^2 + g^{ij}\partial_t\operatorname{Ric}_{ij}.
\end{align*}
[/step]
[step:Compute the traced Ricci variation from the Christoffel variation]
The Christoffel symbols are
\begin{align*}
\Gamma_{ij}^k
= \frac{1}{2}g^{k\ell}
\left(
\partial_{x_i}g_{j\ell}
+
\partial_{x_j}g_{i\ell}
-
\partial_{x_\ell}g_{ij}
\right).
\end{align*}
At the fixed time $t_0$, this formula can be rewritten covariantly as the variation identity
\begin{align*}
\partial_t\Gamma_{ij}^k
=
\frac{1}{2}g^{k\ell}
\left(
\nabla_i h_{j\ell}
+
\nabla_j h_{i\ell}
-
\nabla_\ell h_{ij}
\right).
\end{align*}
Since $h_{ij}=-2\operatorname{Ric}_{ij}$,
\begin{align*}
\partial_t\Gamma_{ij}^k
=
-g^{k\ell}
\left(
\nabla_i\operatorname{Ric}_{j\ell}
+
\nabla_j\operatorname{Ric}_{i\ell}
-
\nabla_\ell\operatorname{Ric}_{ij}
\right).
\end{align*}
Let $R^\ell{}_{ijk}$ denote the components of the Riemann curvature tensor of $g(t_0)$ in the chosen chart, with convention
\begin{align*}
R^\ell{}_{ijk}
=
\partial_{x_j}\Gamma_{ik}^\ell
-
\partial_{x_k}\Gamma_{ij}^\ell
+
\Gamma_{jm}^\ell\Gamma_{ik}^m
-
\Gamma_{km}^\ell\Gamma_{ij}^m.
\end{align*}
Thus $\operatorname{Ric}_{ij}=R^k{}_{ikj}$. Differentiating this curvature formula at the normal-coordinate point, where $\Gamma_{ij}^k=0$, gives
\begin{align*}
\partial_t\operatorname{Ric}_{ij}
=
\nabla_k(\partial_t\Gamma_{ij}^k)
-
\nabla_j(\partial_t\Gamma_{ik}^k).
\end{align*}
Substituting the Christoffel variation gives
\begin{align*}
\partial_t\operatorname{Ric}_{ij}
=
-\nabla_k\nabla_i\operatorname{Ric}_j{}^k
-\nabla_k\nabla_j\operatorname{Ric}_i{}^k
+\nabla_k\nabla^k\operatorname{Ric}_{ij}
+
\nabla_j\nabla_i S.
\end{align*}
[guided]
The goal of this step is to express the Ricci variation in a form that can later be traced. We use the metric variation tensor $h$ defined by
\begin{align*}
h_{ij} = \partial_t g_{ij}.
\end{align*}
Under Ricci flow this is not arbitrary: it is
\begin{align*}
h_{ij} = -2\operatorname{Ric}_{ij}.
\end{align*}
First we compute how the connection changes. The Levi-Civita connection is determined by the metric, and differentiating the Christoffel formula gives
\begin{align*}
\partial_t\Gamma_{ij}^k
=
\frac{1}{2}g^{k\ell}
\left(
\nabla_i h_{j\ell}
+
\nabla_j h_{i\ell}
-
\nabla_\ell h_{ij}
\right).
\end{align*}
This formula is tensorial in the lower-order terms, so it is valid in the chosen [normal coordinates](/theorems/2713) at $(p,t_0)$ and hence gives the covariant expression we need. Substituting $h_{ij}=-2\operatorname{Ric}_{ij}$ yields
\begin{align*}
\partial_t\Gamma_{ij}^k
=
-g^{k\ell}
\left(
\nabla_i\operatorname{Ric}_{j\ell}
+
\nabla_j\operatorname{Ric}_{i\ell}
-
\nabla_\ell\operatorname{Ric}_{ij}
\right).
\end{align*}
Next we pass from the connection variation to the Ricci variation. In normal coordinates at the point under consideration, the quadratic Christoffel terms in the curvature formula do not contribute after differentiating at that point, so
\begin{align*}
\partial_t\operatorname{Ric}_{ij}
=
\nabla_k(\partial_t\Gamma_{ij}^k)
-
\nabla_j(\partial_t\Gamma_{ik}^k).
\end{align*}
Now compute the contracted Christoffel variation:
\begin{align*}
\partial_t\Gamma_{ik}^k
&=
-g^{k\ell}
\left(
\nabla_i\operatorname{Ric}_{k\ell}
+
\nabla_k\operatorname{Ric}_{i\ell}
-
\nabla_\ell\operatorname{Ric}_{ik}
\right).
\end{align*}
The last two terms cancel after raising and contracting the dummy indices $k$ and $\ell$, while the first term is $\nabla_i S$. Hence
\begin{align*}
\partial_t\Gamma_{ik}^k = -\nabla_i S.
\end{align*}
Therefore
\begin{align*}
-\nabla_j(\partial_t\Gamma_{ik}^k)
=
\nabla_j\nabla_i S.
\end{align*}
For the first term,
\begin{align*}
\nabla_k(\partial_t\Gamma_{ij}^k)
=
-\nabla_k\nabla_i\operatorname{Ric}_j{}^k
-\nabla_k\nabla_j\operatorname{Ric}_i{}^k
+\nabla_k\nabla^k\operatorname{Ric}_{ij}.
\end{align*}
Combining these identities gives
\begin{align*}
\partial_t\operatorname{Ric}_{ij}
=
-\nabla_k\nabla_i\operatorname{Ric}_j{}^k
-\nabla_k\nabla_j\operatorname{Ric}_i{}^k
+\nabla_k\nabla^k\operatorname{Ric}_{ij}
+
\nabla_j\nabla_i S.
\end{align*}
[/guided]
[/step]
[step:Trace the Ricci variation and use the contracted Bianchi identity]
All contractions and covariant derivatives in this step are taken with respect to $g(t_0)$ at the fixed point $(p,t_0)$. The traced metric-variation formula for Ricci curvature, obtained by contracting the Christoffel-variation computation before substituting $h$, is
\begin{align*}
g^{ij}\partial_t\operatorname{Ric}_{ij}
=
\nabla^i\nabla^j h_{ij}
-
\Delta(g^{ij}h_{ij}),
\end{align*}
where $\Delta f = \nabla^k\nabla_k f$ for scalar functions $f:U\to\mathbb{R}$ is the [Laplace-Beltrami operator](/page/Laplace-Beltrami%20Operator). Indeed, tracing
\begin{align*}
\partial_t\operatorname{Ric}_{ij}
=
\frac{1}{2}\left(\nabla_k\nabla_i h_j{}^k+\nabla_k\nabla_j h_i{}^k-\nabla_k\nabla^k h_{ij}-\nabla_j\nabla_i(g^{k\ell}h_{k\ell})\right)
\end{align*}
gives first
\begin{align*}
g^{ij}\partial_t\operatorname{Ric}_{ij}
=
\frac{1}{2}\left(\nabla^i\nabla^j h_{ij}+\nabla^j\nabla^i h_{ij}-\Delta(g^{ij}h_{ij})-\Delta(g^{ij}h_{ij})\right).
\end{align*}
Since $h_{ij}=h_{ji}$ and $\nabla g=0$ for the Levi-Civita connection, this becomes
\begin{align*}
g^{ij}\partial_t\operatorname{Ric}_{ij}
=
\nabla^i\nabla^j h_{ij}-\Delta(g^{ij}h_{ij}),
\end{align*}
because $h_{ij}=h_{ji}$ and $\nabla g=0$ for the Levi-Civita connection. For Ricci flow, $h_{ij}=-2\operatorname{Ric}_{ij}$ and $g^{ij}h_{ij}=-2S$, so
\begin{align*}
g^{ij}\partial_t\operatorname{Ric}_{ij}
=
-2\nabla^i\nabla^j\operatorname{Ric}_{ij}
+2\Delta S.
\end{align*}
The [contracted second Bianchi identity](/page/Contracted%20Second%20Bianchi%20Identity) is
\begin{align*}
\nabla^i\operatorname{Ric}_{ij} = \frac{1}{2}\nabla_j S.
\end{align*}
Taking one more covariant derivative and contracting gives
\begin{align*}
\nabla^i\nabla^j\operatorname{Ric}_{ij}
=
\frac{1}{2}\Delta S.
\end{align*}
Therefore
\begin{align*}
g^{ij}\partial_t\operatorname{Ric}_{ij}
=
-2\left(\frac{1}{2}\Delta S\right)+2\Delta S
=
\Delta S.
\end{align*}
[guided]
We need the trace of the Ricci variation, not the whole tensor evolution. This is the delicate sign-sensitive part of the proof, so we trace the metric-variation formula before substituting the Ricci flow equation. All covariant derivatives and contractions are taken with respect to the fixed metric $g(t_0)$ at $(p,t_0)$, and the Levi-Civita connection satisfies $\nabla g=0$.
For a symmetric metric variation tensor $h$ with components $h_{ij}=\partial_t g_{ij}$, the Ricci variation obtained from the Christoffel variation is
\begin{align*}
\partial_t\operatorname{Ric}_{ij}
=
\frac{1}{2}\left(\nabla_k\nabla_i h_j{}^k+\nabla_k\nabla_j h_i{}^k-\nabla_k\nabla^k h_{ij}-\nabla_j\nabla_i(g^{k\ell}h_{k\ell})\right).
\end{align*}
Now contract this identity with $g^{ij}$. Since $\nabla g=0$, the metric may be moved through covariant derivatives during contraction. The contraction first gives
\begin{align*}
g^{ij}\partial_t\operatorname{Ric}_{ij}
=
\frac{1}{2}\left(\nabla^i\nabla^j h_{ij}+\nabla^j\nabla^i h_{ij}-\Delta(g^{ij}h_{ij})-\Delta(g^{ij}h_{ij})\right).
\end{align*}
Since $h$ is symmetric, the first two traced terms are equal after relabelling dummy indices. Hence
\begin{align*}
g^{ij}\partial_t\operatorname{Ric}_{ij}
=
\nabla^i\nabla^j h_{ij}-\Delta(g^{ij}h_{ij}).
\end{align*}
This is the traced Ricci variation formula with the sign convention fixed by the curvature convention used earlier.
Under Ricci flow the variation tensor is $h_{ij}=-2\operatorname{Ric}_{ij}$, and its trace is
\begin{align*}
g^{ij}h_{ij}=-2g^{ij}\operatorname{Ric}_{ij}=-2S.
\end{align*}
Substituting these two identities gives
\begin{align*}
g^{ij}\partial_t\operatorname{Ric}_{ij}
=
-2\nabla^i\nabla^j\operatorname{Ric}_{ij}+2\Delta S.
\end{align*}
The [contracted second Bianchi identity](/page/Contracted%20Second%20Bianchi%20Identity) states
\begin{align*}
\nabla^i\operatorname{Ric}_{ij}=\frac{1}{2}\nabla_j S.
\end{align*}
Applying $\nabla^j$ to both sides and using the definition $\Delta S=\nabla^j\nabla_j S$ for the scalar Laplacian gives
\begin{align*}
\nabla^i\nabla^j\operatorname{Ric}_{ij}=\frac{1}{2}\Delta S.
\end{align*}
Therefore the traced Ricci variation is
\begin{align*}
g^{ij}\partial_t\operatorname{Ric}_{ij}
=
-2\left(\frac{1}{2}\Delta S\right)+2\Delta S
=
\Delta S.
\end{align*}
[/guided]
[/step]
[step:Combine the two contributions to obtain the scalar curvature evolution]
From the scalar curvature differentiation step,
\begin{align*}
\partial_t S
=
2|\operatorname{Ric}|^2
+
g^{ij}\partial_t\operatorname{Ric}_{ij}.
\end{align*}
The traced Ricci variation gives
\begin{align*}
g^{ij}\partial_t\operatorname{Ric}_{ij}
=
\Delta S.
\end{align*}
Substituting this into the previous identity yields
\begin{align*}
\partial_t S
=
\Delta S
+
2|\operatorname{Ric}|^2.
\end{align*}
Since $(p,t_0) \in M \times I$ was arbitrary, the identity holds locally on $M \times I$ for the smooth Ricci flow $g(t)$.
[/step]