# Integral involving orthogonal functions (quantum harmonic oscillator eigenstates)

I have a question about the capabilities of the Integrate command for general parameters.

We know that there is a system of functions:

\[CurlyPhi][n_, x_] =
HermiteH[n, x]/Sqrt[2^n*n!*Sqrt[\[Pi]]]*Exp[-0.5 x^2];


and we know that for nonnegative integer n parameters, these functions are orthonormal in the usual sense of integration. However the following integral:

Integrate[\[CurlyPhi][a, x]*\[CurlyPhi][b,
x], {x, -\[Infinity], \[Infinity]},
Assumptions -> {a \[Element] Integers, a >= 0, b \[Element] Integers,
b >= 0} ]


supposedly does not converge (error Integrate::idiv). The correct result should be a Kronecker-delta function.

Have I made a coding error in the assumptions, or should some other command than Integrate be used?

• The closest I've ever got to a solution was to do a finite table: 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]. Nov 7, 2020 at 16:13
• Nov 7, 2020 at 18:29

What do mean by "not converge"? MMA simply gives the input back because a and b have no value. MMA can not evaluate the integral symbolically. For pos. integer a and b it will evaluate. If you need symbolic evaluation, you can teach MMA by e.g.:

φ[n_ /; NumericQ, x_] =
HermiteH[n, x]/Sqrt[2^n*n!*Sqrt[π]]*Exp[-0.5 x^2];
Unprotect[Integrate];
Integrate[φ[n1_, x]*φ[n2_,
x], {x, -∞, ∞}] /; (n1 =!= n2 ) = 0;
Integrate[φ[n1_, x]*φ[n1_,
x], {x, -∞, ∞}] = 1;
Protect[Integrate];


Then the following evaluate as you request:

Integrate[φ[n1, x]*φ[n2, x], {x, -∞, ∞}]
Integrate[φ[n1, x]*φ[n1, x], {x, -∞, ∞}]


By the way, "convergence" has quite another meaning, look it up.

• The OP's code produces this for me: "Integrate::idiv: Integral of (2^(1/2 (-a-b)) E^-x^2 HermiteH[a,x] HermiteH[b,x])/(Sqrt[[Pi]] Sqrt[a! b!]) does not converge on {-[Infinity],[Infinity]}." Nov 7, 2020 at 18:09
• I checked it again, I get 0 and 1. Try with a new kernel. I have MMA 12.1.0 Nov 7, 2020 at 19:21
• I have 12.1.1. Maybe there's a version difference. I don't think the integral converges if a, b are nonintegers, so perhaps the Integers assumption is dropped. Of course the integral converges when a and b are integers, but Integrate[] reports divergence. (Note that I'm not talking about your re-definition of Integrate, just the original code with the standard Integrate.) Nov 7, 2020 at 19:37
• I assumed n>=0 for the harmonic oscillator. I do not know where hermite polynomials with non integer index pop up. Nov 7, 2020 at 19:43
• They pop up from the defining ODE. I just mean that Integrate takes this into account when it reports the integral does not converge. I think that's what causes the error that Integrate reports, which is why the OP thought the integral "supposedly does not converge." I'm responding to the first sentence in your answer with a suggestion why the OP says "not converge." (I haven't tried your code yet, because I don't want to mess with Integrate and then have to kill my kernel.) Nov 7, 2020 at 19:49

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 HermiteH[n, x] +
C Hypergeometric1F1[-(n/2), 1/2, x^2]}}


These functions ar special cases of $$_1F_1$$ and difficult to handle for integer parameters. But $$C\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 ParabolicCylinderD[-1 - n, I Sqrt x] +
C ParabolicCylinderD[n, Sqrt 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 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.