The particle-in-a-box model confines a particle of mass m to a one-dimensional interval of length L with infinitely high walls. The wavefunction vanishes at both walls. Inside, the allowed standing waves fit an integer number of half-wavelengths across the interval.
The energy is proportional to the square of the number of half-wavelengths. The first state has one half-wave and a positive energy with the potential floor set to zero. The sine solution vanishes everywhere and cannot represent a particle.
Halving the box length multiplies every energy and gap by four. This gives a simple model for why stronger confinement can produce larger energy gaps. Real wells have finite walls, so their states can extend outside the nominal box.
The box also gives a way to identify the first two states by their shapes. The ground wavefunction has no zero inside the box. The next wavefunction has one interior zero at the center, where its detection probability density vanishes.