This illustrates the quantized solutions of the Schrödinger equation for the one-dimensional harmonic oscillator:
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

as

and normalization is possible when

exists.