[proofplan]
We first prove the identity for [Schwartz](/page/Schwartz%20Space) initial data by taking the spatial [Fourier transform](/page/Fourier%20Transform) of the [wave equation](/page/Wave%20Equation). In frequency space each mode is a harmonic oscillator, and the two quadratic terms combine so that the mixed sine-cosine terms cancel exactly. The [Plancherel Theorem](/theorems/247) then converts the frequency-space identity into the physical-space energy identity. Finally, Schwartz approximation in the [Sobolev](/page/Sobolev%20Space) energy space $H^1(\mathbb{R}^n) \times L^2(\mathbb{R}^n)$ and an independently established well-posedness theorem for the free wave flow pass the identity to arbitrary finite-energy data.
[/proofplan]
[step:Fix the Fourier transform convention and reduce first to Schwartz data]
For a multi-index $\alpha=(\alpha_1,\dots,\alpha_n)\in\mathbb{N}_0^n$, define $x^\alpha:=x_1^{\alpha_1}\cdots x_n^{\alpha_n}$ for $x=(x_1,\dots,x_n)\in\mathbb{R}^n$. For a multi-index $\beta=(\beta_1,\dots,\beta_n)\in\mathbb{N}_0^n$, define the differential operator $D^\beta$ by
\begin{align*}
D^\beta h:=\partial_{x_1}^{\beta_1}\cdots\partial_{x_n}^{\beta_n}h.
\end{align*}
Let $\mathcal{S}(\mathbb{R}^n)$ denote the [Schwartz space](/page/Schwartz%20Space) of rapidly decreasing smooth complex-valued functions on $\mathbb{R}^n$, namely the set of all $h \in C^\infty(\mathbb{R}^n;\mathbb{C})$ such that, for every pair of multi-indices $\alpha,\beta \in \mathbb{N}_0^n$, the seminorm
\begin{align*}
\sup_{x \in \mathbb{R}^n}|x^\alpha D^\beta h(x)|
\end{align*}
is finite. Define the symmetric spatial [Fourier transform](/page/Fourier%20Transform)
\begin{align*}
\mathcal{F}: \mathcal{S}(\mathbb{R}^n) \to \mathcal{S}(\mathbb{R}^n)
\end{align*}
by
\begin{align*}
\widehat{h}(\xi) := \mathcal{F}h(\xi) = \frac{1}{(2\pi)^{n/2}}\int_{\mathbb{R}^n} h(x)e^{-ix\cdot \xi}\,d\mathcal{L}^n(x).
\end{align*}
We first assume $f,g \in \mathcal{S}(\mathbb{R}^n)$. The formal statement concerns real-valued finite-energy data, but this reduction is carried out in the complexified spaces because the Fourier transform naturally takes complex values; the final real-valued case is obtained by applying the complex identity to real-valued data. Let
\begin{align*}
u: \mathbb{R}\times \mathbb{R}^n \to \mathbb{C}
\end{align*}
be the corresponding smooth solution of $\partial_t^2u-\Delta u=0$ with $u(0,\cdot)=f$ and $\partial_tu(0,\cdot)=g$. For each fixed $t \in \mathbb{R}$, define
\begin{align*}
\widehat{u}(t,\cdot): \mathbb{R}^n \to \mathbb{C}
\end{align*}
to be the spatial Fourier transform of $u(t,\cdot)$.
[/step]
[step:Solve each Fourier mode as a harmonic oscillator]
Taking the spatial Fourier transform of $\partial_t^2u-\Delta u=0$ gives, for each $\xi \in \mathbb{R}^n$,
\begin{align*}
\partial_t^2\widehat{u}(t,\xi) + |\xi|^2\widehat{u}(t,\xi)=0.
\end{align*}
The initial conditions are $\widehat{u}(0,\xi)=\widehat{f}(\xi)$ and $\partial_t\widehat{u}(0,\xi)=\widehat{g}(\xi)$. Hence, for $\xi \neq 0$,
\begin{align*}
\widehat{u}(t,\xi)=\cos(t|\xi|)\widehat{f}(\xi)+\frac{\sin(t|\xi|)}{|\xi|}\widehat{g}(\xi).
\end{align*}
At $\xi=0$ this formula is interpreted by the continuous extension
\begin{align*}
\frac{\sin(t|\xi|)}{|\xi|}=t.
\end{align*}
Differentiating with respect to $t$ gives
\begin{align*}
\partial_t\widehat{u}(t,\xi)=-|\xi|\sin(t|\xi|)\widehat{f}(\xi)+\cos(t|\xi|)\widehat{g}(\xi).
\end{align*}
[guided]
In this step we are in the Schwartz-data reduction: $f,g\in\mathcal{S}(\mathbb{R}^n)$ and $u:\mathbb{R}\times\mathbb{R}^n\to\mathbb{C}$ is the corresponding smooth solution of $\partial_t^2u-\Delta u=0$ with $u(0,\cdot)=f$ and $\partial_tu(0,\cdot)=g$. For each fixed $t\in\mathbb{R}$, $\widehat{u}(t,\cdot):\mathbb{R}^n\to\mathbb{C}$ denotes the spatial Fourier transform of $u(t,\cdot)$. The spatial Fourier transform turns the partial differential equation into an ordinary differential equation in the time variable. With the convention
\begin{align*}
\widehat{h}(\xi)=\frac{1}{(2\pi)^{n/2}}\int_{\mathbb{R}^n}h(x)e^{-ix\cdot \xi}\,d\mathcal{L}^n(x),
\end{align*}
the Fourier transform of $\Delta u(t,\cdot)$ is $-|\xi|^2\widehat{u}(t,\xi)$. Therefore the transformed equation is
\begin{align*}
\partial_t^2\widehat{u}(t,\xi)+|\xi|^2\widehat{u}(t,\xi)=0.
\end{align*}
For each fixed $\xi$, this is the scalar harmonic oscillator with angular frequency $|\xi|$. The initial values are obtained by transforming the initial data:
\begin{align*}
\widehat{u}(0,\xi)=\widehat{f}(\xi),
\end{align*}
and
\begin{align*}
\partial_t\widehat{u}(0,\xi)=\widehat{g}(\xi).
\end{align*}
Solving this ordinary differential equation gives
\begin{align*}
\widehat{u}(t,\xi)=\cos(t|\xi|)\widehat{f}(\xi)+\frac{\sin(t|\xi|)}{|\xi|}\widehat{g}(\xi)
\end{align*}
for $\xi \neq 0$. The quotient has the finite limit $t$ as $\xi \to 0$:
\begin{align*}
\lim_{\xi\to 0}\frac{\sin(t|\xi|)}{|\xi|}=t.
\end{align*}
Thus the formula is extended at $\xi=0$ by setting this quotient equal to $t$. Differentiating the displayed formula in $t$ gives
\begin{align*}
\partial_t\widehat{u}(t,\xi)=-|\xi|\sin(t|\xi|)\widehat{f}(\xi)+\cos(t|\xi|)\widehat{g}(\xi).
\end{align*}
This step isolates the essential mechanism: every Fourier frequency evolves independently, and energy conservation becomes a pointwise algebraic identity in the variables $\widehat{f}(\xi)$ and $\widehat{g}(\xi)$.
[/guided]
[/step]
[step:Cancel the mixed terms in frequency space]
Fix $t \in \mathbb{R}$ and $\xi \in \mathbb{R}^n$. Define the maps
\begin{align*}
A: \mathbb{R}^n \to \mathbb{C}, \qquad B: \mathbb{R}^n \to \mathbb{C}, \qquad c: \mathbb{R}\times\mathbb{R}^n \to \mathbb{R}, \qquad s: \mathbb{R}\times\mathbb{R}^n \to \mathbb{R}
\end{align*}
by
\begin{align*}
A(\eta):=|\eta|\widehat{f}(\eta), \qquad B(\eta):=\widehat{g}(\eta), \qquad c(\tau,\eta):=\cos(\tau|\eta|), \qquad s(\tau,\eta):=\sin(\tau|\eta|),
\end{align*}
for $\eta \in \mathbb{R}^n$ and $\tau \in \mathbb{R}$. Then
\begin{align*}
\partial_t\widehat{u}(t,\xi)=-s(t,\xi)A(\xi)+c(t,\xi)B(\xi),
\end{align*}
and
\begin{align*}
|\xi|\widehat{u}(t,\xi)=c(t,\xi)A(\xi)+s(t,\xi)B(\xi).
\end{align*}
Using $c(t,\xi),s(t,\xi)\in \mathbb{R}$ and $c(t,\xi)^2+s(t,\xi)^2=1$, we compute
\begin{align*}
|\partial_t\widehat{u}(t,\xi)|^2+|\xi|^2|\widehat{u}(t,\xi)|^2=|A(\xi)|^2+|B(\xi)|^2.
\end{align*}
Equivalently,
\begin{align*}
|\partial_t\widehat{u}(t,\xi)|^2+|\xi|^2|\widehat{u}(t,\xi)|^2=|\xi|^2|\widehat{f}(\xi)|^2+|\widehat{g}(\xi)|^2.
\end{align*}
[/step]
[step:Convert the frequency identity to physical-space energy]
Integrate the pointwise frequency identity over $\mathbb{R}^n$ with respect to $\mathcal{L}^n(\xi)$:
\begin{align*}
\int_{\mathbb{R}^n}\left(|\partial_t\widehat{u}(t,\xi)|^2+|\xi|^2|\widehat{u}(t,\xi)|^2\right)\,d\mathcal{L}^n(\xi)=\int_{\mathbb{R}^n}\left(|\widehat{g}(\xi)|^2+|\xi|^2|\widehat{f}(\xi)|^2\right)\,d\mathcal{L}^n(\xi).
\end{align*}
By the [Plancherel Theorem](/theorems/247) for the symmetric [Fourier transform](/page/Fourier%20Transform), the Fourier transform extends from $\mathcal{S}(\mathbb{R}^n)$ to a unitary map on $L^2(\mathbb{R}^n)$. Its hypotheses apply to the $L^2(\mathbb{R}^n)$ functions $\partial_tu(t,\cdot)$ and $g$, and to the spatial derivatives $\partial_{x_i}u(t,\cdot)$ and $\partial_{x_i}f$ for $1\leq i\leq n$, because the present Schwartz-data reduction gives these functions in $\mathcal{S}(\mathbb{R}^n)\subset L^2(\mathbb{R}^n)$. Thus
\begin{align*}
\int_{\mathbb{R}^n}|\partial_tu(t,x)|^2\,d\mathcal{L}^n(x)=\int_{\mathbb{R}^n}|\partial_t\widehat{u}(t,\xi)|^2\,d\mathcal{L}^n(\xi),
\end{align*}
\begin{align*}
\int_{\mathbb{R}^n}|g(x)|^2\,d\mathcal{L}^n(x)=\int_{\mathbb{R}^n}|\widehat{g}(\xi)|^2\,d\mathcal{L}^n(\xi),
\end{align*}
and
\begin{align*}
\int_{\mathbb{R}^n}|\nabla u(t,x)|^2\,d\mathcal{L}^n(x)=\int_{\mathbb{R}^n}|\xi|^2|\widehat{u}(t,\xi)|^2\,d\mathcal{L}^n(\xi).
\end{align*}
Also,
\begin{align*}
\int_{\mathbb{R}^n}|\nabla f(x)|^2\,d\mathcal{L}^n(x)=\int_{\mathbb{R}^n}|\xi|^2|\widehat{f}(\xi)|^2\,d\mathcal{L}^n(\xi).
\end{align*}
Substituting these four identities gives
\begin{align*}
\int_{\mathbb{R}^n}\left(|\partial_tu(t,x)|^2+|\nabla u(t,x)|^2\right)\,d\mathcal{L}^n(x)=\int_{\mathbb{R}^n}\left(|g(x)|^2+|\nabla f(x)|^2\right)\,d\mathcal{L}^n(x).
\end{align*}
Multiplying by $1/2$ proves the theorem for Schwartz data.
[/step]
[step:Approximate finite-energy data by Schwartz data]
By the [Density of Test Functions in the Schwartz Space](/theorems/455) theorem, in its Sobolev and Lebesgue-space forms, $\mathcal{S}(\mathbb{R}^n)$ is dense in the [Sobolev space](/page/Sobolev%20Space) $H^1(\mathbb{R}^n)$ and in $L^2(\mathbb{R}^n)$. Applying this theorem to the given $f\in H^1(\mathbb{R}^n)$ and $g\in L^2(\mathbb{R}^n)$, let $(f_k)_{k=1}^{\infty}$ be a sequence in $\mathcal{S}(\mathbb{R}^n)$ such that $f_k \to f$ in $H^1(\mathbb{R}^n)$, and let $(g_k)_{k=1}^{\infty}$ be a sequence in $\mathcal{S}(\mathbb{R}^n)$ such that $g_k \to g$ in $L^2(\mathbb{R}^n)$. For each $k\in\mathbb{N}$, let
\begin{align*}
u_k: \mathbb{R}\times\mathbb{R}^n \to \mathbb{C}
\end{align*}
be the Schwartz-data solution with initial data $u_k(0,\cdot)=f_k$ and $\partial_tu_k(0,\cdot)=g_k$.
For each $k$, the already proved Schwartz-data identity gives, for every $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*}
By the independently established [Wave Operator Generates a Unitary $C_0$-Group](/theorems/3146) theorem, used here only for existence, uniqueness, and continuous dependence of the free wave flow, for each initial 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 for each fixed $t\in\mathbb{R}$ the solution map sends $(h_0,h_1)$ continuously into $H^1(\mathbb{R}^n)\times L^2(\mathbb{R}^n)$. This result is a prior well-posedness construction for the free [wave equation](/page/Wave%20Equation) and is not derived from the energy identity proved in the present theorem. The hypotheses of this theorem apply because $(f_k,g_k)$ and $(f,g)$ all lie in $H^1(\mathbb{R}^n)\times L^2(\mathbb{R}^n)$, each $u_k$ is the corresponding smooth finite-energy solution, and the function $u$ in the 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 the given $u$ with the well-posedness solution. Therefore
\begin{align*}
u_k(t,\cdot)\to u(t,\cdot) \quad \text{in } H^1(\mathbb{R}^n),
\end{align*}
and
\begin{align*}
\partial_tu_k(t,\cdot)\to \partial_tu(t,\cdot) \quad \text{in } L^2(\mathbb{R}^n).
\end{align*}
Taking limits in the identity for $u_k$ yields
\begin{align*}
\frac{1}{2}\int_{\mathbb{R}^n}\left(|\partial_tu(t,x)|^2+|\nabla u(t,x)|^2\right)\,d\mathcal{L}^n(x)=\frac{1}{2}\int_{\mathbb{R}^n}\left(|g(x)|^2+|\nabla f(x)|^2\right)\,d\mathcal{L}^n(x).
\end{align*}
[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]
[/step]
[step:Conclude the conservation identity for every time]
The preceding step proves the displayed equality for an arbitrary fixed $t\in\mathbb{R}$. Therefore, for every $t\in\mathbb{R}$,
\begin{align*}
\frac{1}{2}\int_{\mathbb{R}^n}\left(|\partial_t u(t,x)|^2 + |\nabla u(t,x)|^2\right)\,d\mathcal{L}^n(x) = \frac{1}{2}\int_{\mathbb{R}^n}\left(|g(x)|^2 + |\nabla f(x)|^2\right)\,d\mathcal{L}^n(x).
\end{align*}
This is exactly the Fourier energy identity for the finite-energy free wave equation.
[/step]