Solution (source code)

= Solution

The pressure-free equation has the <scalar conservation law> form
$$
\partial_tu+\partial_xf(u)=0,\qquad f(u)=\frac12u^2.
$$
A smooth travelling ansatz $u=U(x-Vt)$ obeys $(U-V)U'=0$, so it cannot continuously connect two distinct constant states. The inviscid <shock wave> must be interpreted as a discontinuous <weak solution>. Its <Rankine-Hugoniot condition> is
$$
V(u_2-u_1)=f(u_2)-f(u_1)=\frac12(u_2^2-u_1^2).
$$
For $u_1\ne u_2$,
$$
\boxed{V=\frac{u_1+u_2}{2}.}
$$
The result is independent of which state is called upstream. For a physical compressive <entropy shock> of the <Inviscid Burgers equation>, the left and right states satisfy $u_L>u_R$ and therefore $u_L>V>u_R$: <characteristic curves> run into the <shock wave> from both sides. The ordering $u_L<u_R$ instead produces a <rarefaction wave>.