Shock formation for conservation law with initial and boundary data Suppose we have $$u_t + f(u) u_x = 0$$ where $t, x > 0$, and initial conditions $u(x,0) = C$, where $C>0$ is constant, and $u(0,t) = g(t)$, where $t>0$. We know the solution is $$u(x,t) = F(x-f(u) t )$$ for any differentiable $F$, and characteristics are given by $x - f(u)t = r $. I am trying to find where shocks will form and find the solution in such case. 
However, I don't quite understand the problem since $u(x,0) = F(x) = C$ and so $$u(x,t) = F( x - ct) = C $$ so the solution is a constant. What is my mistake here?
 A: This follows from the method of characteristics, which provides two sets of curves. The first set of curves is deduced from the initial data. It corresponds to the lines $x = f(C)t + x_0$ along which $u=C$ is constant ($x_0>0$). The second set of curves is deduced from the boundary data. It corresponds to the lines $x=f\circ g(t_0)\, (t-t_0)$ along which $u=g(t_0)$ is constant ($t_0>0$). The restriction $t,x>0$ imposes that all characteristics have positive slope, i.e. $f(C)$ and $f\circ g$ are positive. Moreover, we assume that $g(0) = C$ for compatibility. A shock can only occur in the second family of characteristic curves. To examine the dependence of the solution to the boundary data (see e.g. this post for the case of initial data), we differentiate the expression of characteristic curves w.r.t. $t_0$:
$$
\frac{\text d x}{\text d t_0} = (f\circ g)'(t_0)\, (t-t_0) - f\circ g(t_0) .
$$
The minimum positive time $t$ which makes this derivative vanish is the breaking time
$$
t_b = \inf_{t_0>0} t_0 + \frac{f\circ g(t_0)}{(f\circ g)'(t_0)} \geq 0 .
$$
For example, let us consider Burgers' equation $f: u\mapsto u$ with the sinusoidal boundary data defined by $C=1$ and $g(t) = 1+\sin (\pi t)\, \Bbb I_{[0, 1]}(t)$. In this case, a shock forms at $t_b = 0$. If instead $g(t) = 1+\sin^2 (\pi t)\, \Bbb I_{[0, 1]}(t)$, then a shock forms at $t_b \approx 0.6241$.
