# Matrix elements of the free particle Hamiltonian

This is an interesting question. It is reminicent of the popular (but fallacious) "proof" that
$$
\exp\{ia\hat p\}\psi(x) \equiv \exp\{a\partial_x\}\psi(x)=\psi(x+a)
$$
that claims that applying the exponential of the derivative operator to $\psi$ gives the Taylor expanion of $\psi(x+a)$ about $x$. The problem is that if $\psi(x)$ is $C^\infty$ and of compact support, then each term of the Taylor series is always exactly zero outside the support of $\psi(x)$ and so $\psi(x)$ can never become non-zero outside its original region of support. Of course $C^\infty$ functions of compact support *do not* have Taylor series that converge to the function, and the resolution of this paradox is to realise that the appropriate definition of $\exp\{ia \hat p\}$ comes from its spectral decomposition. In other words we should Fourier expand $\psi(x)= \langle x|\psi\rangle$ to get $\psi(p)\equiv \langle p|\psi\rangle $, multiply by $e^{iap}$ and then invert the Fourier expansion. Then we obtain $\psi(x+a)$.

The same situation applies here. The literal definition of $H$ as a second derivative operator is not sufficiently precise. We must choose a domain for $\hat H$ such that it is truly self-adjoint and so possesses a complete set of eigenfunctions. The action of $\hat H$ on any function in its domain is then defined in terms of the eigenfunction expansion.

The core of the issue is that, for unbounded operators $\hat A$, **the operator exponential is not defined in terms of the power series $\exp(\hat A) = \sum_{k=0}^\infty \frac{\hat A^n}{n!}$.** And it can not be defined that way, as we don't have a guarantee that this series converges.
Instead, we use the spectral theorem to define
$$ \exp(\hat A) = \int \mathrm e^a\, |a \rangle\!\langle a| \, \mathrm da \;, \tag{1} $$
where $|a \rangle\!\langle a| \, \mathrm da$ is the physicist's notation for the projection-valued measure $\mathrm dP_a$.
Crucially, this is the definition used in Stone's theorem on strongly continuous unitary groups.

This means in particular that the time evolution of $|\psi_2\rangle$ is *not* $|\psi_2(\mathrm dt)\rangle = |\psi_2\rangle - \frac{\mathrm i\, \mathrm dt}{\hbar}\hat H |\psi_2\rangle + \mathcal O(\mathrm dt^2)$ as suggested in the question.
Hence it is not a contradiction that
$$\langle \psi_1 | \hat H | \psi_2 \rangle = 0 \;. $$

Side note: As explained in [Reed, Simon (1981), VIII.3], definition (1) agrees with the power series for the case of bounded $\hat A$. Further, for all $|\psi\rangle$ that can be written as $|\psi\rangle = \int_{-M}^M |a \rangle\!\langle a|\varphi\rangle \, \mathrm da$ for some $M \in \mathbb R$ and some $|\varphi\rangle$, the power series $\sum_{k=0}^\infty \frac{\hat A^n}{n!} |\psi\rangle$ converges to $\exp(\hat A)|\psi\rangle$ [Reed, Simon (1981), VIII.5].

As mentioned in the answer by mike stone, there is a simpler example demonstrating the same problem. Let $D(\alpha) = \exp(\mathrm i \alpha \hat p)$ be the translation operator ($\hbar=1$). Using definition (1), we immediately see that $$ \langle x | D(\alpha) | \psi \rangle = \int \mathrm e^{\mathrm i \alpha p} \langle x | p \rangle \langle p | \psi \rangle \,\mathrm dp = \langle x+\alpha | \psi \rangle \;. $$ If $\psi$ has compact support, this is obviously different from $$ \sum_{k=0}^\infty \frac{ \langle x | (\mathrm i \alpha \hat p)^n | \psi \rangle }{n!} = \sum_{k=0}^\infty \frac{ (\alpha \partial_x)^n }{n!} \langle x | \psi \rangle = \sum_{k=0}^\infty \frac{(\mathrm i\alpha)^n}{n!} \int p^n \langle x | p \rangle \langle p | \psi \rangle \,\mathrm dp \;. $$ The latter expression is only correct if we can exchange the order of the integral and the series, as explained also in [Holstein, Swift (1972)].