Let $\Omega \subset \mathbb{R}^n$ be a bounded open set. Let $g \in C^1(\Omega)\cap L^2(\Omega)$ and $f \in W_0^{1,2}(\Omega)$. Does the following integration by parts formula hold $$\int_\Omega g(x)\frac{\partial f}{\partial x_i}(x)dx=-\int_\Omega \frac{\partial g}{\partial x_i}(x)f(x)dx \text{ ?} \tag{1}$$ (Here $i=1,..,n$.) In particular I know that the LHS makes sense, but what about the RHS? If this is false, what is a counterexample?
What I tried: clearly $(1)$ holds if $f \in C_c^\infty(\Omega)$ and that there exists a sequence $\phi_n \in C_c^\infty(\Omega)$ such that $\phi_n \rightarrow f $ in $W_0^{1,2}{(\Omega)}$, hence $$\int_\Omega g(x)\frac{\partial \phi_n}{\partial x_i}(x)dx \rightarrow \int_\Omega g(x)\frac{\partial f}{\partial x_i}(x)dx,$$ but I'm not able to prove that $$\int_\Omega \frac{\partial g}{\partial x_i}(x)\phi_n(x)dx \rightarrow \int_\Omega \frac{\partial g}{\partial x_i}(x)f(x)dx .$$
I always thought it only holds when $f(x)g(x)|_{\Omega}$ vanishes at the boundaries, otherwise you have to include that term: $$\int_\Omega g(x)\frac{\partial f}{\partial x_i}(x)dx= f(x)g(x)|_{\Omega}-\int_{\delta\Omega} \frac{\partial g}{\partial x_i}(x)f(x)dx $$ Which is the known partial-integration formula.