Solve the initial value problem of $u_t-uu_x=0$ $u_t-uu_x=0$  the initial value is $u(1,x)=\begin{cases}-1&x<0\\3&x>0\end{cases}$
This is what i have done so far
$$\frac {dx}{dt} = -u$$
using ordinary differential method like separate the variable i will have $$dx =-udt$$ then integrate both sides to get $$ x=-ut +c$$ so the general solution to this PDE is $$u(t,x)=x+ut$$
then i plug in my initial value to get $$u(1,x)=x+u$$. So far i feel confident about the computation, but i do not get the initial value part well meaning do i have to do something more or is it just like that. What does the -1 and 3 do that is the part i do not get. any help or explanation about how to use the initial value will be great thanks
 A: Let $\begin{cases}p=t-1\\q=x\end{cases}$ ,
Then $u_t=u_pp_t+u_qq_t=u_p$
$u_x=u_pp_x+u_qq_x=u_q$
$\therefore u_p-uu_q=0$
Follow the method in http://en.wikipedia.org/wiki/Method_of_characteristics#Example:
$\dfrac{dp}{ds}=1$ , letting $p(0)=0$ , we have $p=s$
$\dfrac{du}{ds}=0$ , letting $u(0)=u_0$ , we have $u=u_0$
$\dfrac{dq}{ds}=-u=-u_0$ , letting $q(0)=f(u_0)$ , we have $q=f(u_0)-u_0s=f(u)-up$ , i.e. $u=F(q+up)=F(x+u(t-1))$
$u(1,x)=\begin{cases}-1&x<0\\3&x>0\end{cases}$ :
$\therefore u(t,x)=\begin{cases}-1&x+u(t-1)<0\\3&x+u(t-1)>0\end{cases}=\begin{cases}-1&x-t+1<0\\3&x+3t-3>0\end{cases}$
Hence $u(t,x)=\begin{cases}-1&x-t<-1\\3&x+3t>3\\c&\text{otherwise}\end{cases}$
A: This equation is very similar to the inviscid Burgers' equation. Here is a plot of the characteristics in the $x$-$t$ plane obtained from the proposed initial data (up to a vertical translation in time by $-1$):

One can observe that the characteristic curves intersect. Therefore, a shock wave occurs. Its speed $s$ is given by the Rankine-Hugoniot condition with data $u_L = -1$ on the left and $u_R = 3$ on the right:
$$
s = \frac{-\frac{1}{2}(u_L)^2 + \frac{1}{2}(u_R)^2}{u_L - u_R} = -\frac{1}{2} (-1 + 3) = -1 \, .
$$
Therefore, the entropy solution is
$$
u(x,t) =
\left\lbrace
\begin{aligned}
& {-1} & &\text{if}\quad x<{-(t-1)}\\
& 3 & &\text{if}\quad {-(t-1)}<x
\end{aligned}
\right.
$$
