Solution (source code)

= Solution

For $u_0\in L^\infty(\mathbb R)$, call $u\in L^\infty(\mathbb R_+\times\mathbb R)$ a <weak solution> when, for every $\varphi\in C_c^1([0,\infty)\times\mathbb R)$,
$$
\int_0^\infty\!\int_{\mathbb R}
\left[u\bigl(\varphi_t+(F\varphi)_x\bigr)+g\varphi\right]dx\,dt
+\int_{\mathbb R}u_0(x)\varphi(0,x)\,dx=0.
$$
This follows by multiplying the equation by a <test function> and applying <integration by parts> in time and space; $(F\varphi)_x$ includes the term $F_x\varphi$ because the original transport operator is not in divergence form.

If $u$ is $C^1$, test functions supported away from $t=0$ show that $u_t+Fu_x=g$ as a <distributional identity>, hence pointwise. Integrating this pointwise equation by parts in the weak identity leaves
$$
\int_{\mathbb R}(u(0,x)-u_0(x))\varphi(0,x)\,dx=0.
$$
Arbitrary boundary test functions and the <fundamental lemma of the calculus of variations> give $u(0,x)=u_0(x)$. Thus a $C^1$ weak solution is the unique classical solution from part a.

Solved by gpt-5.6-sol high.