all time.

We study the stability in $L^2$ of piecewise-smooth solutions to the system of balance laws . The study of piecewise-smooth solutions takes us a step beyond the classical Riemann problem, which considers piecewise-constant initial data. Furthermore, when the system has the source term $G$, it is important to study piecewise-smooth solutions and just not piecewise-constant, for the source term may mean that even pure shock wave initial data evolves into something more complicated. For a nonlocal example of this phenomenon, consider the solution to the Riemann problems for the Burgers–Hilbert equation, which is Burgers equation with a nonlocal source term [@MR3248030; @MR3605552; @MR3348783; @MR2982741].

Our method is the relative entropy method, a technique created by Dafermos [@doi:10.1080/01495737908962394; @MR546634] and DiPerna [@MR523630] to give $L^2$-type stability estimates between a Lipschitz continuous solution and a rougher solution, which is only weak and entropic for a strictly convex entropy (the so-called *weak-strong* stability theory). For a system endowed with an entropy $\eta$, the technique of relative entropy considers the quantity called the *relative entropy*, defined as $$\begin{aligned}
\eta(u|v)\coloneqq \eta(u)-\eta(v)-\nabla\eta(v)\cdot (u-v).\end{aligned}$$

Similarly, we define relative entropy-flux, $$\begin{aligned}
q(u;v)\coloneqq q(u)-q(v)-\nabla\eta(v)\cdot (f(u)-f(v)).\end{aligned}$$

Remark that for any constant $v\in\mathbb{R}^n$, the map $u\mapsto\eta(u|v)$ is an entropy 