Let $\rho: \mathbb{R} \times [0, \infty) \to \mathbb{R}$ be the density, $f: \mathbb{R} \to \mathbb{R}$ the flux of the density and $g: \mathbb{R} \to \mathbb{R}$ the source (or loss) term. The equation
$$ \partial_t\rho(x,t) + \partial_x f(\rho(x,t)) + g(\rho(x,t)) = 0 $$
is called one-dimensional balance law.
For $g=0$ the balance law reduces to a conservation law, for which the integral-form is given by
$$ \int_{x_1}^{x_2} \rho(x,t_2) \,\mathrm{d}x - \int_{x_1}^{x_2} \rho(x,t_1) \,\mathrm{d}x = \int_{t_1}^{t_2} f(\rho(x_1,t)) \,\mathrm{d}t - \int_{t_1}^{t_2} f(\rho(x_2,t)) \,\mathrm{d}t. $$
which implies that the change of mass inside an interval $[x_1,x_2]$ during a time interval $[t_1,t_2]$ is defined by the difference of the inflow and the outflow at $x_1$ and $x_2$ during this time interval.
Is there any literature for a derivation of the integral form for the balance law with $g \neq 0$ inclusive physical explanation? Any hints or suggestions are highly appreciated.