Variational Method

Clear[a]

$Assumptions={a > 0, c>0,m > 0, ℏ > 0, h>0, k >0,α>0}

Particle in a Box

Clear[a]

ℏ=h/(2 Pi)

ϕ[x_]:=x(x-a)

nom=Integrate[ϕ[x](((-(ℏ^2))/(2m)))D[ϕ[x],{x,2}],{x,0,a}]

denom=Integrate[((ϕ[x])^2),{x,0,a}]

Evar=nom/denom

N[Evar]

ϕ1[x_]:=Sin[ π x/a]

nom1=Integrate[ϕ1[x](((-(ℏ^2))/(2m)))D[ϕ1[x],{x,2}],{x,0,a}]

denom1=Integrate[((ϕ1[x])^2),{x,0,a}]

Evar1=nom1 / denom1

Harmonic Oscillator

ϕt[x_]:=Exp[-c (x^2)]

nom2=Integrate[ϕt[x]((((-(ℏ^2))/(2m)))D[ϕt[x],{x,2}]+(1/2)k (x^2) ϕt[x]),{x,-∞,∞}]

denom2=Integrate[((ϕt[x])^2),{x,-∞,∞}]

W=nom2/denom2

Solve[D[W,c]==0,c]

W

W /.{c->(((Sqrt[k]) (Sqrt[m]))/(2 ℏ))}

Perturbation theory

ψ0=(((α/π))^(1/4))(E^(-α (x^2)/2))

E1=b Integrate[ψ0 (x^4)ψ0,{x,-∞,∞}]

α=2π ν m/ℏ

E1