Why did you do the summation of the function instead of integrating it??

The energies are discrete, hence the summation.

You must write
[tex] \Psi(x,t=0) = \sum_n c_n \psi_n(x) [/tex]
where the [itex] \psi_n(x) [/itex] are the energy eigenstates, [itex] \sqrt{2/a} \, sin(n \pi x/a) [/itex] (for a well located between x=0 and x=a). What you have to do is to find the coefficients c_n using the orthonormality of the sine wavefunctions. Once you have that, the wavefunction at any time is