The general solution to any Schrödinger eigenvalue problem with boundary value of the current operator over the boundary equal to zero and discrete discrete spectrum rests on the fact, that the general solution is not square integrable.
For the general algebraic eigenvalues, the solution, starting regularly at $x=0$, explodes exponentially on one of the boundary points. At the eigenvalue it changes its sign from $\pm \infty \to \mp \infty$.
The general solution of the oscillator problem is
DSolve[(-1/2 D[#, x, x] + 1/2 x^2 # == (n + 1/2) # &)
[E^(-x^2/2) g[x]], g[x], x]
{{g[x] -> C[1] HermiteH[n, x] +
C[2] Hypergeometric1F1[-(n/2), 1/2, x^2]}}
These functions ar special cases of $_1F_1$ and difficult to handle for integer parameters. But $C[2]\to 0, n\in N_+$ is the classical solution on $\mathbb R$ with $\partial^{n}\psi(\pm \infty)=0 \implies j(\pm \infty)=0$
The general solutions with no measure factor imposed, are parabolic cylinder functions
DSolve[(-1/2 D[ #, x, x] + 1/2 x^2 # == (n + 1/2) # &)[g[x]], g[x], x]
{{g[x] -> C[2] ParabolicCylinderD[-1 - n, I Sqrt[2] x] +
C[1] ParabolicCylinderD[n, Sqrt[2] x]}}
Both subspaces are identical with the $e^{\pm x^2/2} H[n,x]$, decaying on one side and exploding on the other side. All $L^2$-integrals will be considered non existent for general parameters.
Demo, Log scale on x range
Manipulate[
Plot[ParabolicCylinderD[n, Sqrt[2] Sinh[x]], {x, -3, 3}],
{{n, 3.998}, 3.5, 5.5}, ControlPlacement -> Top]
Near to an integer eigenvalue there is a minimum near zero. Finding the eigenvalue means shifting the turning point to $\infty$. As a mechanical problem it amounts to threading the needle at infinity with an elastic rod by control of the zero point of the elastic restoring force $-x \psi$, small at the origin, stiff for large x. This is an alternative aspect of the famous index theorems for positive differential operators on manifolds with boundaries, that rest on the diffusion processes of random paths.
Table[Integrate[φ[a, x]*φ[b, x], {x, -∞, ∞}], {a, 0, 6}, {b, 0, 6}]
. By the way it's better to define your function with exact numbers, not machine-precision numbers like-0.5
: useφ[n_, x_] = HermiteH[n, x]/Sqrt[2^n*n!*Sqrt[π]]*Exp[-x^2/2]
. $\endgroup$