On the harmonic oscillator inside an infinite potential well

The exact solution to Schrodinger’s equation for a three‐dimensional harmonic oscillator confined by two impenetrable walls is presented. The energy levels of this system are obtained as a function of wall separation as well as distance of the center of the oscillator to the walls. The force exerted by the walls on the oscillator is also evaluated, showing a classical behavior.