Entropy Solution of the Burgers' Equation I am working on the following problem, which gives the Burgers' equation $$u_t + uu_x=0$$ with the initial data $$g(x)= \begin{cases}1, & x < 0, \\ 2, & 0 < x < 1,\\ 0, & x >  1.\end{cases}$$  It then asks to find the entropy solution of $u(x,t)$ for all $t>0$.
This type of problem, with shock and rarefaction waves, is discussed in Evans, but I don't really know how to apply it to solving this problem.  Any help with this would be greatly appreciated.  Thank you.
 A: So, let's start looking at the first jump in the initial conditions. Here we left $1$ on the left side and $2$ on the right. As we are looking for an entropy solution and these can only jump down across shocks, we have a rarefaction wave here. At $x=1$ we have a shock (as $2 > 0$) with speed given by Rankine-Hugeniot as $\frac 12 (2+0) = 1$. So for small $t$ we have
$$
  u(x,t) = \begin{cases} 1 & x \le t\\ \frac xt & t < x < 2t\\ 2 & 2t \le x < 1+t \\ 0 & x \ge 1+t\end{cases} \quad \quad (0 \le t \le 1)
$$
The next time something interesting happends is when the charateristic with speed 2 starting at 0, hits the shock. That is when $t+1 = 2t$, i. e. $t=1$. Now the shock is built from characteristics of the rarefaction fan, let's denote the shock curve by $s$, we have $s(1) = 2$, and by the jump condition
$$ s'(t) = \frac 12 \cdot \frac{s(t)}t $$
The solution of this ode is $s(t) = 2\sqrt t$, that is we have for the next part
$$
  u(x,t) = \begin{cases} 1 & x \le t \\ \frac xt & t < x < 2\sqrt t \\ 0 & x \ge 2\sqrt t \end{cases} \quad\quad (1 \le t \le 4) 
$$
Then next interesting time is when the first speed 1 characteristic hits the speed 0 characteristics, that is when $2\sqrt t = t \iff t = 4$ (as $t\ge 0$). After that the shock travels with speed $\frac 12(1+ 0) = \frac 12$, that is we have
$$ u(x,t) = \begin{cases} 1 & x \le 2 +\frac 12t \\ 0 & x> 2 + \frac 12t 
\end{cases} \quad \quad (t \ge 4).
$$
