Solution (source code)

= Solution

Inside the <infinite square well>, the <Hamiltonian (quantum mechanics)> is purely the <kinetic energy> operator,
$$
\boxed{\hat H=-\frac{\hbar^2}{2m}\frac{d^2}{dx^2},\qquad 0<x<L.}
$$
Its admissible <wavefunctions> obey the <boundary conditions> $\psi(0)=\psi(L)=0$ and vanish outside the interval. Equivalently write $\hat H=\hat p^2/(2m)+V(x)$ with $V=0$ inside and an infinite confining wall outside. The <boundary conditions> are part of the specification of this <Hamiltonian (quantum mechanics)>; the differential expression alone does not determine the spectrum.