Consider the Burgers equation $u_t+uu_x=0$ with the initial condition $$u_0(x) = \begin{cases} u_l,x\leq0\\ u_r,x>0 \end{cases}$$ Consider the region in the $xt$−plane given by $[−1, X] × [0, T]$ where $X$ is big enough that the x−position of the shock is less than X when t = T. (You don’t need to worry about what $X$ is, just imagine that it’s really really big.) Argue, from the principle of conservation of mass, that if the shock moves at a constant speed, $s$, then $Q(t)=\int_a^budx$ satisfies $Q(T) − Q(0) = sT(u_l − u_r ).$
My attempt: We write the conservation law in the integral form over an arbitrary interval $[a,b]$ $$\int_a^b(\frac{\partial{u}}{\partial{t}}+\frac{\partial}{\partial{x}}(\frac{u^2}{2}))dx=\frac{d}{dt}\int_a^budx+\frac{(u(b,t))^2}{2}-\frac{(u(a,t))^2}{2}=0$$ or denoting $Q(t)=\int_a^budx$ we get $$\frac{d}{dt}Q(t)=\frac{(u(a,t))^2}{2}-\frac{(u(b,t))^2}{2}$$ Integrating over time $[0,T]$ we have $Q(T) − Q(0)=\int_0^T(\frac{(u(a,t))^2}{2}-\frac{(u(b,t))^2}{2})dt$.
I am stuck here, how do I proceed next?