If $F:\mathbb{R^2} \rightarrow \mathbb{R}$ is a differentiable function, then from gradient theorem, for 2D domain $\Omega$ with boundary $\Gamma$, we have,
$$ \int_{\Omega}{ \nabla F \hspace{3pt} dxdy} = \int_{\Gamma} F \mathbf{\hat{n}} \hspace{3pt}ds$$
If $u,w$ are two scalar values functions $\mathbb{R^2} \rightarrow \mathbb{R}$ I am confused whether this relation holds:
$$\int_{\Omega} (\nabla u)w \hspace{3pt}dxdy = - \int_{\Omega} u(\nabla w) \hspace{3pt}dxdy + \int_{\Gamma} \mathbf{\hat n}wu\hspace{3pt}ds$$
I can see, from gradient theorem, that $$\int_{\Omega} (\nabla u)w \hspace{3pt}dxdy =\int_{\Gamma} \mathbf{\hat n} \hspace{3pt} uwds$$
How to obtain first part of the second equation? Any ideas?
Let $g= w $ and $dh = \nabla u $ then using integration by part, $\int_{\Omega} gdh = \int_{\partial \Omega} gh ds - \int h dg $
you will have
$\int_{\Omega} (\nabla u) w dxdy = \int_{\partial \Omega} wu\cdot \vec{n} ds - \int_{\Omega} u(\nabla w) dxd $
Note that here $\partial \Omega = \Gamma$