Solution (source code)

= Solution

To distinguish the one-variable profile from the resulting two-variable <function>, write $u(x,t)=F(\xi)$ with $\xi=xe^{-t}$. The <chain rule> gives $u_t=-xe^{-t}F'(\xi)$ and $u_x=e^{-t}F'(\xi)$, so $u_t+xu_x=0$. Thus any differentiable profile of $xe^{-t}$ solves the <partial differential equation>.

The <initial condition> selects $F(\xi)=\ln\xi$ on the positive half-line. Hence
$$
\boxed{u(x,t)=\ln(xe^{-t})=\ln x-t,\qquad x>0.}
$$
This satisfies both the <partial differential equation> and the given data at $t=0$.