$Assumptions=$Assumptions && {b>0}
v[x_]=(m w^2)/2 x^2
f[x_]=x Exp[-b x]

ke=2 hbar^2/(2 m) Integrate[f'[x]^2,{x,0,Infinity}]
n=2 Integrate[f[x]^2,{x,0,Infinity}]
pe=2 Integrate[v[x]f[x]^2,{x,0,Infinity}]

(ke+pe)/n           
Simplify[%]

          2     2        2
         b  hbar    3 m w
Out[16]= -------- + ------
           2 m          2
                     2 b

