I want to evaluate moments of the Harmonic oscillator wave functions. I try the command
Integrate[x^p Exp[-x^2/2] HermiteH[n,x],{x,-Infinity,Infinity}, Assumptions->{Element[p,Integers,Element[n,Integers],n>=0,p>=0]
Mathematica replies that the integral doesn’t converge, which is clearly false.
Mathematica does correctly calculate the intgral if n and p are specified:
Integrate[x^2 Exp[-x^2/2] HermiteH[4,x],{x,-Infinity,Infinity}]
Sqrt(2 pi) 108
A related problem:
I want to express expressions like
x^p HermiteH[n,x]
as a sum of Hermite polynomials of different order. That is, I want to find the coefficients a[k] in the expansion
x^p HermiteH[n,x]=Sum[a[k] HermiteH[k,x],{k,0,n+p}].
This can be computed by repeated application of the identity:
x HermiteH[n,x]=HermiteH[n+1,x]/2 -n HermiteH[n-1,x]
How do I get Matematica to do this?