Verify the rarefaction wave solution of a general convex scalar problem I am self-studying Numerical Methods for Conservation Laws by Leveque. I've been stuck on Exercise 3.7 for a while.
Question
Consider a general conservation law
$$
u_t+f(u)_x=0
$$
where $f(u)$ is convex. Suppose we have initial data
$$
u(x,0)=\begin{cases}
u_l &\text{if } x<0\\
u_r &\text{if } x>0
\end{cases}
$$
where $u_l<u_r$.
Show that the rarefaction wave with $v=(f')^{-1}$
$$
u(x,t) = \begin{cases}
u_l &\text{if  } ~x<f'(u_l)t\\
v(x/t) &\text{if  } ~f'(u_l)t\leq x \leq f'(u_r)t\\
u_r &\text{if  } ~x>f'(u_r)t
\end{cases}
$$
is a solution in the weak sense, i.e. it satisfies
$$
\int_0^\infty\int_{-\infty}^\infty \left[\phi u_t + \phi f(u)_x\right]dxdt = 0
$$
for $\phi \in C_0^1(\mathbb{R}\times \mathbb{R}^+)$ or, integrating by parts
$$
\int_0^\infty \int_{-\infty}^\infty\left[\phi_t u +\phi_x f(u)\right]dxdt=-\int_{-\infty}^\infty \phi(x,0)u(x,0)dx
$$
Comments
This question is similar to How to test the weak solution to a hyperbolic conservation law but different enough to warrant a new question, I think.
I originally was going to write up my attempt, but it boils down to splitting up the integrals and performing several substitutions and integrations by parts, and then comparing all the terms to see if they cancel. It's such a mess that I'm not sure anyone would even read it all. Somewhere, I'm messing up my application of integration by parts, or I'm not swapping the integral order correctly.
If it would be better, I can include my full attempt. Please let me know.
 A: Split up the integral by considering the domain in $xt$ space. The figure below considers $f(u)=\frac{1}{2} u^2$.

The location of the rarefaction wave trailing edge is defined by $x=f'(u_l)t$, and the leading edge is defined by $x=f'(u_r)t$. The left side of eq. 1 can be written
\begin{align*}
  \int_0^\infty \int_{-\infty}^\infty\left[\phi_t u +\phi_x f(u)\right]dxdt
  &= \int_{-\infty}^\infty \int_0^\infty\phi_t u~dtdx+\int_0^\infty\int_{-\infty}^\infty\phi_x f(u) dx dt\\
  &=I_t+I_x
\end{align*}
First consider $I_t=\int_{-\infty}^\infty \int_0^\infty\phi_t u~dtdx$.
\begin{align*}
  I_t&=\int_{-\infty}^\infty \int_0^\infty\phi_t u~dtdx\\
  &=\int_{-\infty}^0 \int_0^\infty\phi_t u_l~dtdx+\int_{-\infty}^\infty \int_0^\infty\phi_t u~dtdx\\
  &=\int_{-\infty}^0 -\phi(x,0)u_ldx\\&~~~~~+\int_{0}^\infty\left[\int_0^{x/f'(u_r)} \phi_t u_r~dt+\int_{x/f'(u_r)}^{x/f'(u_l)} \phi_t v(x/t)~dt+\int_{x/f'(u_l)}^\infty \phi_t u_l~dt\right]dx
\end{align*}
where we have used $\phi\in C_0^1(\mathbb{R}\times \mathbb{R}^+)$ to assert that $\phi(\infty,0)=0$.
Then, for convenience, define the following
\begin{align*}
 I_{tl}&=\int_{x/f'(u_l)}^\infty \phi_t u_l ~ dt=-\phi(x,x/f'(u_l))u_l\\
 I_{tm}&=\int_{x/f'(u_r)}^{x/f'(u_l)} \phi_t v(x/t)dt\\
 I_{tr}&=\int_0^{x/f'(u_r)}\phi_t u_r~dt=\phi(x,x/f'(u_r))u_r-\phi(x,0)u_r
\end{align*}
Now consider $I_x=\int_0^\infty\int_{-\infty}^\infty\phi_x f(u) dx dt$.
\begin{align*}
 I_x&=\int_0^\infty\int_{-\infty}^\infty\phi_x f(u) dx dt\\
 &=\int_0^\infty\left[\int_{-\infty}^{f'(u_l)t}\phi_x f(u_l) dx+\int_{f'(u_l)t}^{f'(u_r)t}\phi_x f(v(x/t)) dx+\int_{f'(u_r)t}^{\infty}\phi_x f(u_r) dx\right]dt
\end{align*}
So
\begin{align*}
 I_{xl}&=\int_{-\infty}^{f'(u_l)t}\phi_x f(u_l) dx=\phi(f'(u_l)t,t)f(u_l)\\
 I_{xm}&=\int_{f'(u_l)t}^{f'(u_r)t}\phi_x f(v(x/t)) dx\\
 I_{xr}&=\int_{f'(u_r)t}^{\infty}\phi_x f(u_r) dx=-\phi(f'(u_r)t,t)f(u_r)
\end{align*}
Now apply integration by parts to $I_{tm}$ and $I_{xm}$. Then
\begin{align*}
I_{tm} &=\int_{x/f'(u_r)}^{x/f'(u_l)} \phi_t v(x/t)dt\\
&=\phi v(x/t)\big|_{t=x/f'(u_r)}^{t=x/f'(u_l)}-\int_{x/f'(u_r)}^{x/f'(u_l)}\phi v'(x/t)(-\frac{x}{t^2})dt\\
&=\phi(x,x/f'(u_l))v(f'(u_l))-\phi(x,x/f'(u_r))v(f'(u_r))+\int_{x/f'(u_r)}^{x/f'(u_l)}\phi v'(x/t)\frac{x}{t^2}dt\\
&=\phi(x,x/f'(u_l))u_l-\phi(x,x/f'(u_r))u_r+\int_{x/f'(u_r)}^{x/f'(u_l)}\phi v'(x/t)\frac{x}{t^2}dt
\end{align*}
where $v(f'(\nu))=\nu$ by the definition of $v$ as the inverse of $f'$. (Note, by the assumed convexity of $f(u)$, its inverse exists.)
\begin{align*}
I_{xm} &=\int_{f'(u_l)t}^{f'(u_r)t}\phi_x f(v(x/t)) dx\\
&=\left.\phi f(v(x/t))\right.\vert_{x=f'(u_l)t}^{x=f'(u_r)t}-\int_{f'(u_l)t}^{f'(u_r)t}\phi f'(v(x/t))v'(x/t)\frac{1}{t}dx\\
&=\phi(f'(u_r)t,t)f(v(f'(u_r)))-\phi(f'(u_l)t,t)f(v(f'(u_l)))-\int_{f'(u_l)t}^{f'(u_r)t}\phi v'(x/t)\frac{x}{t^2}dx\\
&=\phi(f'(u_r)t,t)f(u_r)-\phi(f'(u_l)t,t)f(u_l)-\int_{f'(u_l)t}^{f'(u_r)t}\phi v'(x/t)\frac{x}{t^2}dx
\end{align*}
where $f(v(f'(u_r)))=f(u_r)$ by the definition of $v$ as the inverse of $f'$.
Let's summarize what we have.
\begin{align*}
 \int_0^\infty \int_{-\infty}^\infty\left[\phi_t u +\phi_x f(u)\right]dxdt &= I_t+I_x\\
 &= \int_{-\infty}^0 -\phi(x,0)u_l dx+ \int_0^\infty \left[ I_{tl}+I_{tm}+I_{tr} \right]dx+\int_0^\infty\left[I_{xl}+I_{xm}+I_{xr}\right]dt
\end{align*}
Looking at the results for each of these integrals, we might hope that everything will cancel nicely with an appropriate substitution. Consider $\int_0^\infty I_{tl} dx$ and $\int_0^\infty I_{xl} dt$. For the $I_{tl}$ integral, let $w=x/f'(u_l)$, so $f'(u_l)dw=dx$.
\begin{align*}
 \int_0^\infty I_{tl} dx &= -\int_0^\infty \phi(x,x/f'(u_l))u_l~dx\\
 &= -\int_0^\infty \phi(f'(u_l)w,w)f'(u_l)u_ldw\\
 \int_0^\infty I_{xl} dt &= \int_0^\infty \phi(f'(u_l)t,t)f(u_l)~dt
\end{align*}
Not quite cancellation, but maybe we can work with it.
$$
\int_0^\infty I_{tl}~dx+\int_0^\infty I_{xl}~dt=(f(u_l)-f'(u_l)u_l)\int_0^\infty \phi(f'(u_l)w,w)~dw
$$
Similarly, consider $\int_0^\infty I_{tr}~dx$ and $\int_0^\infty I_{xr}~dt$. Let $w=x/f'(u_r)$, so $f'(u_r)dw=dx$.
\begin{align*}
 \int_0^\infty I_{tr}~dx &= \int_0^\infty \phi(x,x/f'(u_r))u_r~dx-\int_0^\infty\phi(x,0)u_r~dx\\
 &= \int_0^\infty \phi(f'(u_r)w,w)f'(u_r)u_r~dw -\int_0^\infty\phi(x,0)u_r~dx\\
 \int_0^\infty I_{xr}~dt &= -\int_0^\infty \phi(f'(u_r)t,t)f(u_r)~dt
\end{align*}
So
$$
\int_0^\infty I_{tr}~dx +\int_0^\infty I_{xr}~dt = (f'(u_r)u_r-f(u_r))\int_0^\infty \phi(f'(u_r)w,w)~dw - \int_0^\infty \phi(x,0)u_r~dx
$$
Now consider $I_{tm}$ and $I_{xm}$. Again, make the substitution $w=x/f'(u_*)$.
\begin{align*}
 \int_0^\infty I_{tm}~dx&=\int_0^\infty\left[\phi(x,x/f'(u_l))u_l-\phi(x,x/f'(u_r))u_r+\int_{x/f'(u_r)}^{x/f'(u_l)}\phi v'(x/t)\frac{x}{t^2}dt\right]~dx\\
 &=\int_0^\infty\left[\phi(f'(u_l)w,w)f'(u_l)u_l-\phi(f'(u_r)w,w)f'(u_r)u_r\right]dw+\int_0^\infty\int_{x/f'(u_r)}^{x/f'(u_l)}\phi v'(x/t)\frac{x}{t^2}~dtdx\\
 \int_0^\infty I_{xm}~dt&=\int_0^\infty\left[\phi(f'(u_r)w,w)f(u_r)-\phi(f'(u_l)w,w)f(u_l)\right]dw-\int_0^\infty\int_{f'(u_l)t}^{f'(u_r)t}\phi v'(x/t)\frac{x}{t^2}~dxdt
\end{align*}
Note that
\begin{align*}
 \int_0^\infty I_{tm}~dx+\int_0^\infty I_{xm}~dt 
 &= (f(u_r)-f'(u_r)u_r)\int_0^\infty \phi(f'(u_r)w,w)~dw\\
 &+(f'(u_l)u_l-f(u_l))\int_0^\infty \phi(f'(u_l)w,w)~dw\\
 &+\int_0^\infty\int_{x/f'(u_r)}^{x/f'(u_l)}\phi v'(x/t)\frac{x}{t^2}~dtdx-\int_0^\infty\int_{f'(u_l)t}^{f'(u_r)t}\phi v'(x/t)\frac{x}{t^2}~dxdt
\end{align*}
I claim that
$$
\int_0^\infty\int_{x/f'(u_r)}^{x/f'(u_l)}\phi v'(x/t)\frac{x}{t^2}~dtdx=\int_0^\infty\int_{f'(u_l)t}^{f'(u_r)t}\phi v'(x/t)\frac{x}{t^2}~dxdt
$$
Both of these integrals have the integrand $\phi(x,t)v'(x/t)x/t^2$ and are over the region between the trailing and leading edge of the rarefaction wave in $xt$ space. By Fubini's theorem, they are equal.
Finally, by examining all of the integrals computed so far, we can see that
\begin{align*}
 \int_0^\infty \int_{-\infty}^\infty\left[\phi_t u +\phi_x f(u)\right]dxdt &= I_t+I_x\\
 &= \int_{-\infty}^0 -\phi(x,0)u_l dx+ \int_0^\infty \left[ I_{tl}+I_{tm}+I_{tr} \right]dx+\int_0^\infty\left[I_{xl}+I_{xm}+I_{xr}\right]dt\\
 &=-\int_{-\infty}^0 \phi(x,0)u_l~dx-\int_0^\infty \phi(x,0)u_r~dx\\
 &=-\int_{-\infty}^\infty \phi(x,0)u(x,0)~dx
\end{align*}
which is precisely what we wanted to show.
A: Note that $u$ is continuous, hence its first derivatives include jumps, but no higher-order singularity such as Dirac deltas. Therefore, one might prefer using the original weak formulation directly, which reduces to proving $$\iint (u_t+f(u)_x)\phi\,\text{d}x\,\text{d}t = 0$$ for all well-behaved test function $\phi$ with compact support (the weak formulation in OP is derived from the present one using integration by parts). Also, one observes that $u_t$ and $f(u)_x$ equal zero outside the domain defined by $\lbrace 0\leq t, f'(u_l)t\leq x\leq f'(u_r)t\rbrace$, in which we have $u = v(\xi)$ with $\xi = x/t$ and $v = (f')^{-1}$. Furthermore,
\begin{aligned}
\int_{0}^{\infty}\int_{-\infty}^{\infty} u_t \phi\, \text d x\,\text d t &= -\int_{0}^\infty\int_{f'(u_l)t}^{f'(u_r)t} v'(\xi) \frac{x}{t^2} \phi\, \text d x\,\text d t ,
\end{aligned}
\begin{aligned}
\int_{0}^{\infty}\int_{-\infty}^{\infty} f(u)_x \phi\, \text d x\,\text d t &= \int_{0}^\infty\int_{f'(u_l)t}^{f'(u_r)t} \underbrace{f'(v(\xi))}_{x/t} \, v'(\xi) \frac{1}{t} \phi\, \text d x\,\text d t .
\end{aligned}
Therefore, the sum of these two integrals vanishes, thus ending the proof (via integration by parts on the left-hand side).
