amjad-sh said:
my question is that if we didn't change the box the probability will be not equal to zero.
because the integral is the same in both cases.
I assume you mean e.g. the integral $$\int {\psi_{1,old}^* \psi_{1,new}} dx$$ where the particle starts in the ground state of the "old" box. If you expand the box then with the limits inserted this is $$\int_0^{L_{new}} {\psi_{1,old}^* \psi_{1,new}} dx$$ which gives you the amplitude for the particle to end up in the ground state of the "new" box.
If you don't expand the box, then you have $$\int_0^{L_{old}} {\psi_{1,old}^* \psi_{1,new}} dx$$ (note the upper limit) which I don't think makes sense because if you "chop off" ##\psi_{1,new}## in the middle, it's not a valid wave function for the "old" box. It doesn't go to zero at both sides of the box.
This raises the question, what do you do if you want to "shrink" the box suddenly? I don't know the answer (yet), but it seems to me that this might be a fundamentally different situation from "expanding" the box suddenly. Consider an analogy in thermo / stat mech. Suppose you have a box divided in half by a removable partition, with gas in one half and vacuum in the other. Yank the partition out and the gas expands freely to fill the entire box. However, you can't make the gas go back into one half by putting the partition back in. You can compress the gas into one half of the box by using a piston, but that's a different process.
Similarly with the particle in a box, if you want to "shrink" the box, I think you have to do it "gradually" in some sense.