Solve $u_t+3uu_x=0$ , $u(x,0)=\left\{\begin{matrix} 2 & x<1\\ 0& x>1 \end{matrix}\right.$ Solve the initial value problem  $$u_t+3uu_x=0 ,\quad u(0,x)=\left\{\begin{matrix}
2 & x<1\\ 
 0& x>1
\end{matrix}\right.$$
My Idea: 
given that $u_t+3uu_x=0$
Now $\frac{dt}{1}=\frac{dx}{3u}=\frac{du}{0}$
$\frac{dt}{1}=\frac{du}{0} \rightarrow u=c_1$
$\frac{dt}{1}=\frac{dx}{u} \Rightarrow \frac{dt}{1}=\frac{dx}{3c_1} \Rightarrow 3c_1t-x=c_2$
any one can help me from here
 A: Let us assume that you want to solve $u_t + 3uu_x = 0$, with the proposed initial data
$$
u(x,0) =
\left\lbrace
\begin{aligned}
&2 &&\text{if}\quad x < 1 \, ,\\
&0 &&\text{if}\quad x > 1 \, .\\
\end{aligned}
\right.
$$
We follow the steps in this post. According to the Lax entropy condition, the solution to this Riemann problem is a shock wave (characteristic curves intersect in the $x$-$t$ plane), which speed $s$ is given by the Rankine-Hugoniot condition
$$
s = \frac{3}{2}\left(0 + 2\right)
 = 3 \, .
$$
One obtains the following solution:
$$
u(x,t) =
\left\lbrace
\begin{aligned}
&2 &&\text{if}\quad x < 1+st \, ,\\
&0 &&\text{if}\quad x > 1+st \, .\\
\end{aligned}
\right.
$$
A: Use the method of characteristics:
I assume you want to solve 
$$u_t+kuu_x=0.$$
Method of charactersitics results in:
$$\dfrac{dt}{1}=\dfrac{dx}{ku}=\dfrac{du}{0}.$$
Using
$$\dfrac{dt}{1}=\dfrac{du}{0}$$
gives $u=c_1$.
Using
$$\dfrac{dt}{1}=\dfrac{dx}{ku}=\dfrac{dx}{kc_1}$$
$$\implies kc_1t=x+c_2 \implies c_2=kc_1t-x.$$
We know that 
$$u=c_1=F(c_2)=F(kc_1t-x)=F(ktu-x)$$
in the last step I used $u=c_1$.
