2.3.5 David Griffiths, page 47

problem number 87

Taken from Introduction to Quantum mechanics, second edition, by David Griffiths, page 47.

Solve for f(x,t) Ift=22mfxx With initial conditions f(x,0)=Ax(ax) for 0xa 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]];
 

{{f(x,t)(12+i2)(1)3/4Aht(π(ht+imx(ax))Erfi((12+i2)mxht)π(ht+imx(ax))Erfi((12+i2)m(xa)ht)+(1i)hmt(aeimx22ht+x(eim(ax)22hteimx22ht)))2πm3/2htm}}

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(x,t)=A2π(2i1s3ei2hs2tm+isxds2i1s3eism(hst2+m(ax))ds+1s2ei2hs2tm+isxdsa+1s2eism(hst2+m(ax))dsa)

____________________________________________________________________________________