Taken from Introduction to Quantum mechanics, second edition, by David Griffiths, page 47.
Solve for \(f(x,t)\) \[ I \hbar f_t = - \frac {\hbar ^2}{2 m} f_{xx} \] With initial conditions \(f(x,0) = A x (a-x)\) for \(0\leq x \leq a\) and zero otherwise.
Mathematica ✓
ClearAll["Global`*"]; ic = Piecewise[{{A*x*(a - x), 0 <= x <= a}, {0, True}}]; pde = I*h*D[f[x, t], t] == -((h^2*D[f[x, t], {x, 2}])/(2*m)); sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, f[x, 0] == ic}, f[x, t], {x, t}, Assumptions -> a > 0], 60*10]];
\[\left \{\left \{f(x,t)\to \frac {\int _{-\infty }^{\infty }-\frac {A \exp \left (-\frac {i K[1] (2 a m-2 x m+h t K[1])}{2 m}\right ) \left (a K[1]+e^{i a K[1]} (a K[1]+2 i)-2 i\right )}{K[1]^3}dK[1]}{2 \pi }\right \}\right \}\]
Maple ✓
restart; ic:=f(x,0)=piecewise(0<=x and x<=a,A*x*(a-x),0); pde :=I*h*diff(f(x,t),t) = -h^2/(2*m)*diff(f(x,t),x$2); cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',dsolve([pde,ic],f(x,t)) assuming a>0),output='realtime')); sol:=convert(sol,Int);
\[f \left (x , t\right ) = -\frac {\left (a \left (\int _{-\infty }^{\infty }\frac {{\mathrm e}^{-\frac {i \left (\frac {h s t}{2}+\left (a -x \right ) m \right ) s}{m}}}{s^{2}}d s \right )+a \left (\int _{-\infty }^{\infty }\frac {{\mathrm e}^{-\frac {i h s^{2} t}{2 m}+i s x}}{s^{2}}d s \right )-2 i \left (\int _{-\infty }^{\infty }\frac {{\mathrm e}^{-\frac {i \left (\frac {h s t}{2}+\left (a -x \right ) m \right ) s}{m}}}{s^{3}}d s \right )+2 i \left (\int _{-\infty }^{\infty }\frac {{\mathrm e}^{-\frac {i h s^{2} t}{2 m}+i s x}}{s^{3}}d s \right )\right ) A}{2 \pi }\]
____________________________________________________________________________________