I'm trying to solve Burgers' inviscid equation with these initial conditions:
$$u(0,x)= \begin{cases} a, & \text{if $x<0$} \\ b, & \text{if $x>0$} \end{cases}$$
Here is my work so far: $$u(0,x)= \begin{cases} a, & \text{if $x<0$} \\ b, & \text{if $x>0$} \end{cases}$$ $$x(t)= u(0, x(0))t+x(0)$$ $$x(t)=\begin{cases} at+x(0), & \text{if $x<0$} \\ bt+x(0), & \text{if $x>0$} \end{cases}$$
$$t= \begin{cases} \frac1a (x-x(0)), & \text{if $x(0)<0$} \\ \frac1b(x-x(0)), & \text{if $x(0)>0$} \end{cases}$$
If all this is correct, I am a bit confused as to how to put them all together, this was my attempt:
$$u(t,x) = \begin{cases}
a, & \text{if $x