[step:Integrate the spatial-gradient term by parts]
Let $\nu:\partial U\to\mathbb{R}^n$ denote the outward unit normal field on $\partial U$, and let $\nu_i$ denote its $i$th component. Let $\mathcal{H}^{n-1}$ denote the $(n-1)$-dimensional [Hausdorff measure](/page/Hausdorff%20Measure) restricted to $\partial U$, which is the surface measure appearing in the boundary term. For each $i \in \{1,\dots,n\}$, the functions $x\mapsto \partial_{x_i}u(x,t)$ and $x\mapsto \partial_tu(x,t)$ are $C^1(\overline{U})$. Applying the classical integration-by-parts formula on the smooth bounded domain $U$ gives
\begin{align*}
\int_U \partial_{x_i}u(x,t)\,\partial_{x_i}\partial_tu(x,t)\, d\mathcal{L}^n(x) = \int_{\partial U} \partial_tu(x,t)\,\partial_{x_i}u(x,t)\,\nu_i(x)\, d\mathcal{H}^{n-1}(x) - \int_U \partial_tu(x,t)\,\partial_{x_i}^2u(x,t)\, d\mathcal{L}^n(x).
\end{align*}
Summing over $i$ yields
\begin{align*}
\sum_{i=1}^n \int_U \partial_{x_i}u(x,t)\,\partial_{x_i}\partial_tu(x,t)\, d\mathcal{L}^n(x) = \int_{\partial U} \partial_tu(x,t)\,\nabla u(x,t)\cdot\nu(x)\, d\mathcal{H}^{n-1}(x) - \int_U \partial_tu(x,t)\,\Delta u(x,t)\, d\mathcal{L}^n(x).
\end{align*}
[/step]