So, one of my homework problems reads
A particle is trapped in an infinitely deep square well of width $a$, suddenly the walls are separated by infinite distance so that the particle becomes free. What is the probability that the particle has momentum between $p$ and $p + dp$?
I know that if the wavefunction of a particle is $\Psi(x)$, then the probability of finding the momentum between $p$ and $p+\text{d}p$ is given by- $|a(p)|^2 \text{d}p$ where $a(p)$ is given by- $$a(p)=\dfrac{1}{\sqrt{2\pi \hbar}}\displaystyle \int_{-\infty}^{+\infty}\Psi(x)\ e^{-ipx/\hbar}\ \text{d}x$$ So, the question is- How does the wavefunction change with this abrupt change in the well's dimensions. And what quantity does not change for the particle even after the change of length between walls. To the second question, I think the answer is energy, but which energy state should I assume the particle to be in if it is not mentioned beforehand, since the energy in a well is given by- $\dfrac{n^2h^2}{8mL^2}$?