bhobba said:
It comes from replacing the E in the first equation by the energy operator.
More precisely, the
kinetic energy operator.
If we accept that the momentum p corresponds to the operator
$$\hat p = -i \hbar \frac {\partial}{\partial x} = -\frac{ih}{2\pi}\frac {\partial}{\partial x}$$
then from p = mv and ##K = \frac{1}{2}mv^2##, we can get
$$\hat K = \frac{\hat p^2}{2m} = - \frac{\hbar^2}{2m} \frac {\partial^2}{\partial x^2}
=-\frac{h^2}{8 \pi^2 m} \frac {\partial^2}{\partial x^2}$$
But why should we accept that particular form for ##\hat p##?
If we accept that a particle with momentum p has a wave function of the form
$$\psi = A e^{i(kx - \omega t)} = Ae^{i(\frac{2\pi}{\lambda}x - \omega t)}
= Ae^{i(\frac{2\pi p}{h}x - \omega t)} = Ae^{i(\frac{p}{\hbar}x - \omega t)}$$
then
$$\hat p \psi = -i \hbar \frac {\partial}{\partial x} \left[ Ae^{i(\frac{p}{\hbar}x - \omega t)} \right]
= p Ae^{i(\frac{p}{\hbar}x - \omega t)} = p \psi$$
But why should we accept that a particle with momentum p has a wave function of that form? Basically because we observe wavelike aspects of particle beams (diffraction and interference) that agree with de Broglie's hypothesis that ##\lambda = h / p##; and that is the generic (complex) wave function. (for one spatial dimension, of course)
And because the full-blown QM that we develop from this starting point (Schrödinger's equation etc.) makes predictions that agree with experiment, so far.