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?

  • 1
    $\begingroup$ 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]. $\endgroup$
    – Roman
    Commented Nov 7, 2020 at 16:13
  • 1
    $\begingroup$ Related: mathematica.stackexchange.com/questions/186935/…, mathematica.stackexchange.com/questions/83552/… $\endgroup$
    – Michael E2
    Commented Nov 7, 2020 at 18:29

2 Answers 2


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];
 Integrate[φ[n1_, x]*φ[n2_, 
      x], {x, -∞, ∞}] /; (n1 =!= n2 ) = 0;
 Integrate[φ[n1_, x]*φ[n1_, 
     x], {x, -∞, ∞}] = 1;

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.

  • $\begingroup$ 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]}." $\endgroup$
    – Michael E2
    Commented Nov 7, 2020 at 18:09
  • $\begingroup$ I checked it again, I get 0 and 1. Try with a new kernel. I have MMA 12.1.0 $\endgroup$ Commented Nov 7, 2020 at 19:21
  • $\begingroup$ 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.) $\endgroup$
    – Michael E2
    Commented Nov 7, 2020 at 19:37
  • $\begingroup$ I assumed n>=0 for the harmonic oscillator. I do not know where hermite polynomials with non integer index pop up. $\endgroup$ Commented Nov 7, 2020 at 19:43
  • $\begingroup$ 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.) $\endgroup$
    – Michael E2
    Commented 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[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

    Plot[ParabolicCylinderD[n, Sqrt[2] Sinh[x]], {x, -3, 3}], 
  {{n, 3.998}, 3.5, 5.5}, ControlPlacement -> Top]

Eigenfunctions of oscillator problem

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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.