# Shock of Burgers equation $u_t+uu_x=0$ at $t=0$

Consider the Burgers equation $$u_t+uu_x=0$$ with the initial condition $$u_0(x) = \begin{cases} u_l,x\leq0\\ u_r,x>0 \end{cases}$$

My attempt to solve this:

Using the method of characteristics we parametrize: $$\frac{dx}{ds}=u, x(0,r)=x_0(r)=r$$ $$\frac{dt}{ds}=1,\ t(0,r)=t_0(r)=0 \implies t=s$$ $$\frac{du}{ds}=0,\ u(0,r)=u_0(r)=\begin{cases} u_l,r\leq0\\ u_r,r>0 \end{cases} \implies u=u_0(r)$$ $$\frac{dx}{ds}=u,x(0,r)=r \implies x=us+r=u_0(r)t+r$$ so solutions are constant along $$x=u_0(r)t+r$$.

For $$r\leq 0, u_0=u_l \implies \text{slope}=\frac{1}{u_l}$$ on the $$x-t$$ plane

For $$r>0, u_0=u_r\implies \text{slope}=\frac{1}{u_r}$$ on the $$x-t$$ plane

So why and where does a shock form at $$t = 0$$?

The initial condition is discontinuous, so the shock is there from the very beginning, and if $$u_l>u_r$$ it remains.
I will also note that it's not true that the border between area where $$u = u_l$$ and area where $$u=u_r$$ is given by equation $$x-t=0$$. If $$u_l>u_r$$ the equation of the discontinuity line is given by $$x = \frac{u_l+u_r}{2}t$$ (which can be derived from Rankine-Hugoniot condition), and the solution is $$u(x,t) =\left\{\begin{array}{ll} u_l & \text{for } x< \frac{u_l+u_r}{2}t\\ u_r & \text{for } x >\frac{u_l+u_r}{2}t\end{array}\right.$$ If $$u_l, then there's no shockwave, but rarefaction appears instead: $$u(x,t) =\left\{\begin{array}{ll} u_l & \text{for } x \le u_l t\\ \frac{x}{t} & \text{for } u_lt \le x \le u_rt \\u_r & \text{for } x \ge u_r t\end{array}\right.$$