[guided]The approximation step is needed because the Fourier-mode calculation was first justified for Schwartz functions, where every Fourier transform and derivative is classical. We now pass from smooth rapidly decreasing data to arbitrary finite-energy data.
We use the [Density of Test Functions in the Schwartz Space](/theorems/455) theorem in its Sobolev and Lebesgue-space forms. Since $f\in H^1(\mathbb{R}^n)$ and $\mathcal{S}(\mathbb{R}^n)$ is dense in $H^1(\mathbb{R}^n)$, choose a sequence
$(f_k)_{k=1}^{\infty}$ in $\mathcal{S}(\mathbb{R}^n)$ such that
\begin{align*}
\|f_k-f\|_{H^1(\mathbb{R}^n)}\to 0.
\end{align*}
Since $g\in L^2(\mathbb{R}^n)$ and $\mathcal{S}(\mathbb{R}^n)$ is dense in $L^2(\mathbb{R}^n)$, choose a sequence
$(g_k)_{k=1}^{\infty}$ in $\mathcal{S}(\mathbb{R}^n)$ such that
\begin{align*}
\|g_k-g\|_{L^2(\mathbb{R}^n)}\to 0.
\end{align*}
For each $k$, let $u_k:\mathbb{R}\times\mathbb{R}^n\to\mathbb{C}$ denote the solution of the free wave equation with initial data $f_k$ and $g_k$.
The Schwartz-data part of the proof gives, for each $k$ and each $t\in\mathbb{R}$,
\begin{align*}
\frac{1}{2}\int_{\mathbb{R}^n}\left(|\partial_tu_k(t,x)|^2+|\nabla u_k(t,x)|^2\right)\,d\mathcal{L}^n(x)=\frac{1}{2}\int_{\mathbb{R}^n}\left(|g_k(x)|^2+|\nabla f_k(x)|^2\right)\,d\mathcal{L}^n(x).
\end{align*}
Now fix $t\in\mathbb{R}$. We use the independently established [Wave Operator Generates a Unitary $C_0$-Group](/theorems/3146) theorem, but only for the well-posedness consequences of the free wave flow. This theorem states that for every datum $(h_0,h_1)\in H^1(\mathbb{R}^n)\times L^2(\mathbb{R}^n)$ there is a unique finite-energy solution in $C(\mathbb{R};H^1(\mathbb{R}^n))\cap C^1(\mathbb{R};L^2(\mathbb{R}^n))$, and that for each fixed time $t$ the map from initial data to $(u(t,\cdot),\partial_tu(t,\cdot))$ is continuous as a map from $H^1(\mathbb{R}^n)\times L^2(\mathbb{R}^n)$ to itself. The independence matters: this well-posedness result is a prior construction of the wave propagator, not an application of the conservation identity being proved here. The hypotheses apply here because $(f_k,g_k)\to(f,g)$ in $H^1(\mathbb{R}^n)\times L^2(\mathbb{R}^n)$, each $u_k$ is the finite-energy solution with initial data $(f_k,g_k)$, and the function $u$ in the theorem statement belongs to $C(\mathbb{R};H^1(\mathbb{R}^n))\cap C^1(\mathbb{R};L^2(\mathbb{R}^n))$ with initial data $(f,g)$. Uniqueness identifies this given $u$ with the solution obtained from the finite-energy wave propagator. Continuous dependence therefore gives
\begin{align*}
\|u_k(t,\cdot)-u(t,\cdot)\|_{H^1(\mathbb{R}^n)}\to 0,
\end{align*}
and
\begin{align*}
\|\partial_tu_k(t,\cdot)-\partial_tu(t,\cdot)\|_{L^2(\mathbb{R}^n)}\to 0.
\end{align*}
The $H^1$ convergence implies
\begin{align*}
\|\nabla u_k(t,\cdot)-\nabla u(t,\cdot)\|_{L^2(\mathbb{R}^n)}\to 0.
\end{align*}
Norm convergence in a [Hilbert space](/page/Hilbert%20Space) implies convergence of squared norms, so
\begin{align*}
\int_{\mathbb{R}^n}|\partial_tu_k(t,x)|^2\,d\mathcal{L}^n(x)\to \int_{\mathbb{R}^n}|\partial_tu(t,x)|^2\,d\mathcal{L}^n(x),
\end{align*}
and
\begin{align*}
\int_{\mathbb{R}^n}|\nabla u_k(t,x)|^2\,d\mathcal{L}^n(x)\to \int_{\mathbb{R}^n}|\nabla u(t,x)|^2\,d\mathcal{L}^n(x).
\end{align*}
Similarly, the initial-data convergence gives
\begin{align*}
\int_{\mathbb{R}^n}|g_k(x)|^2\,d\mathcal{L}^n(x)\to \int_{\mathbb{R}^n}|g(x)|^2\,d\mathcal{L}^n(x),
\end{align*}
and
\begin{align*}
\int_{\mathbb{R}^n}|\nabla f_k(x)|^2\,d\mathcal{L}^n(x)\to \int_{\mathbb{R}^n}|\nabla f(x)|^2\,d\mathcal{L}^n(x).
\end{align*}
Passing to the limit in the Schwartz-data identity therefore gives the desired identity for the original finite-energy solution $u$ at the fixed time $t$. Since $t\in\mathbb{R}$ was arbitrary, the identity holds for every time.[/guided]