The standing wave formed for a particle trapped within a box is analogous to the standing wave formed on a string stretched between two rigid supports. It can thus be deduced that the wave function ψn(x) of this particle has the same form as the displacement function yn(x) for the standing wave on a string stretched between the two rigid supports.
$\psi_{n} \left( x \right) = A sin \left( \frac{n \pi}{L} \right) x$
For a particle trapped within a box, U = 0 inside the box, and the general time-independent Schrodinger equation becomes
$- \frac{h^{2}}{2m} \frac{d^{2} \psi}{dx^{2}} = E \psi$