Find the entropy solution of $$\begin{cases} u_t + \left( \frac{u^2}{2} \right)_x = 0 & \text{ in } \mathbb{R}\times(0,\infty) \\ u = g & \text{ on } \mathbb{R}\times\{0\}, \end{cases}$$ where $$g(x) = \begin{cases} 0&\text{ if } x\leq -1 \\ 1+x&\text{ if } -1\leq x\leq 0 \\ 1-x&\text{ if } 0\leq x\leq 1 \\ 0&\text{ if }x\geq 1. \end{cases}$$
This is what I have so far. To get the characteristics we have $x=g(x_0)t+x_0$ which gives us $$\begin{cases} x_0&\text{ if } x_0<-1 \\ (1+x_0)t+x_0&\text{ if } -1<x_0<0 \\ (1-x_0)t+x_0&\text{ if } 0<x_0<1 \\ x_0&\text{ if } x_0>1 \end{cases}$$ After this step I get a bit confused. I believe the next step is finding the equations for the shocks at the discontinuous points, in this case $(-1,0)$, $(0,0)$, and $(1,0)$. Here is my attempt at calculating the shocks: $$ \frac{dx}{dt} = \frac{0+(1+x)}{2} = \frac{1+x}{2} ~~~~~\Rightarrow~~~~~ \int_x^{-1}\frac{dy}{1+y} = \int_0^t \frac{ds}{2} ~~~~~\Rightarrow~~~~~ \boxed{x=e^{-t/2}-1}$$
$$\frac{dx}{dt} = \frac{(1+x)+(1-x)}{2} = \frac{2}{2} = 1 ~~~~~\Rightarrow~~~~~ \int_0^x dy = \int_0^t ds ~~~~~\Rightarrow~~~~~ \boxed{x=t}$$
$$\frac{dx}{dt} = \frac{(1-x)+0}{2} = \frac{1-x}{2} ~~~~~\Rightarrow~~~~~ \int_1^x \frac{dy}{1-y} = \int_0^t \frac{ds}{2} ~~~~~\Rightarrow~~~~~ \boxed{x=1-e^{-t/2}}$$
Assuming I've done everything right so far, I'm lost after this point. How do I get my entropy solution from this? Also, are there other shocks I need to look at? For example, where my current shocks intersect do new shocks get created?
Any help, guidance, and feedback is greatly appreciated.
