Solution (source code)

= Solution

The requested <energy eigenvalue> is $E_2$. By the <Born rule>, its <probability amplitude> is the <inner product> $c_2=\langle\psi_2,\Psi(0)\rangle$. Put $u=\pi x/a$ and use $e^{iu}\sin u=\tfrac12\sin2u+i\sin^2u$:
$$
c_2=\frac2\pi\int_0^\pi\sin2u\,e^{iu}\sin u\,du=\frac1\pi\int_0^\pi\sin^22u\,du+\frac{2i}\pi\int_0^\pi\sin2u\sin^2u\,du=\frac12.
$$
The first integral is $\pi/2$; the second is zero under $u\mapsto\pi-u$. Therefore
$$
\boxed{\Pr(E=E_2)=|c_2|^2=\frac14.}
$$
For the time-independent <Hamiltonian operator>, expand in its <orthonormal basis> of <energy eigenstates>:
$$
\Psi(x,t)=\sum_{n\geq1}c_n e^{-iE_nt/\hbar}\psi_n(x).
$$
<Unitary time evolution> changes $c_2$ to $c_2e^{-iE_2t/\hbar}$, whose modulus is unchanged. Thus the same <energy measurement> <probability> holds at every time, even though relative <quantum phases> and other measurements can change.