TITLE: How to test the weak solution to hyperbolic conservation law?
QUESTION [7 upvotes]: Consider an inviscid Burgers equation:
$u_t + u u_x = 0.$
With the initial data:
$ u(x,0) = \left\{ \begin{array}{ll}
             0  \quad  & \text{if} \quad x < 0, \\[0.5em]
             1  & \text{if} \quad x > 0.\end{array} \right. $
Possible weak solutions to this problem include, for example:
$ u_1(x,t) = \left\{ \begin{array}{ll}
             0  \quad  & \text{if} \quad x < t/2, \\[0.5em]
             1  & \text{if} \quad x > t/2.\end{array} \right. \hspace{10mm} $   $ u_2(x,t) = \left\{ \begin{array}{lll}
             0  \quad  & \text{if} \quad x < 0, \\[0.5em]
                     x/t & 0 < x < t,\\[0.5em]
             1  & \text{if} \quad x > t.\end{array} \right. $
Every material that provides such examples states that it is easy to check that these are both solutions of our problem. I do not see how that is done.
I know how to obtain the equation:
$ \int_{0}^\infty \int_{-\infty}^\infty [ q \phi_t + f(q) \phi_x ] dx dt + \int_{-\infty}^\infty q(x,0) \phi(x,0) dx = 0,  $
But I do not see how to "test" if the weak solutions provided above satisfy this. I tried writing the solutions as Heavside functions and integrating them, but I am not sure how to handle an arbitrary test function.
I assume there are some solution I could construct that would not be the weak solution to our initial data, how to check that?

REPLY [7 votes]: To show that $u$ is a weak solution of this initial-value problem, we show that
$$
\int_{0}^{\infty}\int_{-\infty}^{\infty} \left[ \phi_t u + \phi_x f(u)\right] \mathrm{d}x\, \mathrm{d}t = -\int_{-\infty}^{\infty} \phi(x,0)\, u (x,0)\,\mathrm{d}x
$$
is satisfied for all $\phi$ in $C_0^1(\mathbb{R}\times \mathbb{R}^+)$. Let us prove this identity in the case
$$ u(x,t) = u_1(x,t) = \left\lbrace\begin{aligned}&0 &&\text{if } x < t/2\, ,\\ &1 &&\text{if } x > t/2\, ,\end{aligned}\right. $$
with the flux function of Burgers' equation $f(u) = \frac{1}{2}u^2$.
To do so, we split the integral in two parts, and switch the integrals according to the Fubini theorem:
\begin{aligned}
\int_{0}^{\infty}\!\int_{-\infty}^{\infty} \left[ \phi_t u + \phi_x f(u)\right] \mathrm{d}x\, \mathrm{d}t &= \int_{-\infty}^{\infty}\int_{0}^{\infty} \phi_t u\, \mathrm{d}t\, \mathrm{d}x + \int_{0}^{\infty}\!\int_{-\infty}^{\infty} \phi_x f(u)\, \mathrm{d}x\, \mathrm{d}t \\
&= \int_{0}^{\infty}\int_{0}^{2x} \phi_t \, \mathrm{d}t\, \mathrm{d}x + \frac{1}{2}\int_{0}^{\infty}\!\int_{t/2}^{\infty} \phi_x \, \mathrm{d}x\, \mathrm{d}t \\
&= \int_{0}^{\infty}\left[\phi(x,2x) - \phi(x,0)\right]\mathrm{d}x - \frac{1}{2}\int_{0}^{\infty} \phi(t/2,t)\, \mathrm{d}t \\
&= -\int_{0}^{\infty}\phi(x,0)\,\mathrm{d}x \\
&= -\int_{-\infty}^{\infty}\phi(x,0)\,u(x,0)\,\mathrm{d}x \, .
\end{aligned}
In the case where $u(x,t) = u_2(x,t)$, the proof is similar.

This is a particular case of exercise 3.4 p 29 of the book [1].
[1] R.J. LeVeque: Numerical Methods for Conservation Laws, 2nd ed., Birkhäuser, 1992.