Shock trajectory for Burgers' equation I am dealing with the Burgers' equation,
$$ w_t + \Big( \frac{1}{2} w^2\Big)_x = 0$$
with  initial conditions
$$w(x,t)= \begin{cases} 
      0 & x < 0 \\
      x & 0\leq x\leq 1 \\
      0 & 1\leq x 
   \end{cases}
$$
at $t=0$.
Using the following formula $$\frac{dx_s(t)}{dt}=u(t)$$ where $u(t)$ is the shock speed determined by the Rankine-Hugoniot(RH) equation, I want to find $x_s(t)$ as a function of $t$.
 A: For this problems it is in general advisable to consider the characteristics $x(t)$ -  curves in space $x$ solely parametrized by time $t$ with the property that $w$ stays constant along them:
\begin{align} \frac{\mathrm d }{\mathrm d t}w\big(x(t), t\big) &\equiv 0 \\
\Leftrightarrow \partial_t w + \big(\partial_x w\big) \frac{\mathrm d x}{\mathrm d t} &\equiv 0\end{align}
Now compare with your PDE
$$ w_t + f(w)_x = w_t + f'(w) w_x = 0$$ which gives the ODE that determines the charactersitics:
$$x'(t) = f(w)' \overset{\text{Burgers}}{=}  w$$
Now comes the clever trick of characteristics: By definition $w$ stays along them, thus
$$ \frac{\mathrm d }{\mathrm d t}w\big(x(t), t\big) \equiv 0 \Rightarrow w\big(x(t), t\big) = w_0 \Big(x_0 \big(x(t), t\big) \Big)$$ i.e., the solution of the PDE $w$ can be constructed from the intial conditions $w_0$! Insert this back into the ODE for $x$:
$$x'(t) = w = w_0 = \begin{cases} 0& x_0 < 0 \\ x_0 & 0 \leq x_0 \leq 1 \\ 0 & x_0 > 1 \end{cases}$$
Solving the ODEs (with $t_0 = 0$) gives:
$$x(t) = \begin{cases} x_0 + 0 \cdot t & x_0 < 0 \\ x_0 + x_0 \cdot t & 0 \leq x_0 \leq 1 \\ x_0 + 0 \cdot t & x_0 > 1 \end{cases}$$
Let's plot this:

So we see there will be a shock on the right (orange-green).
Let's take a closer look:

As you can see, the shock forms at $x= 1, t = t_0 = 0$. (I have plotted the characteristics emerging from $x_1 = 1 - 10^{-3}$ and $x_2 = 1+ 10^{-3}$.) You then have the correct approach to compute the shock curve: Use RH to obtain the differential equation for the shock curve:
$x_s' = 0.5(w_L + w_R)$.
Now the characteristics finally come in handy: You know that the values on the left of the shock are
$$w_L(x, t) = w_0 \Big \vert_{0 \leq x_0 \leq 1}(x, t) = x_0(x, t) \overset{0 \leq x_0 \leq 1}{=} \frac{x}{1 + t}$$  The right state $w_R$ which clashes into the shock is simply given by
$$w_R(x, t) = w_0(x, t) \Big \vert_{x_0 > 1} =0.$$
Thus, the ODE for the shock becomes
$$x_s' = 0.5\bigg(\frac{x_s}{1 + t} + 0\bigg) = 0.5 \frac{x_s}{1 + t}$$ with general solution (I spared myself from solving this seperable ODE)
$$x_s(t) = c \sqrt{1 + t}.$$
Since the shock forms at $x_s(t_0 = 0) = 1$ we have $1 = c \sqrt{1 + 0} \Rightarrow c = 1$  and the shock-curve is given by
$$x_s(t) = \sqrt{1 + t} $$
and drawn in black in the plot below:

The non-linearity becomes more visible for later times $t > 1$.
