Solution (source code)

= Solution

The <Inviscid Burgers equation> here has the negative quadratic flux $F(f)=-f^2/2$. By the <method of characteristics>, $df/dZ=0$ and $d\theta/dZ=-f$, so a characteristic beginning at $\theta_0$ satisfies
$$
\boxed{\theta=\theta_0-f_0(\theta_0)Z,\qquad f(Z,\theta)=f_0(\theta_0).}
$$
This is a classical solution until <characteristic curves> intersect. Across a <shock wave>, the <Rankine-Hugoniot condition> gives
$$
\boxed{\theta_s'=\frac{F(f_R)-F(f_L)}{f_R-f_L}=-\frac{f_R+f_L}{2}.}
$$
It uses the one-sided limiting values and agrees with the weak-shock expression.

For $U>0$, the right-state <characteristic curves> travel left with speed $-U$ while the left-state <characteristic curves> have speed zero. They converge into a compressive <shock wave> with speed $-U/2$. The <entropy solution> is
$$
\boxed{f(Z,\theta)=\begin{cases}0,&\theta<-UZ/2,\\U,&\theta>-UZ/2.\end{cases}\quad(U>0).}
$$
The characteristic speeds satisfy $0>-U/2>-U$, so both sides enter the shock.

For $U<0$, right-state <characteristic curves> travel right with speed $-U>0$, leaving a gap. A steep continuous transition fills that gap with a <rarefaction wave>. The <entropy solution> is
$$
\boxed{f(Z,\theta)=\begin{cases}0,&\theta<0,\\-\theta/Z,&0<\theta<-UZ,\\U,&\theta>-UZ.\end{cases}\quad(U<0).}
$$
The middle value is fixed by $\theta/Z=F'(f)=-f$. A discontinuity joining the two states would satisfy the jump equation but violate entropy admissibility. If $U=0$, the solution is identically zero.

\Image[/past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2015/iii/paper-77-burgers-characteristics.png]
{title=Characteristics forming a compressive shock and a rarefaction fan for the negative-flux Burgers equation}