Integration by parts for $u \in H^{1}$ and $v\in H^{1}_{0}$ Let $\Omega$ be a smoothly, open bounded domain in $\mathbb{R}^{n}$. Assume that $u\in W^{1,2}\left(\Omega\right)$ and $v\in W^{1,2}_{0}\left(\Omega\right)$. Is the integration by parts always true, that is
$$ \int_{\Omega}\left(\partial_{i}u\right) v + \left(\partial_{i}v\right) u dx=\int_{\partial \Omega} uv\tau_{i} d\sigma.$$
Here $\tau_{i}$ is the i-th component of the outward normal vector.
Thanks.
 A: The above formula above is an application of the Gauss-Green (divergence) theorem to the vector
$$
\overline{uv}=\left.
\begin{pmatrix}
uv\\
uv\\
\vdots\\
uv
\end{pmatrix}\quad\right\}\text{ $n$ rows}
$$
As a matter of fact,
$$
\begin{split}
\nabla\cdot\overline{uv}&=
\left(\frac{\partial}{\partial x_1}, \frac{\partial}{\partial x_2},\cdots,\frac{\partial}{\partial x_n}\right)\cdot
\begin{pmatrix}
uv\\
uv\\
\vdots\\
uv
\end{pmatrix}\\
&=\frac{\partial (uv)}{\partial x_1}+ \frac{\partial (uv)}{\partial x_2}+\cdots+\frac{\partial (uv)}{\partial x_n}\\
&=\sum_{i=1}^n\big[(\partial_iu)v+u(\partial_iv)\big]
\end{split}
$$
thus, 
$$
\begin{split}
\int\limits_\Omega \nabla\cdot\overline{uv}\,\mathrm{d}x &=\int\limits_{\partial\Omega}  \overline{uv}\cdot\boldsymbol\tau\,\mathrm{d}\sigma_x\\
&\Updownarrow\\
\int\limits_\Omega \nabla\cdot\overline{uv}\,\mathrm{d}x&=\int\limits_{\partial\Omega} \overline{uv}\cdot\boldsymbol\tau\,\mathrm{d}\sigma_x\\
&\Updownarrow\\
\int\limits_\Omega (\partial_iu)v+u(\partial_i&v)\,\mathrm{d}x=\int\limits_{\partial\Omega} uv\tau_i\mathrm{d}\sigma_x\\
\end{split}\label{1}\tag{1}
$$
Since $u\in W^{1,2}(\Omega)$ and $v\in W_0^{1,2}(\Omega)$ and $\Omega$ is a nice, smooth and bounded domain, 
$$
\begin{split}
(\partial_iu)v+u(\partial_iv)&\in L^1(\Omega)\\
\operatorname{tr}_{\partial\Omega}(uv\tau_i)=\operatorname{tr}_{\partial\Omega}(u)\operatorname{tr}_{\partial\Omega}(v)\tau_i&\in L^1(\partial\Omega)
\end{split}\quad \forall i=1,\ldots,n
$$
all integrals in \eqref{1} are well defined and finite: note also that, since $\operatorname{tr}_{\partial\Omega}(v)\equiv 0$ for all $v\in W_0^{1,2}(\Omega)$, the left side integral of \eqref{1} is $0$ so the formula reduces to
$$
\int\limits_\Omega \nabla\cdot\overline{uv}\,\mathrm{d}x=\int\limits_\Omega(\partial_iu)v+u(\partial_iv)\,\mathrm{d}x= 0 \label{2}\tag{2}
$$
A: Allow me to rephrase your inequality for two reasons :

*

*if $v\in \mathrm H_{\color{red}{0}}^1(\Omega)$  then your last term disappears

*this last term does not make sens as it is if $u,v$ are only in $\mathrm H^1(\Omega)$, you have to use trace theory, see below.

Now this formula is true for $u,v$ in $\mathcal C^\infty(\overline\Omega)$. Now take $u_n, v_n$ in $C^\infty(\overline\Omega)$ converging to $u,v$ in $\mathrm H^1(\Omega)$ and from
$$ \int_\Omega \partial_i u_n \cdot v_n = -\int_\Omega u_n \cdot \partial_i v_n + \int_{\partial\Omega} u_n\cdot v_n \ \tau_i \mathrm d \sigma$$
write
$$ \partial_i u_n \cdot v_n - \partial_i u \cdot v =  \partial_i u \cdot (v_n-v)  + ( \partial_i u_n - \partial_i u) \cdot v_n   $$
On the right-hand side, the parentheses converge to $0$ in $\mathrm L^2(\Omega)$ and the factors in front of them are bounded in $\mathrm L^2$, so by Cauchy-Schwarz inequality all of that converges to $0$ in $\mathrm L^1$. In the end, the first term in the above formula converges to $\int_\Omega \partial_i u \cdot v$. Of course the same holds for the second term.
Finally, do the same thing for the integral on $\partial\Omega$, and by definition of the trace operator ($\gamma(u)$ is the $\mathrm L^2(\partial\Omega)$ limit of the restriction of $u_n$ to $\partial\Omega$) the right-hand side goes to $\int_{\partial\Omega} \gamma(u)\cdot \gamma(v) \ \tau_i \mathrm d \sigma$.
In the end, what you get is the following : for all $u,v$ in $\mathrm H^1(\Omega)$,
$$ \int_\Omega \partial_i u \cdot v = -\int_\Omega u \cdot \partial_i v + \int_{\partial\Omega} \gamma(u)\cdot \gamma(v) \ \tau_i \mathrm d \sigma$$
