A question about integration by parts in $\mathbb{R}^n$ Let $h \in L^2(\mu)$ and $\mu = \rho(x)dx$, where $dx$ is Lebesgue measure and $\rho(x)$ is $C^1$. Also, $b(x) = (b_1(x), \cdots, b_n(x))$ is also a $C^1$ function on $\mathbb{R}^n$. Then, does the following integration by parts hold?
$$\int_{\mathbb{R}^n} b \cdot \nabla(h^2)\rho \,dx = - \int_{\mathbb{R}^n} h^2 \nabla \cdot (b\rho)\,dx$$
The issue for me is, of course, the boundary term. Is there any reason to say the boundary term is $0$? If not, could it hold if we impose some restrictions on $b(x)$ or $h$, such as $h$ is a Schwartz function? Any help would be really appreciated!
 A: If $h$ is Schwartz then the answer is affirmative, but you seem to want $h\in L^2$ only. That's not enough. Having $k:=h^2$ in $L^1$ does not guarantee anything about $\nabla k$. It could be a tiny but highly oscillating function, say 
$$
k(x)=\frac{\sin(e^{|x|})}{(1+|x|^2)^{100}}.$$
With this function, your right-hand side does make sense, but the left-hand side does not. 
The right assumption is $h^2\in W^{1,1}$. With this one, your formula is true. Proof: establish the formula for a Schwartz $h$, then extend by density, using the fact that both sides are continuous with respect to the $W^{1,1}$ norm.

EDIT. How to prove that the boundary term vanishes, provided $h$ decays sufficiently rapidly? 

Here's a way. Integration by parts on the ball $\{|x|\le R\}$ yields 
$$
\int_{\{|x|\le R\}} \boldsymbol b \cdot \nabla(h^2)\rho \,dx = \int_{\{|x|=R\}} \boldsymbol{b}\cdot\boldsymbol{n}\, h^2 \rho\, dS - \int_{\{|x|\le R\}} h^2 \nabla \cdot (\boldsymbol b\rho)\,dx,$$
where $\boldsymbol{n}$ denotes the unit normal vector. We then have the estimate
$$\left\lvert \int_{\{|x|=R\}} \boldsymbol{b}\cdot\boldsymbol{n}\, h^2 \rho\, dS \right\rvert\le C_{\boldsymbol b, \rho}\sup_{|x|=R} (h^2(x))\left\lvert \int_{|x|=R}\, dS\right\rvert=C_{\boldsymbol b, \rho}\sup_{|x|=R} (h^2(x))R^{n-1}.$$
Thus, if $h^2(x)=o(|x|^{-(n-1)})$, the boundary term vanishes. This is certainly the case if $h$ is compactly supported, or Schwartz.
