[proofplan]
We prove the identity by the standard $L^2$ energy method. First we define the scalar energy $E(r)=\|u(r,\cdot)\|_{L^2(U)}^2$ and differentiate it using the Hilbert-space chain rule, which follows directly from the assumed $C^1$ regularity into $L^2(U)$. Then we pair the equation $\partial_tu=\Delta u$ with $u$ and use the zero-trace condition to justify the Sobolev integration-by-parts identity. Integrating the resulting differential identity over $[s,t]$ gives the stated equality.
[/proofplan]
[step:Define the energy and differentiate the $L^2$ norm]
Let $(\cdot,\cdot)_{L^2(U)}$ denote the real Hilbert-space [inner product](/page/Inner%20Product)
\begin{align*}
(f,g)_{L^2(U)}:=\int_U f(x)g(x)\,d\mathcal{L}^n(x)
\end{align*}
for $f,g\in L^2(U)$. Define the energy function
\begin{align*}
E:[0,T]&\to\mathbb{R}
\end{align*}
\begin{align*}
r&\mapsto \|u(r,\cdot)\|_{L^2(U)}^2.
\end{align*}
Since $u\in C^1([0,T];L^2(U))$, the map $E$ is $C^1$ on $[0,T]$, and for every $r\in[0,T]$,
\begin{align*}
E'(r)=2(\partial_tu(r,\cdot),u(r,\cdot))_{L^2(U)}.
\end{align*}
[guided]
We first isolate the quantity whose evolution we want to control. The relevant [Hilbert space](/page/Hilbert%20Space) is $L^2(U)$ with inner product
\begin{align*}
(f,g)_{L^2(U)}:=\int_U f(x)g(x)\,d\mathcal{L}^n(x).
\end{align*}
Define
\begin{align*}
E:[0,T]&\to\mathbb{R}
\end{align*}
\begin{align*}
r&\mapsto \|u(r,\cdot)\|_{L^2(U)}^2.
\end{align*}
Because $u\in C^1([0,T];L^2(U))$, the difference quotient
\begin{align*}
\frac{u(r+h,\cdot)-u(r,\cdot)}{h}
\end{align*}
converges to $\partial_tu(r,\cdot)$ in $L^2(U)$ as $h\to0$, for each $r\in[0,T]$ where the quotient is taken inside the interval. Using the polarization of the norm,
\begin{align*}
\frac{E(r+h)-E(r)}{h}=\left(\frac{u(r+h,\cdot)-u(r,\cdot)}{h},u(r+h,\cdot)\right)_{L^2(U)}+\left(u(r,\cdot),\frac{u(r+h,\cdot)-u(r,\cdot)}{h}\right)_{L^2(U)}.
\end{align*}
The continuity of $u:[0,T]\to L^2(U)$ gives $u(r+h,\cdot)\to u(r,\cdot)$ in $L^2(U)$, and the $C^1$ assumption gives convergence of the difference quotient to $\partial_tu(r,\cdot)$ in $L^2(U)$. Passing to the limit in the two inner products yields
\begin{align*}
E'(r)=2(\partial_tu(r,\cdot),u(r,\cdot))_{L^2(U)}.
\end{align*}
This is the Hilbert-space chain rule specialized to the squared $L^2$ norm.
[/guided]
[/step]
[step:Use the heat equation to rewrite the time derivative of the energy]
Fix $r\in[0,T]$. The hypothesis states that
\begin{align*}
\partial_tu(r,\cdot)=\Delta u(r,\cdot)
\end{align*}
in $L^2(U)$. Therefore the preceding identity gives
\begin{align*}
E'(r)=2(\Delta u(r,\cdot),u(r,\cdot))_{L^2(U)}.
\end{align*}
[/step]
[step:Prove the zero-boundary integration by parts identity]
For every $v\in H^2(U)\cap H_0^1(U)$,
\begin{align*}
(\Delta v,v)_{L^2(U)}=-\|\nabla v\|_{L^2(U)}^2.
\end{align*}
Indeed, since $v\in H_0^1(U)$, there exists a sequence $(\varphi_k)_{k=1}^{\infty}$ in $C_c^\infty(U)$ such that $\varphi_k\to v$ in $H^1(U)$. For each coordinate index $i\in\{1,\dots,n\}$, the [weak derivative](/page/Weak%20Derivative) identity applied to the compactly supported smooth [test function](/page/Test%20Function) $\varphi_k$ gives
\begin{align*}
\int_U \varphi_k(x)\partial_{x_i}^2v(x)\,d\mathcal{L}^n(x)=-\int_U \partial_{x_i}\varphi_k(x)\partial_{x_i}v(x)\,d\mathcal{L}^n(x).
\end{align*}
Since $\partial_{x_i}^2v\in L^2(U)$ and $\partial_{x_i}v\in L^2(U)$, passing to the limit $k\to\infty$ in $L^2(U)$ gives
\begin{align*}
\int_U v(x)\partial_{x_i}^2v(x)\,d\mathcal{L}^n(x)=-\int_U |\partial_{x_i}v(x)|^2\,d\mathcal{L}^n(x).
\end{align*}
Summing over $i=1,\dots,n$ yields
\begin{align*}
(\Delta v,v)_{L^2(U)}=-\sum_{i=1}^n\int_U |\partial_{x_i}v(x)|^2\,d\mathcal{L}^n(x)=-\|\nabla v\|_{L^2(U)}^2.
\end{align*}
[guided]
The [integration by parts](/theorems/210) step is where the boundary condition is used. We prove the precise Sobolev identity needed here: for every
$v\in H^2(U)\cap H_0^1(U)$,
\begin{align*}
(\Delta v,v)_{L^2(U)}=-\|\nabla v\|_{L^2(U)}^2.
\end{align*}
The point of working with $H_0^1(U)$ is that functions in this space can be approximated in $H^1(U)$ by compactly supported smooth functions. Thus there exists a sequence
$(\varphi_k)_{k=1}^{\infty}$ with $\varphi_k\in C_c^\infty(U)$ such that
\begin{align*}
\varphi_k\to v
\end{align*}
in $H^1(U)$. In particular, $\varphi_k\to v$ in $L^2(U)$ and $\partial_{x_i}\varphi_k\to\partial_{x_i}v$ in $L^2(U)$ for each coordinate index $i\in\{1,\dots,n\}$.
Fix such an index $i$. Since $v\in H^2(U)$, the second weak derivative $\partial_{x_i}^2v$ belongs to $L^2(U)$. The definition of weak derivative, tested against the compactly supported smooth function $\varphi_k$, gives
\begin{align*}
\int_U \varphi_k(x)\partial_{x_i}^2v(x)\,d\mathcal{L}^n(x)=-\int_U \partial_{x_i}\varphi_k(x)\partial_{x_i}v(x)\,d\mathcal{L}^n(x).
\end{align*}
No boundary term appears because $\varphi_k$ has compact support in $U$.
Now pass to the limit. Since $\partial_{x_i}^2v\in L^2(U)$ and $\varphi_k\to v$ in $L^2(U)$, the left-hand side converges to
\begin{align*}
\int_U v(x)\partial_{x_i}^2v(x)\,d\mathcal{L}^n(x).
\end{align*}
Since $\partial_{x_i}\varphi_k\to\partial_{x_i}v$ in $L^2(U)$ and $\partial_{x_i}v\in L^2(U)$, the right-hand side converges to
\begin{align*}
-\int_U |\partial_{x_i}v(x)|^2\,d\mathcal{L}^n(x).
\end{align*}
Therefore
\begin{align*}
\int_U v(x)\partial_{x_i}^2v(x)\,d\mathcal{L}^n(x)=-\int_U |\partial_{x_i}v(x)|^2\,d\mathcal{L}^n(x).
\end{align*}
Summing this identity over all coordinate indices gives
\begin{align*}
(\Delta v,v)_{L^2(U)}=-\sum_{i=1}^n\int_U |\partial_{x_i}v(x)|^2\,d\mathcal{L}^n(x).
\end{align*}
By definition, the vector-valued gradient norm is
\begin{align*}
\|\nabla v\|_{L^2(U)}^2=\sum_{i=1}^n\int_U |\partial_{x_i}v(x)|^2\,d\mathcal{L}^n(x),
\end{align*}
so
\begin{align*}
(\Delta v,v)_{L^2(U)}=-\|\nabla v\|_{L^2(U)}^2.
\end{align*}
[/guided]
[/step]
[step:Apply integration by parts at each time]
For each $r\in[0,T]$, the hypothesis gives $u(r,\cdot)\in H^2(U)\cap H_0^1(U)$. Applying the preceding identity with $v=u(r,\cdot)$ gives
\begin{align*}
(\Delta u(r,\cdot),u(r,\cdot))_{L^2(U)}=-\|\nabla u(r,\cdot)\|_{L^2(U)}^2.
\end{align*}
Combining this with the differential energy identity gives, for every $r\in[0,T]$,
\begin{align*}
E'(r)+2\|\nabla u(r,\cdot)\|_{L^2(U)}^2=0.
\end{align*}
[/step]
[step:Integrate the differential identity from $s$ to $t$]
Because $u\in C^0([0,T];H^2(U)\cap H_0^1(U))$, the map
\begin{align*}
r\mapsto \|\nabla u(r,\cdot)\|_{L^2(U)}^2
\end{align*}
is continuous on $[0,T]$. Hence it is integrable with respect to $\mathcal{L}^1$ on $[s,t]$. Integrating
\begin{align*}
E'(r)+2\|\nabla u(r,\cdot)\|_{L^2(U)}^2=0
\end{align*}
over $[s,t]$ and using the [fundamental theorem of calculus](/theorems/632) for the $C^1$ function $E:[0,T]\to\mathbb{R}$ yields
\begin{align*}
E(t)-E(s)+2\int_s^t \|\nabla u(r,\cdot)\|_{L^2(U)}^2\,d\mathcal{L}^1(r)=0.
\end{align*}
Substituting the definition of $E$ gives
\begin{align*}
\|u(t,\cdot)\|_{L^2(U)}^2+2\int_s^t \|\nabla u(r,\cdot)\|_{L^2(U)}^2\,d\mathcal{L}^1(r)=\|u(s,\cdot)\|_{L^2(U)}^2.
\end{align*}
This is the desired energy identity for all $0\le s\le t\le T$.
[/step]