2.3.5 David Griffiths, page 47

problem number 88

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 {\left (\frac {1}{2}+\frac {i}{2}\right ) (-1)^{3/4} A \sqrt {h} \sqrt {t} \left (\sqrt {\pi } (h t+i m x (a-x)) \text {Erfi}\left (\frac {\left (\frac {1}{2}+\frac {i}{2}\right ) \sqrt {m} x}{\sqrt {h} \sqrt {t}}\right )-\sqrt {\pi } (h t+i m x (a-x)) \text {Erfi}\left (\frac {\left (\frac {1}{2}+\frac {i}{2}\right ) \sqrt {m} (x-a)}{\sqrt {h} \sqrt {t}}\right )+(-1-i) \sqrt {h} \sqrt {m} \sqrt {t} \left (a e^{\frac {i m x^2}{2 h t}}+x \left (e^{\frac {i m (a-x)^2}{2 h t}}-e^{\frac {i m x^2}{2 h t}}\right )\right )\right )}{\sqrt {2 \pi } m^{3/2} \sqrt {\frac {h t}{m}}}\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 ) =-1/2\,{\frac {A}{\pi } \left ( 2\,i\int _{-\infty }^{\infty }\!{\frac {1}{{s}^{3}}{{\rm e}^{{\frac {-i/2h{s}^{2}t}{m}}+isx}}}\,{\rm d}s-2\,i\int _{-\infty }^{\infty }\!{\frac {1}{{s}^{3}}{{\rm e}^{{\frac {-i \left ( 1/2\,hst+m \left ( a-x \right ) \right ) s}{m}}}}}\,{\rm d}s+\int _{-\infty }^{\infty }\!{\frac {1}{{s}^{2}}{{\rm e}^{{\frac {-i/2h{s}^{2}t}{m}}+isx}}}\,{\rm d}sa+\int _{-\infty }^{\infty }\!{\frac {1}{{s}^{2}}{{\rm e}^{{\frac {-i \left ( 1/2\,hst+m \left ( a-x \right ) \right ) s}{m}}}}}\,{\rm d}sa \right ) }\]

____________________________________________________________________________________