Since the question is old, I'll give the complete solution, not just the $x_s$ part.
Before $T_c$
Draw the $xt$ coordinates, with $t$-axis pointing up. From the given $u(x,0)$, we find three families of characteristic lines:
- vertical lines $x=x_0$ with $x_0\le 0$
- slope $1/2$ lines $t=\frac12(x-x_0)$ with $0<x_0<1$
- vertical lines $x=x_0$ with $x_0\ge 1$
There is a gap between the families 1 and 2: it's a triangular region bounded by $x=0$ and $t=\frac12 x$.
This is the rarefaction wave: within this region, all characteristic lines go through $(0,0)$, the origin of the wave.
Therefore, the line through $(x,t)$ has slope $t/x$, which yields
$$
u(x,t)=x/t ,\qquad 0<x< 2t
$$
This is family 4 of characteristics.
The families 2 and 3 appear to overlap. This means they are separated by shock wave, which originates at $x=1$ at time $t=0$ and
moves to the right with velocity $\frac12(2+0)=1$ (the mean of velocities in front and behind the shock, as the jump condition says). Its trajectory is $x=1+t$.
The front edge of rarefaction wave $x=2t$ meets the shock wave $x=1+t$ when $t=1$. Thus, $T_c=1$. The meeting point is $(2,1)$.
After $T_c$
The characteristics of family 2 are no more; the shock is between families 3 and 4. The speed of shock wave as it passes through $(x,t)$ is the mean
of velocities in front and behind the shock:
$$
\frac{1}{2}\left( \frac{x}{t} +0 \right) = \frac{x}{2t}
$$
Therefore, the trajectory of shock wave is described by the ODE
$$
\frac{dx}{dt}=\frac{x}{2t}
$$
Solve this separable ODE with the initial condition $x(1)=2$ to get
$$
x_s(t) = 2 \sqrt{t}
$$
This is the trajectory of shock for $t>1$.
Second method, conservation law
Introduce the quantity $P(t)=\int_{-\infty}^\infty u(x,t)\,dx$. It is actually independent of $t$ because
$$\frac{dP}{dt} = \int_{-\infty}^\infty u_t \,dx = - \int_{-\infty}^\infty (u^2/2) _x \,dx = (u^2/2) \bigg|_{-\infty}^\infty =0$$
Since $P =2$ at $t=0$, it stays at $2$ for all times. At time $t>T_c$ the function $u$ is equal to $x/t$ for $0< x <x_s$, and is zero otherwise. Thus, its integral is
$$
\frac{1}{t} \frac{x_s^2}{2}
$$
Equating the above to $2$, we once again get
$$
x_s(t) = 2 \sqrt{t}
$$
The present PDE is the inviscid Burgers' equation. A sketch of the characteristic curves in the $x$-$t$ plane is
Along these curves, $u$ is constant and equal to its value at $t=0$, deduced from the initial data $f(x)$ (similar to a rectangular function).
- One can observe that the characteristic curves separate at $x=0$: the edges are the lines $x=0$ on the left, and $x=2t$ on the right. According to the Lax entropy condition, a rarefaction wave occurs. Such a wave is a self-similar continuous solution, i.e. $u(x,t) = v(x/t)$. In the case of Burgers' equation, one shows that $v(x/t) = x/t$ (cf. e.g. this post).
- At $x=1$, characteristics cross: a shock wave occurs. Starting from the intersection of characteristics, the method of characteristics is not valid anymore. The speed of shock $s$ is given by the Rankine-Hugoniot condition $s = \frac{1}{2}(2 + 0) = 1$. The shock wave is located on the line $\frac{x-1}{t} = s$, i.e. $x = 1+t$.
Therefore, as long as both waves do not interact, the solution is
$$
u(x,t) =
\left\lbrace
\begin{aligned}
&0 & &\text{if}\quad x\leq 0\\
&x/t & &\text{if}\quad 0\leq x \leq 2t\\
&2 & &\text{if}\quad 2t\leq x<1+t\\
&0 & &\text{if}\quad 1+t<x \, .
\end{aligned}
\right.
$$
Both waves will interact at some time $t^*$ such that $2t^* = 1+t^*$, i.e. $t^* = 1$. The rarefaction wave catches the shock.
Best Answer
After the basic shock waves $x=t/2$ and $x=t+2 $ (shown in red) are accounted for, the characteristics look like this.
This picture is correct for times $t<1$, but needs two adjustments after that. Note that the solution within rarefaction wave is $u(x,t) = (x-1)/t$.
Rarefaction catches up with shock on the right: $x=3$, $t=1$.
From this point on, the position of this shock satisfies $$ \frac{dx}{dt} = \frac12 \left( \frac{x-1}{t} + 0 \right) = \frac{x-1}{2t} $$ hence $x(t) = 2\sqrt{t} +1$.
Shock on the left catches up with rarefaction: $x=1$, $t=2$.
From this point on, the position of this shock satisfies $$ \frac{dx}{dt} = \frac12 \left( 1 + \frac{x-1}{t} \right) = \frac{x-1+t}{2t} $$ hence $x(t) = t-\sqrt{2t}+1$.
Notice that in both cases the space-time trajectory of the shock becomes parabolic: this always happens when a rarefaction wave interacts with a constant velocity field.
Plotting the new trajectories of shocks, and terminating the characteristics accordingly, we get the following picture (one has to look closely to notice the curvature of red curves).
Final battle: two shocks come together
At the time $t=6+4\sqrt{2} \approx 11.5$ (off the chart above), the two shock waves meet at $x=5+2\sqrt{2}$. At this moment, rarefaction ceases to exist. The single shock wave forms, separating the velocities $1$ and $0$. It propagates according to the equation $$ x(t) = 5+2\sqrt{2} + \frac12 (t-6-4\sqrt{2}),\quad t\ge 6+4\sqrt{2} $$