[guided]We first isolate the quantity that the [heat equation](/page/Heat%20Equation) controls. Define
\begin{align*}
E:[0,T]&\to[0,\infty)
\end{align*}
\begin{align*}
t&\mapsto \frac{1}{2}\|w(t,\cdot)\|_{L^2(U)}^2.
\end{align*}
The factor
\begin{align*}
\frac{1}{2}
\end{align*}
is chosen so that differentiating the square of the norm does not leave an extra factor of $2$. The inner product on $L^2(U)$ is
\begin{align*}
(f,g)_{L^2(U)}=\int_U f(x)g(x)\,d\mathcal{L}^n(x),
\end{align*}
for real-valued $f,g\in L^2(U)$.
We now justify the differentiation of the squared norm. Fix $t\in(0,T)$, and let $h\neq0$ satisfy $t+h\in[0,T]$. Define the difference quotient
\begin{align*}
d_h=\frac{w(t+h,\cdot)-w(t,\cdot)}{h}\in L^2(U).
\end{align*}
Using the [Hilbert space](/page/Hilbert%20Space) identity
\begin{align*}
\|a+b\|_{L^2(U)}^2-\|a\|_{L^2(U)}^2=2(a,b)_{L^2(U)}+\|b\|_{L^2(U)}^2
\end{align*}
with $a=w(t,\cdot)$ and $b=w(t+h,\cdot)-w(t,\cdot)=h d_h$, we obtain
\begin{align*}
\frac{E(t+h)-E(t)}{h}=(d_h,w(t,\cdot))_{L^2(U)}+\frac{h}{2}\|d_h\|_{L^2(U)}^2.
\end{align*}
Because $w\in C^1([0,T];L^2(U))$, the difference quotient $d_h$ converges in $L^2(U)$ to $\partial_t w(t,\cdot)$ as $h\to0$. In particular, the family $\|d_h\|_{L^2(U)}$ remains bounded for $h$ sufficiently small. Therefore the second term $\frac{h}{2}\|d_h\|_{L^2(U)}^2$ tends to $0$, while the first term tends to $(\partial_t w(t,\cdot),w(t,\cdot))_{L^2(U)}$ by continuity of the $L^2$ inner product. Hence
\begin{align*}
E'(t)=(\partial_t w(t,\cdot),w(t,\cdot))_{L^2(U)}.
\end{align*}[/guided]