I want to prove that $$ u(t,x)=\begin{cases} 0 &\text{if } x\leq 0 \\ x/t &\text{if } 0\leq x \leq t \\ 1 &\text{if } x\geq t \end{cases} $$ is a weak solution to $ u_t + uu_x =0 $ with initial condition $$u_0 (x) = \begin{cases} 1 &\text{ if } x \geq 0 \\ 0 &\text{ otherwise}\end{cases}$$ that is, to prove that $$ \int_{Q_T} \phi_t u + \phi_x \frac{u^2}{2} \ dxdt =-\int_{\mathbb{R}} u_0(x)\phi(0,x)\ dx\qquad \forall \phi\in C_0^1 ([0,T)\times\mathbb{R})$$ where $Q_T=[0,T]\times \mathbb{R}$.
I am stuck in the computations, and help is welcome. Thank in advance! EDIT: I don't know how to deal with the next integral $$ \int_{[0,T]}\int_{[0,t]} \frac{x}{t}\phi_t + \frac{x^2}{2t^2}\phi_x\ \ dxdt $$