[guided]The formal energy computation uses $\partial_t w$ as a test function, but a weak solution need not have enough time regularity for this test to be immediately legitimate. The standard way to justify the computation is to smooth only in the time variable. Let $\rho \in C_c^\infty((-1,1))$ be a nonnegative function satisfying
\begin{align*}
\int_{\mathbb{R}} \rho(r) \, d\mathcal{L}^1(r)=1,
\end{align*}
and for $\varepsilon > 0$ define the map
\begin{align*}
\rho_\varepsilon: \mathbb{R} \to \mathbb{R}
\end{align*}
by $\rho_\varepsilon(r)=\varepsilon^{-1}\rho(r/\varepsilon)$ for each $r \in \mathbb{R}$.
On a compact interval $[a,b] \subset (0,T)$ with $\varepsilon < \operatorname{dist}([a,b],\{0,T\})$, define the time-regularized function
\begin{align*}
w_\varepsilon: [a,b] \to H^1_0(U)
\end{align*}
by
\begin{align*}
w_\varepsilon(t)=\int_{\mathbb{R}} \rho_\varepsilon(t-s)w(s) \, d\mathcal{L}^1(s)
\end{align*}
for each $t \in [a,b]$, where $w$ is extended slightly outside $[0,T]$ by any fixed energy-class extension. Since convolution in time commutes with the time derivative on the interior interval, $w_\varepsilon$ is smooth as a map into $H^1_0(U)$ and $\partial_t w_\varepsilon$ is an admissible time-regularized test function.
The weak equation for $w$ says that for every $\phi \in C_c^\infty((0,T);H^1_0(U))$,
\begin{align*}
\int_0^{\mathsf T} (\partial_t w(t),\partial_t \phi(t))_{L^2(U)} \, d\mathcal{L}^1(t) - \int_0^{\mathsf T} \int_U \nabla w(x,t)\cdot \nabla \phi(x,t) \, d\mathcal{L}^n(x)\, d\mathcal{L}^1(t)=0.
\end{align*}
Let $H^{-1}(U)$ denote the dual space $(H^1_0(U))^*$. Equivalently, $\partial_t^2 w - \Delta w = 0$ holds as an $H^{-1}(U)$-valued distribution in time. Convolving this distributional identity in the time variable with $\rho_\varepsilon$ is legitimate on $[a,b]$ because the support of $\rho_\varepsilon(t-\cdot)$ stays inside $(0,T)$ for $t \in [a,b]$. Since time convolution commutes with $\partial_t$ and with the spatial weak gradient, the regularized function satisfies
\begin{align*}
\partial_t^2 w_\varepsilon - \Delta w_\varepsilon = 0
\end{align*}
as an identity in $H^{-1}(U)$ for each $t \in [a,b]$. Because $w \in C^1([0,T];L^2(U))$, the time-convolution satisfies $\partial_t w_\varepsilon \in C^1([a,b];L^2(U))$ and
\begin{align*}
\partial_t^2 w_\varepsilon(t)=\int_{\mathbb{R}} \partial_t\rho_\varepsilon(t-s)\partial_t w(s) \, d\mathcal{L}^1(s)
\end{align*}
as an $L^2(U)$-valued Bochner integral for each $t \in [a,b]$. Thus the $H^{-1}(U)$ pairing of $\partial_t^2 w_\varepsilon(t)$ with $\partial_t w_\varepsilon(t)$ is the $L^2(U)$ [inner product](/page/Inner%20Product). Evaluating the regularized identity on the test vector $\partial_t w_\varepsilon(t) \in H^1_0(U)$ gives
\begin{align*}
\int_U \partial_t^2 w_\varepsilon(x,t)\partial_t w_\varepsilon(x,t) \, d\mathcal{L}^n(x) + \int_U \nabla w_\varepsilon(x,t)\cdot \nabla \partial_t w_\varepsilon(x,t) \, d\mathcal{L}^n(x)=0
\end{align*}
for $t \in [a,b]$. The first integral is the time derivative of the kinetic energy:
\begin{align*}
\int_U \partial_t^2 w_\varepsilon(x,t)\partial_t w_\varepsilon(x,t) \, d\mathcal{L}^n(x)=\frac{d}{dt}\left(\frac{1}{2}\int_U |\partial_t w_\varepsilon(x,t)|^2 \, d\mathcal{L}^n(x)\right).
\end{align*}
The second integral is the time derivative of the potential energy:
\begin{align*}
\int_U \nabla w_\varepsilon(x,t)\cdot \nabla \partial_t w_\varepsilon(x,t) \, d\mathcal{L}^n(x)=\frac{d}{dt}\left(\frac{1}{2}\int_U |\nabla w_\varepsilon(x,t)|^2 \, d\mathcal{L}^n(x)\right).
\end{align*}
Therefore the regularized energy map
\begin{align*}
E_{w_\varepsilon}: [a,b] \to [0,\infty)
\end{align*}
defined by
\begin{align*}
E_{w_\varepsilon}(t)=\frac{1}{2}\int_U |\partial_t w_\varepsilon(x,t)|^2 \, d\mathcal{L}^n(x) + \frac{1}{2}\int_U |\nabla w_\varepsilon(x,t)|^2 \, d\mathcal{L}^n(x)
\end{align*}
for each $t \in [a,b]$ is constant on $[a,b]$.
Finally, time mollification converges strongly in the energy topology:
\begin{align*}
w_\varepsilon \to w \quad \text{in } C([a,b];H^1_0(U))
\end{align*}
and
\begin{align*}
\partial_t w_\varepsilon \to \partial_t w \quad \text{in } C([a,b];L^2(U)).
\end{align*}
Passing to the limit in the two energy terms gives
\begin{align*}
E_w(t)=E_w(s)
\end{align*}
for all $s,t \in [a,b]$. Since $[a,b]$ was an arbitrary compact subinterval of $(0,T)$ and $E_w$ is continuous on $[0,T]$, the identity extends to all $s,t \in [0,T]$.[/guided]