Scalar conservation law (source code)

= Scalar conservation law
{title2=$u_t+\partial_xf(u)=0$}

A one-dimensional <scalar conservation law> describes the balance of a scalar density $u$ and its <conservation law flux> $f(u)$:
$$
u_t+\partial_x f(u)=0,\qquad \frac{d}{dt}\int_a^b u(t,x)\,dx=f(u(t,a))-f(u(t,b)).
$$
The second identity follows from the first for smooth $u$: the quantity inside a fixed interval changes only through its boundary <fluxes>. For a <classical solution>, the <chain rule> also gives the <quasilinear partial differential equation> $u_t+f'(u)u_x=0$, with <characteristic speed> $f'(u)$.

The conservative form still defines a discontinuous <weak solution>. With <initial condition> $u_0$, it requires
$$
\int_0^\infty\!\int_{\mathbb R}(u\varphi_t+f(u)\varphi_x)\,dx\,dt+\int_{\mathbb R}u_0(x)\varphi(0,x)\,dx=0
$$
for every smooth compactly supported <test function> on $[0,\infty)\times\mathbb R$. For $f(u)=u^2/2$, a jump from $1$ to $0$ travels at speed $1/2$ by the <Rankine-Hugoniot condition>, between incoming <characteristic speeds> $1$ and $0$. Reversing those states still gives a conservative jump of speed $1/2$, but <entropy solution> admissibility selects a <rarefaction wave>. Thus conservation determines jump balance while an entropy condition selects the continuation after <characteristic crossing>.<Riemann Problems and Jupyter Solutions by David I. Ketcheson, Randall J. LeVeque, and Mauricio J. del Razo/Burgers' equation>[Shock solution; Rarefaction wave; The entropy condition]{ref}