Added May 23, 2019.
From Math 5587 midterm I, Fall 2016, practice exam, problem 3.
Solve for \(u(x,t)\)
With with \(u(x,0)=x^2\)
Mathematica ✓
ClearAll["Global`*"]; pde = D[u[x, t], t] + x*D[u[x, t], x] == 0; ic = u[x,0]==x^2; sol = AbsoluteTiming[TimeConstrained[DSolve[{pde,ic}, u[x, t], {x, t}], 60*10]];
Maple ✓
restart; pde := diff(u(x,t),t)+x*diff(u(x,t),x)=0; ic :=u(x,0)=x^2; cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde,ic],u(x,t))),output='realtime'));
Hand solution
Solve \(u_{t}+xu_{x}=0\) with \(u\left ( x,0\right ) =x^{2}\). Using the method of characteristics, the systems of characteristic lines are (from the PDE itself)
With initial conditions at \(s=0\)
Equation (1) gives
Equation (2) gives
From (5,6) solving for \(\xi \) gives
Equation (3) gives
___________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________