Let us consider a particle of mass m that is confined to one-dimensional region 0 ≤ x ≤ L or the particle is restricted to move along the x -axis between x=0 and x=L . Let the particle can move freely in either direction, between x=0 and x=L . The endpoints of the region behave as ideally reflecting barriers so that the particle can not leave the region. A potential energy function V(x) for this situation is shown in the figure below.

Particle in one-dimensional box a) wave function b) probability density