I'm trying to solve Burgers equation $(\rho_{t} + \rho \rho_{x} = 0$), interpreted as a conservation law for $\int \rho dx$, with
$$\rho (x_{0} ,0) = \begin{cases} 0 \quad & x_{0} \leq 0 \\ x \quad & 0 \leq x_{0} \leq 1 \\ 0 \quad & x_{0} > 1\end{cases}$$
I'm thinking that I should use the method of characteristics, but I'm having problems treating the movement of the shock. It's obvious that the solution for $x<0$ is $0$. When $x$ is between $0 - 1 $
$$\dfrac{dx}{dt}=x \rightarrow \dfrac{dx}{x} = dt \rightarrow \ln(x) = t +c \rightarrow x= Ae^{t}$$
Applying the boundary conditions for $t=0$, first, solve for the constant (characteristic equation?) $A=xe^{-t}$, and I know that $\rho(x_{0},0) = x$, so $A=x_{0} e^{0}=x$. Therefore $A==x$, and $\rho(x,t) = xe^{-t}$.
But, the density ($\rho$) goes to $0$ at $x>1$, so how do I treat the moving shock? It obviously does not decay to $0$ at $x=1$ because then conservation would not hold.