Integration by parts on manifold Let $(M,g)$ be a compact Riemannian manifold without boundary,  $f,g \in C^{\infty}(M)$ and $X$ be a smooth vector field. Is it true that we can integration by parts with respect to the differentiation with $X$, i.e.,
\begin{equation*}
\int_{M}X(f) g = -\int_{M}f X(g)
\end{equation*}
In other words, does the Stoke's Theorem hold for the expression $\int_{M}X(fg)$ ?
 A: This integration by parts identity does not hold in general. The divergence theorem
$$
\int_M\operatorname{div}(X)\mu_g=\int_{\partial M}g(N,X)\mu_{\iota^*g}
$$
(Where $\mu_g$ is the Riemannian measure and $\mu_{\iota^*g}$ is the induced measure on the boundary), as well as the product rule for divergences
$$
\operatorname{div}(fX)=X(f)+f\operatorname{div}(X)
$$
Holds for any compact Riemannian manifold $M$ ($M$ need not be oriented). Applying these to to an $M$ without boundary, starting with the expression
$$
\int_M\operatorname{div}(fgX)\mu_g=0
$$
we arrive at the integration by parts formula with an extra term.
$$
\int_MX(f)g\mu_g+\int_MfX(g)\mu_g+\int_Mfg\operatorname{div}(X)\mu_g=0
$$
The third term does not vanish in general (e.g. choose $X$ with nonvanishing divergence and let $fg=\operatorname{div}(X)$). However, it does give rise to a special case: integration by parts works exactly as written in the question provided $X$ is solenoidal.
A: You define for a vector field $X$ on $M$, $\operatorname{div}X\operatorname{dvol}=d\iota_X\operatorname{dvol}$ where $\operatorname{dvol}$ is the associated volume form of the Riemannian manifold.
Note that $\operatorname{div}X\operatorname{dvol}=\mathcal L_X\operatorname{dvol}$
$\operatorname{div}fX\operatorname{dvol}=\mathcal L_{fX}\operatorname{dvol}=Xf\operatorname{dvol}+f\mathcal L_X\operatorname{dvol}$
Since $\operatorname{div}X\operatorname{dvol} $ is exact by definition, we get $$\int_M \operatorname{div}fX\operatorname{dvol}=0$$ $$\int_MXf\operatorname{dvol}+f\mathcal L_X\operatorname{dvol}=0$$ $$\implies \int_MXf\operatorname{dvol}=-\int_Mf\mathcal L_X\operatorname{dvol}$$
