2.5.5 \(u_t + u u_x + \mu u_{xx}\) IC as UnitBox

problem number 95

From Mathematica DSolve help pages.

Viscous fluid flow with initial conditions as UnitBox

Solve for \(u(x,t)\) \[ u_t + u u_x = \mu u_{xx} \]

With initial conditions

\(u\left ( x,0\right ) =\left \{ \begin {array} [c]{ccc}1 & & |x| \leq \frac {1}{2} \\ 0 & & \text {otherwise} \end {array} \right . \)

Mathematica

ClearAll["Global`*"]; 
pde =  D[u[x, t], {t}] + u[x, t]*D[u[x, t], {x}] == mu*D[u[x, t], {x, 2}]; 
ic  = u[x, 0] == UnitBox[x]; 
sol =  AbsoluteTiming[TimeConstrained[DSolve[{pde, ic}, u[x, t], {x, t}], 60*10]];
 

\[\left \{\left \{u(x,t)\to \frac {e^{\frac {t+1}{4 \mu }} \left (\text {Erf}\left (\frac {2 t-2 x+1}{4 \sqrt {\mu t}}\right )-\text {Erf}\left (\frac {2 t-2 x-1}{4 \sqrt {\mu t}}\right )\right )}{e^{\frac {t+1}{4 \mu }} \left (\text {Erfc}\left (\frac {2 t-2 x-1}{4 \sqrt {\mu t}}\right )-\text {Erfc}\left (\frac {2 t-2 x+1}{4 \sqrt {\mu t}}\right )\right )+e^{\frac {x}{2 \mu }} \left (\text {Erfc}\left (\frac {1-2 x}{4 \sqrt {\mu t}}\right )+e^{\left .\frac {1}{2}\right /\mu } \text {Erfc}\left (\frac {2 x+1}{4 \sqrt {\mu t}}\right )\right )}\right \}\right \}\]

Maple

restart; 
interface(showassumed=0); 
pde := diff(u(x, t), t)+u(x, t)*(diff(u(x, t), x)) = mu*(diff(u(x, t), x$2)); 
ic  := u(x,0)=piecewise( x< -1/2 or x>1/2,0, 1); 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde, ic],u(x,t)) assuming mu > 0,t>0),output='realtime'));
 

sol=()