Weak solution of scalar conservation laws - Integration by parts For any smooth function $v:\mathbb{R}\times[0,\infty)\mapsto \mathbb{R}$ with compact support,
$$\int_{0}^{\infty}\int_{-\infty}^{\infty}[u_{t}+[f(u)]_{x}]v\:dxdt =0$$
Integrating by parts and using the fact that v vanishes at infinity,
$$\int_{0}^{\infty}\int_{-\infty}^{\infty}[uv_{t}+f(u)v_{x}]\:dxdt\:+ \int_{-\infty}^{\infty}\phi(x)v(x,0)\:dx=0$$
How does author obtained the second expression using integration by parts?
 A: This claim can be found e.g. in §3.4 p. 27 of (1). One should note that $u(x,0) = \phi(x)$ is the initial condition of this Cauchy problem (missing in OP). The standard definition of weak solutions leads to
$$
\int_0^\infty \int_{-\infty}^\infty [u_t + f(u)_x] v\, \text dx \text dt
= 0
$$
for all test functions $v$ with compact support. Using Fubini's theorem, integration by parts and the fact that $v$ has compact support, we obtain
\begin{aligned}
\int_0^\infty \int_{-\infty}^\infty u_t v\, \text dx \text dt &= \int_{-\infty}^\infty \int_0^\infty u_t v\, \text dt \text dx \\
&= \int_{-\infty}^\infty \left( [u v]_0^\infty - \int_0^\infty u v_t \, \text dt \right) \text dx \\
&= -\int_{-\infty}^\infty \phi(x) v(x,0)\, \text dx - \int_0^\infty \int_{-\infty}^\infty u v_t \, \text dx \text dt
\end{aligned}
and
\begin{aligned}
\int_0^\infty \int_{-\infty}^\infty f(u)_x v\, \text dx \text dt &= \int_0^\infty \left(  [f(u) v]_{-\infty}^\infty - \int_{-\infty}^\infty f(u) v_x\, \text dx \right) \text dt \\
&= -\int_0^\infty \int_{-\infty}^\infty f(u) v_x\, \text dx \text dt .
\end{aligned}
The summation of both terms yields the result.

Note: the linear case $f(u) = au$ is tackled in this post.
(1) R.J. LeVeque, Numerical Methods for Conservation Laws, Birkhäuser Verlag, 1992.
