An attempt to do ps7 pr. 3 with mathematica.  Revisit later and see if I can figure out how to do this one off paper.

ClearAll[x, abs, psi, beta, h, h2, inner, e]

$Assumptions = beta > 0 ;

psi := HeavisideTheta[ # ] Exp[ -beta # ] + HeavisideTheta[ -# ] Exp[ beta # ] & ;

h[f_, x_] := -(ℏ^2/2m) D[f[x], {x,2}] + m ω^2 x^2 f[x]/2;

hPsi = (h[psi, #] /. DiracDelta'[x_] -> -DiracDelta[x]/x) & ;

inner[f_, g_] := Integrate[f[x] g[x], {x, -Infinity, Infinity}] ;

Row[{"H Ψ = ", hPsi[x] /. beta -> β // Simplify // TraditionalForm}]

e[f_, hf_] := inner[ f, hf]/inner[f,f] ;

averageE = e[psi, hPsi] ;
averageE /. beta -> β // TraditionalForm

(*Plot[{psi[x], 0.1 + Exp[-beta Abs[x] ]} /. beta -> 1, {x, -10, 10}]
*)

dEdBeta = D[averageE, beta]
s = Solve[ dEdBeta== 0, beta]