Consider a particle confined in a 1D potential well of lenght L. Derive the normalized wavefunctions and energies of the eigenstates of the system in terms of the quantum number n, working from the time independent Schördinger equation.
With the particle initially in the ground state (n=1) in the potential, the potential well instantaneously expands to twice it's original size.

Work out the probability, immediately after this change takes place, of measuring the system in (i) its new ground state and (ii) its new first excited state.

2. Relevant equations
The wavefunction can be written in terms of the eigenstates as follows:

Consider a particle confined in a 1D potential well of lenght L. Derive the normalized wavefunctions and energies of the eigenstates of the system in terms of the quantum number n, working from the time independent Schördinger equation.
With the particle initially in the ground state (n=1) in the potential, the potential well instantaneously expands to twice it's original size.

Work out the probability, immediately after this change takes place, of measuring the system in (i) its new ground state and (ii) its new first excited state.

2. Relevant equations
The wavefunction can be written in terms of the eigenstates as follows:

First of all, the problem is ambiguous, because it does not tell you how the walls move. You have assumed that one wall stays put at [itex]x=0[/itex], and the other moves from [itex]x=L[/itex] to [itex]x=2L[/itex]. If the walls instead moved from [itex]x=\pm L/2[/itex] to [itex]x=\pm L[/itex], the answer would be different.

Given your assumption (which is perfectly reasonable), your answer is correct. Note that [itex]a_2[/itex] has to be obtained by taking a limit, and that the result is [itex]a_2=1/\sqrt{2}[/itex]. All other [itex]a_m[/itex]'s with [itex]m[/itex] even are zero. Then, the sum over odd [itex]m[/itex] of [itex]|a_m|^2[/itex] is [itex]1/2[/itex], and adding [itex]|a_2|^2[/itex] yields at total of one.