Let $\Omega$ be the half-space $\mathbb{R}^{n-1}\times \{ x_n>0 \}$, let $v \in L^2(\Omega)$ and $\phi\in \mathcal{C}^{\infty}(\overline{\Omega})$ with compact support in $\overline{\Omega}$. What is the lowest regularity that we need (on $v$) to say that $$\frac{1}{2}\int_{\Omega} |v(x',x_n)|^2\partial_{x_n} \phi(x',x_n) = -\int_{\Omega} (\partial_{x_n}v,v) \phi-\frac{1}{2}\int_{\mathbb{R}^{n-1}}|v(x',0)|^2\phi(x',0)dx'$$ holds?
In particular, does the equality hold if $v\in H^{\frac{1}{2}}((0,+\infty),L^2(\mathbb{R}^{n-1}))$ ?