Working in a box of volume $V=L^3$, show that the number of allowed states of momentum with $x$ component in the range $p_x$ to $p_x+d p_x$ is $(L / 2 \pi) d p_x$. Convince yourself that you need to impose periodic boundary conditions on the wavefunction and its derivative to ensure no net particle flow out of the volume.