[step:Compute the energy in the spectral representation and cancel the phase]
Since $\psi(t)\in D(\mathcal H)$, the energy [inner product](/page/Inner%20Product) is well-defined. Using $\mathcal H=U^{-1}M_hU$, unitarity of $U$, and $U\psi(t)=\theta_t f_0$, we obtain
\begin{align*}
(\mathcal H\psi(t),\psi(t))_H=(M_h\theta_t f_0,\theta_t f_0)_{L^2(X,\mathcal A,\mu)}.
\end{align*}
By the definition of the $L^2$ inner product, linear in the first argument,
\begin{align*}
(M_h\theta_t f_0,\theta_t f_0)_{L^2(X,\mathcal A,\mu)}=\int_X h\theta_t f_0\,\overline{\theta_t f_0}\,d\mu(x).
\end{align*}
Since $|\theta_t|^2=1$, this becomes
\begin{align*}
\int_X h\theta_t f_0\,\overline{\theta_t f_0}\,d\mu(x)=\int_X h|f_0|^2\,d\mu(x).
\end{align*}
Again using unitarity of $U$ and $\mathcal H=U^{-1}M_hU$,
\begin{align*}
\int_X h|f_0|^2\,d\mu(x)=(M_hf_0,f_0)_{L^2(X,\mathcal A,\mu)}=(\mathcal H\psi_0,\psi_0)_H.
\end{align*}
Thus
\begin{align*}
(\mathcal H\psi(t),\psi(t))_H=(\mathcal H\psi_0,\psi_0)_H.
\end{align*}
Since $t\in\mathbb R$ was arbitrary, the equality holds for every $t\in\mathbb R$.
[/step]