Let $\mu$ be a probability measure over $\mathbb{R}^n$. Let $f$ and $g$ be two real-valued functions on $\mathbb{R}^n$. I would like to compute
$$\int_{\mathbb{R}^n} \nabla f(x) g(x) \, d\mu(x). $$
I know that the usual integration by parts formula tells us that for all open sets $U \subset \mathbb{R}^n$, we have
$$\int_{U} \nabla f(x) g(x) \, d\mu(x) = \int_{\partial U}f(x)g(x)n(x) \, d\mu(x) -\int_{U} f(x) \nabla g(x) \, d\mu(x), $$ where for all $x \in \partial U$ we denote the outward-pointing normal vector at $x$ by $n(x)$. It seems to me that in the case where $U = \mathbb{R}^n$, the first term should disappear and we should obtain the identity
$$\int_{\mathbb{R}^n} \nabla f(x) g(x) \, d\mu(x) = -\int_{\mathbb{R}^n} f(x) \nabla g(x) \, d\mu(x). $$
Is this correct? If it helps, I am happy to assume that $\mu(x)$ decays much faster than $f(x)$ and $g(x)$ grow as $x$ tends away from the origin. For example, we could take $\mu$ to be the Gaussian measure and $f$ and $g$ to be polynomials. Also would appreciate any references where this is detailed.