3.2.2 In a square

problem number 150

Added December 20, 2018.

Example 28, taken from https://www.mapleprimes.com/posts/209970-Exact-Solutions-For-PDE-And-Boundary--Initial-Conditions-2018

In 2 space dimensions Solve for \(f(x,y,t)\) \[ I \hslash f_t = - \frac {\hslash ^2}{2 m} \nabla ^2 f \] With initial conditions \(f(x,y,0) = \sqrt {2} \left ( \sin (2 \pi x) \sin (\pi y)+ \sin (\pi x) \sin (3 \pi y) \right )\) and boundary conditions \begin {align*} f(0,y,t) &= 0 \\ f(1,y,t) &= 0 \\ f(x,1,t) &= 0 \\ f(x,0,t) &= 0 \end {align*}

Mathematica

ClearAll["Global`*"]; 
ic  = f[x, y, 0] == Sqrt[2]*(Sin[2*Pi*x]*Sin[Pi*y]+Sin[Pi*x]*Sin[3*Pi*y]); 
bc  = {f[0, y, t] == 0, f[1, y, t] == 0, f[x, 1, t] == 0, f[x, 0, t] == 0}; 
pde =  I*h*D[f[x, y,t], t] == -h^2/(2*m)*(D[f[x, y, t], {x, 2}]+D[f[x, y, t], {y, 2}]); 
sol =  AbsoluteTiming[TimeConstrained[DSolve[{pde, bc, ic}, f[x, y, t], {x, y, t}], 60*10]];
 

\[\left \{\left \{f(x,y,t)\to \sqrt {2} e^{-\frac {5 i \pi ^2 h t}{m}} \left (\sin (\pi x) \sin (3 \pi y)+\sin (2 \pi x) \sin (\pi y) e^{\frac {5 i \pi ^2 h t}{2 m}}\right )\right \}\right \}\]

Maple

restart; 
pde := I*hbar* diff(f(x, y, t), t) = - hbar^2/(2*m)*  (diff(f(x, y, t), x$2)+diff(f(x, y, t), y$2)); 
ic  := f(x, y, 0) = sqrt(2)*(sin(2*Pi*x)*sin(Pi*y)+sin(Pi*x)*sin(3*Pi*y)); 
bc  := f(0, y, t) = 0, f(1, y, t) = 0, f(x, 1, t) = 0, f(x, 0, t) = 0; 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde, ic,bc],f(x,y,t))),output='realtime'));
 

\[f \left (x , y , t\right ) = \sqrt {2}\, \left (2 \cos \left (\pi x \right ) {\mathrm e}^{-\frac {5 i \pi ^{2} \mathit {hbar} t}{2 m}} \sin \left (\pi y \right )+{\mathrm e}^{-\frac {5 i \pi ^{2} \mathit {hbar} t}{m}} \sin \left (3 \pi y \right )\right ) \sin \left (\pi x \right )\]