Added Nov 25, 2018.
Problem 12.2.2 from Richard Haberman applied partial differential equations book, 5th edition
Solve for \(u(x,t)\) \[ \omega _t -3 \omega _x = 0 \] With initial conditions \(\omega (x,0)=\cos x\).
See my HW 12, Math 322, UW Madison.
Mathematica ✓
ClearAll["Global`*"]; pde = D[w[x, t], t] - 3*D[w[x, t], x] == 0; ic = w[x, 0] == Cos[x]; sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, ic}, w[x, t], {x, t}], 60*10]];
\[\{\{w(x,t)\to \cos (3 t+x)\}\}\]
Maple ✓
restart; pde := diff(w(x,t),t)-3*diff(w(x,t),x)=0; ic:=w(x,0)=cos(x); cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde,ic],w(x,t))),output='realtime'));
\[w \left ( x,t \right ) =\cos \left ( 3\,t+x \right ) \]
Hand solution
Solve \begin {equation} w_{t}-3w_{x}=0\tag {1} \end {equation} With I.C. \(w\left ( x,0\right ) =\cos x\)
Solution
Let \(w=w\left ( x\left ( t\right ) ,t\right ) \). Then \begin {equation} \frac {dw}{dt}=\frac {\partial w}{\partial x}\frac {dx}{dt}+\frac {\partial w}{\partial t}\tag {2} \end {equation} Comparing (1),(2) shows that \begin {align} \frac {dw}{dt} & =0\tag {3}\\ \frac {dx}{dt} & =-3\tag {4} \end {align}
Solving (3) gives\begin {align} w & =w\left ( x\left ( 0\right ) \right ) \nonumber \\ & =\cos \left ( x\left ( 0\right ) \right ) \tag {5} \end {align}
We need to find \(x\left ( 0\right ) \). From (4)\begin {align*} x & =-3t+x\left ( 0\right ) \\ x\left ( 0\right ) & =x+3t \end {align*}
Hence (5) becomes
\[ w\left ( x\left ( t\right ) ,t\right ) =\cos \left ( x+3t\right ) \]
____________________________________________________________________________________