Simple Harmonic Oscillator - “Wag the Dog”

This illustrates the quantized solutions of the Schrödinger equation for the one-dimensional harmonic oscillator:
-(1/2)((d^2)/(dx^2))ψ(x)+(1/2)(x^2)ψ(x)=E ψ(x).
As you vary the energy, the normalization and boundary conditions (for even or odd parity) are only satisfied at discrete energy values of the solution of the second-order ordinary differential equation. Boundary conditions are met when ψ->0 as |x|->∞ and normalization is possible when (∫_(-∞)^∞)(ψ^2)(x)dx exists.

EnergyLevel[e_]:=Line[{{-Sqrt[e],e},{Sqrt[e],e}}];shoLevelPlot[e_]:=Plot[x^2,{x,-2.75,2.75},Epilog->Flatten[{Red,Thick,Line[{{-3.35,e},{3.35,e}}],Dashed,Black,Thickness[0.004],Table[EnergyLevel[w],{w,0.5,7.5,1}]},1],PlotStyle->{Black,Thickness[0.005]},AxesLabel->{"x"},PlotLabel->"harmonic oscillator potential",ImageSize->{275,275}];
Manipulate[
Grid[{{Plot[Evaluate[y[x]/.NDSolve[{-0.5y''[x]+0.5 (x^2)y[x]-energy y[x]==0,y[1.]==1.,y[-1.]==pf 1.},y,{x,-5.9,5.9}]],{x,-5.5,5.5},
PlotRange->{{-6,6},Automatic},
PlotStyle->Thickness[.007],
AxesLabel->{"x",""},
PlotLabel->"wavefunction ψ(x)",
ImageSize->{275,275},
ImagePadding->{{25,25},{25,25}}],
shoLevelPlot[energy]}}],
{{energy,0.5},0.,7.6,.00001,Appearance->"Labeled"},
{{energy,0.5,"allowed energy values (even parity)"},{0.5,2.5,4.5,6.5},Enabled->pf==1},
{{energy,0.5,"allowed energy values (odd parity)"},{1.5,3.5,5.5,7.5},Enabled->pf==-1},
{{pf,1,"parity"},{1->"even",-1->"odd"}},
SaveDefinitions->True]