Divergence theorem in volume integral We have a partial differential equation
 \begin{equation}
\nabla \cdot (p_1^2\nabla\alpha)=0\,.
\end{equation}
Question: from this equation how can I write the following condition?
\begin{equation}
\int_\Omega\alpha\nabla \cdot(p_1^2\nabla\alpha)=
\int_{\partial\Omega}\alpha p_1^2 n\cdot\nabla\alpha
-\int_\Omega p_1^2(\nabla\alpha)^2=0 \,.
\end{equation}
$p_1$ and $\alpha$ are position dependent variable.
 A: It appears this is an application of the Divergence theorem, assuming everything is smooth:
$$
\int_{\Omega} \nabla \cdot F  = \int_{\partial \Omega} F\cdot n\,dS,
$$
Let $F = \alpha p \nabla \alpha$, where $p = p_1^2$. The product rule reads for a vector $v$ and a scalar $\phi$:
$$
\nabla \cdot (\phi v) = \nabla \phi \cdot v + \phi\nabla \cdot v, 
$$
therefore we have:
$$
\int_{\Omega} \nabla \cdot (\alpha p \nabla \alpha) = \int_{\Omega} \Big(\alpha \nabla \cdot (p \nabla \alpha) + p \nabla \alpha \cdot \nabla \alpha \Big) = \int_{\partial \Omega} \alpha p \nabla \alpha\cdot n\,dS,
$$
and this is
$$
\int_{\Omega}\alpha \nabla \cdot (p \nabla \alpha) = \int_{\partial \Omega} \alpha p (\nabla \alpha\cdot n)\,dS - \int_{\Omega}p \nabla \alpha \cdot \nabla \alpha ,
$$
rewrite $\nabla \alpha \cdot \nabla \alpha  = |\nabla \alpha|^2$, and by the original equation $\nabla \cdot (p \nabla \alpha) = 0$, the left hand side of above vanishes, hence we have:
$$
\int_{\partial \Omega} \alpha p (\nabla \alpha\cdot n)\,dS - \int_{\Omega}p |\nabla \alpha|^2 = 0 .
$$

Or you can just memorize the integration by parts formula derived from the divergence theorem:
$$
\int_{\Omega} u\nabla \cdot v = -\int_{\Omega} \nabla u\cdot v + \int_{\partial \Omega} u(v\cdot n)\,dS.
$$
