Solution (source code)

= Solution

Set $\xi=x-ct$. The <chain rule> gives $u_t=-cf'(\xi)$ and $u_x=f'(\xi)$, so $u_t+cu_x=0$ for any differentiable $f$. The initial profile fixes $f(\xi)=\cos\xi$, giving
$$
\boxed{u(x,t)=\cos(x-ct)}.
$$
This is the translated initial profile, as described by the <transport equation>.