The method is very similar to the convex case, e.g. Burgers' equation where $f(u) = \frac{1}{2}u^2$, but there are more possible types of waves. In facts, in addition to shock waves and rarefaction waves, there may be waves with both discontinuous and continuous parts. Moreover, the Lax entropy condition for shocks must be replaced by the more general Oleinik entropy condition.
In the case where the flux $f$ is not convex, these are the possible types of waves:
- shock waves. If the solution is a shock wave with expression
$$
u(x,t) =
\left\lbrace
\begin{aligned}
&u_L & &\text{if}\quad x < s\, t \, ,\\
&u_R & &\text{if}\quad s\, t < x \, ,
\end{aligned}
\right.
\tag{1}
$$
then the speed of shock $s$ must satisfy the Rankine-Hugoniot jump condition
$s = \frac{f(u_R)- f(u_L)}{u_R - u_L}$. Moreover, the shock wave must satisfy the Oleinik entropy condition [1]
$$
\frac{f(u)- f(u_L)}{u - u_L} \geq s \geq \frac{f(u_R)- f(u)}{u_R - u} ,
$$
for all $u$ between $u_L$ and $u_R$. In the case where $f$ is convex, the slope of its chords can be compared with its derivative using convexity inequalities. Thus, the classical Lax entropy condition $f'(u_L)>s>f'(u_R)$ is recovered, where $f'$ denotes the derivative of $f$.
- rarefaction waves. The derivation is similar to the convex case, starting with the self-similarity Ansatz $u(x,t) = v(\xi)$ where $\xi = x/t$, which gives $f'(v(\xi)) = \xi$. In the nonconvex case, the equation $f'(v(\xi)) = \xi$ may have multiple solutions $v(\xi)$, and the correct one is deduced from the continuity conditions $v(f'(u_L)) = u_L$ and $v(f'(u_R)) = u_R$. Such a solution is given by
$$
u(x,t) =
\left\lbrace
\begin{aligned}
&u_L & &\text{if}\quad x \leq f'(u_L)\, t \, ,\\
&(f')^{-1}(x/t) & &\text{if}\quad f'(u_L)\, t \leq x \leq f'(u_R)\, t \, ,\\
&u_R & &\text{if}\quad f'(u_R)\, t \leq x \, ,
\end{aligned}
\right.
\tag{2}
$$
where the expression of the reciprocal $(f')^{-1}$ of $f'$ has been chosen carefully.
- compound waves, a.k.a. composite waves or semi-shocks. The latter occur when neither shock waves nor rarefaction waves are entropy solutions, but combinations of them are. The position of rarefaction parts and of discontinuous parts is deduced from the Rankine-Hugoniot condition and from the Oleinik entropy condition.
A rather practical method of solving such problems is convex hull construction: [1]
The entropy-satisfying solution to a nonconvex Riemann problem can be determined from the graph of $f (u)$ in a simple manner. If $u_R < u_L$, then construct the convex hull of the set $\lbrace (u, y) : u_R ≤ u ≤ u_L \text{ and } y ≤ f (u)\rbrace$. The convex hull is the smallest convex set containing the original set. [...] If $u_L < u_R$, then the same idea works, but we look instead at the convex hull of the set of points above the graph, $\lbrace (u, y) : u_L ≤ u ≤ u_R \text{ and } y ≥ f (u)\rbrace$.
Between $u_L$ and $u_R$, the intervals where the slope of the hull's edge is constant correspond to admissible discontinuities. The other intervals correspond to admissible rarefactions.
One can also use Osher's expression of general similarity solutions $u(x,t) = v(\xi)$, which writes [1]
$$
v(\xi) =
\left\lbrace
\begin{aligned}
&\underset{u_L\leq u\leq u_R}{\text{argmin}} \left(f(u) - \xi u\right) && \text{if}\quad u_L\leq u_R \, ,\\
&\underset{u_R\leq u\leq u_L}{\text{argmax}} \left(f(u) - \xi u\right) && \text{if}\quad u_R\leq u_L \, .
\end{aligned}
\right.
$$
To summarize, here are the different entropy solutions and their validity in the case $f(u) = \frac{1}{3}u^3$, where the inflection point of $f$ is located at the origin. The speed of sound is $f'(u) = u^2$, with reciprocal $(f')^{-1}(\xi) = \pm\sqrt{\xi}$. Using the convex hull construction method, one gets:
- if $[0<u_L<u_R]$ or $[u_R<u_L<0]$, the solution is a rarefaction wave $({2})$ with shape $\text{sgn}(u_R) \sqrt{x/t}$.
- else, if $[u_L<u_R< -\frac{1}{2}u_L]$ or $[-\frac{1}{2}u_L <u_R<u_L]$, the solution is a shock wave $({1})$, which speed $s = \frac{1}{3}\left( {u_L}^2 + {u_L}{u_R} + {u_R}^2 \right)$ is given by the Rankine-Hugoniot condition.
- else, if $[u_L\leq 0\leq -\frac{1}{2}u_L \leq u_R]$ or $[u_R\leq -\frac{1}{2}u_L \leq 0 \leq u_L]$, the solution is a semishock, more precisely a shock-rarefaction wave. The intermediate state $u^*$ which connects the discontinuous part to the rarefaction part satisfies $\frac{1}{3}\left( {u_L}^2 + {u_L}{u^*} + ({u^*})^2 \right) = (u^*)^2$ according to the convex hull construction, i.e. $u^* = -\frac{1}{2}u_L$. Thus,
$$
u(x,t) =
\left\lbrace
\begin{aligned}
&u_L & &\text{if}\quad x \leq \left(-{\textstyle\frac{1}{2}u_L}\right)^2\, t \, ,\\
&\text{sgn}(u_R)\sqrt{x/t} & &\text{if}\quad \left(-{\textstyle\frac{1}{2}u_L}\right)^2\, t \leq x \leq {u_R}^2\, t \, ,\\
&u_R & &\text{if}\quad {u_R}^2\, t \leq x \, .
\end{aligned}
\right.
$$
(1) R.J. LeVeque, Finite Volume Methods for Hyperbolic Problems. Cambridge University Press, 2002.
First of all, weak solutions are not unique. I guess that you rather want to find the entropy solution. Here is a plot of the characteristic curves in the $x$-$t$ plane, deduced from the method of characteristics:
In the vicinity of $x=-3$ and $x=-2$, characteristics separate. Hence, according to the Lax entropy condition, rarefaction waves are obtained. The entropy solution is smooth for small times $0<t < 1$ (see e.g. this post and related ones):
$$
u(x,t) = \left\lbrace
\begin{aligned}
&0 && \text{if } x<-3 \\
&(x+3)/t && \text{if } {-3}<x<-3+t/2 \\
&1/2 && \text{if } {-3}+t/2<x<-2 + t/2 \\
&(x+2)/t && \text{if } {-2} + t/2 <x<-2 + t \\
&1 && \text{if } {-2}+t<x<t \\
&(1-x)/(1-t) && \text{if } t\leq x<1 \\
&0 && \text{if } x\geq 1
\end{aligned}\right.
$$
At the time $t=1$, characteristic curves intersect (breaking time). To compute the solution for larger times, one must compute the shock wave starting at $(x,t)=(1,1)$ by using the Rankine-Hugoniot condition, which gives the shock speed $s = \frac{1}{2}(1 + 0) = 1/2$. Thus the solution for $1\leq t < t^*$ reads
$$
u(x,t) = \left\lbrace
\begin{aligned}
&0 && \text{if } x<-3 \\
&(x+3)/t && \text{if } {-3}<x<-3+t/2 \\
&1/2 && \text{if } {-3}+t/2<x<-2 + t/2 \\
&(x+2)/t && \text{if } {-2} + t/2 <x<-2 + t \\
&1 && \text{if } {-2}+t<x<1+(t-1)/2 \\
&0 && \text{if } x\geq 1+(t-1)/2
\end{aligned}\right.
$$
For larger times, one must consider the interaction between the shock wave and the rarefaction wave starting at $x=-2$, since the rarefaction moves faster than the shock. Both waves intersect at the time $t^*$ such that $-2 + t^* = 1+(t^*-1)/2$, i.e. $t^*=5$. The new shock has the speed $\dot x_s = \frac{1}{2}\left((x_s+2)/t + 0\right)$ deduced from the Rankine-Hugoniot condition. Since the interaction occurs at $x_s(t^*)=3$, we find $x_s(t) = \sqrt{5t}-2$. Thus, for $5\leq t < t^\dagger$, the solution reads
$$
u(x,t) = \left\lbrace
\begin{aligned}
&0 && \text{if } x<-3 \\
&(x+3)/t && \text{if } {-3}<x<-3+t/2 \\
&1/2 && \text{if } {-3}+t/2<x<-2 + t/2 \\
&(x+2)/t && \text{if } {-2} + t/2 <x<\sqrt{5t}-2 \\
&0 && \text{if } x> \sqrt{5t}-2
\end{aligned}\right.
$$
For larger times, one must consider the interaction between the shock wave and the constant state $u=1/2$, since it moves faster than the shock. Both waves intersect at the time $t^\dagger$ such that $-2 + t^\dagger/2 = \sqrt{5t^\dagger}-2$, i.e. $t^\dagger=20$. The new shock has the speed $s = \frac{1}{2} (1/2 + 0)$ deduced from the Rankine-Hugoniot condition, and we find $x_s(t) = 3+t/4$. Thus, for $20\leq t < t^\circ$, the solution reads
$$
u(x,t) = \left\lbrace
\begin{aligned}
&0 && \text{if } x<-3 \\
&(x+3)/t && \text{if } {-3}<x<-3+t/2 \\
&1/2 && \text{if } {-3}+t/2<x<3+t/4 \\
&0 && \text{if } x> 3+t/4
\end{aligned}\right.
$$
For larger times, one must consider the interaction between the shock wave and the rarefaction starting at $x=-3$, since it moves faster than the shock. Both waves intersect at the time $t^\dagger$ such that $-3+t^\circ/2 = 3+t^\circ/4$, i.e. $t^\circ=24$. The new shock has the speed $\dot x_s = \frac{1}{2} ((x_s+3)/t + 0)$ deduced from the Rankine-Hugoniot condition. Since the interaction occurs at $x_s(t^\circ)=9$, we find $x_s(t) = \sqrt{6t}-3$. Thus, for $24\leq t$, the solution reads
$$
u(x,t) = \left\lbrace
\begin{aligned}
&0 && \text{if } x<-3 \\
&(x+3)/t && \text{if } {-3}<x<\sqrt{6t}-3\\
&0 && \text{if } x> \sqrt{6t}-3
\end{aligned}\right.
$$
The right edge of the wave has amplitude $\sqrt{6/t}$. Thus, its amplitude and propagation speed decrease with time.
Best Answer
This is very similar to the Riemann problem of the inviscid Burgers' equation (see e.g. (1), (2), (3), (4) and related posts). For this type of problem, weak solutions are not unique. Thus, I guess that the problem statement asks for the entropy solution. I will provide a detailed general answer for the case of conservation laws $u_t + f(u)_x = 0$ with Riemann data $u(x<0,0) = u_l$ and $u(x>0,0) = u_r$, where the flux $f$ is smooth and convex (the case of concave fluxes is very similar). If the flux has inflection points, the more general solution is provided here.
In the case of convex a flux $f$, there are only two possible types of waves:
shock waves. If the solution is a shock wave with speed $s$, $$ u(x,t) = \left\lbrace\begin{aligned} &u_l & &\text{if } x < s t, \\ &u_r & &\text{if } st < x, \end{aligned}\right. $$ then the speed of shock must satisfy the Rankine-Hugoniot jump condition $s = \frac{f(u_l)-f(u_r)}{u_l-u_r}$. Moreover, to be admissible, the shock wave must satisfy the Lax entropy condition $f'(u_l) > s > f'(u_r)$, where $f'$ denotes the derivative of $f$.
rarefaction waves. They are obtained from the self-similarity Ansatz $u(x,t) = v(\xi)$ with $\xi = x/t$, which leads to the identity $f'(v(\xi)) = \xi$. Since $f'$ is an increasing function, we can invert the previous equation to find $v(\xi) = (f')^{-1}(\xi)$. The final solution reads $$ u(x,t) = \left\lbrace\begin{aligned} &u_l & &\text{if } x \leq f'(u_l) t, \\ &(f')^{-1}(x/t) & &\text{if } f'(u_l) t \leq x \leq f'(u_r) t, \\ &u_r & &\text{if } f'(u_r) t \leq x, \end{aligned}\right. $$ where $(f')^{-1}$ denotes the inverse function of $f'$. One notes that this solution requires $f'(u_l) \leq f'(u_r)$.
In the present case, the flux $f: u \mapsto u^2$ is a smooth convex function, so that its derivative $f':u\mapsto 2u$ is increasing. Shock waves are obtained for $u_l \geq u_r$ (cf. Lax entropy condition), and rarefaction waves are obtained for $u_l \leq u_r$. In the first case, the shock speed deduced from the Rankine-Hugoniot condition reads $s = u_l + u_r$. The value of the solution at $x=0$ for positive times is $u_r$ if $s < 0$, and $u_l$ otherwise. In the second case, the reciprocal of the derivative is given by $(f')^{-1} : \xi \mapsto \xi/2$. The value of the solution at $x=0$ for positive times is $u_r$ if $u_r < 0$, $u_l$ if $u_l > 0$, and $0$ otherwise (i.e., if $u_l < 0 < u_r $).