User:IlIIllIIIIlllIlIIllllIllllII/sandbox

$$

Proof of Theorem. We use the Einstein summation convention. By using a partition of unity, we may assume that $$u$$ and $$X$$ have compact support in a coordinate patch $$O \subset \overline{\Omega}$$. First consider the case where the patch is disjoint from $$\partial \Omega$$. Then $$O$$ is identified with an open subset of $$\mathbb{R}^n$$ and integration by parts produces no boundary terms: $$ \begin{align} (\operatorname{grad} u, X) &= \int_{O}\langle \operatorname{grad} u, X \rangle \sqrt{g}\,dx \\ &= \int_{O}\partial_j u X^j \sqrt{g}\,dx \\ &= -\int_{O}u \partial_j(\sqrt{g}X^j)\,dx \\ &= -\int_{O} u \frac{1}{\sqrt{g}}\partial_j(\sqrt{g}X^j)\sqrt{g}\,dx \\ &= (u, -\frac{1}{\sqrt{g}}\partial_j(\sqrt{g}X^j)) \\ &= (u, -\operatorname{div} X). \end{align} $$ In the last equality we used the Voss-Weyl coordinate formula for the divergence, although the preceding identity could be used to define $$-\operatorname{div}$$ as the formal adjoint of $$\operatorname{grad}$$. Now suppose $$O$$ intersects $$\partial \Omega$$. Then $$O$$ is identified with an open set in $$\mathbb{R}_{+}^n = \{x \in \mathbb{R}^n : x_n \geq 0\}$$. We zero extend $$u$$ and $$X$$ to $$\mathbb{R}_+^n$$ and perform integration by parts to obtain $$ \begin{align} (\operatorname{grad} u, X) &= \int_{O}\langle \operatorname{grad} u, X \rangle \sqrt{g}\,dx \\ &= \int_{\mathbb{R}_+^n}\partial_j u X^j \sqrt{g}\,dx \\ &= (u, -\operatorname{div} X) - \int_{\mathbb{R}^{n - 1}}u(x', 0)X^n(x', 0)\sqrt{g(x', 0)}\,dx', \end{align} $$ where $$dx' = dx_1 \dots dx_{n - 1}$$. By a variant of the straightening theorem for vector fields, we may choose $$O$$ so that $$\frac{\partial}{\partial x_n}$$ is the inward unit normal $$-N$$ at $$\partial \Omega$$. In this case $$\sqrt{g(x', 0)}\,dx' = \sqrt{g_{\partial \Omega}(x')}\,dx' = dS$$ is the volume element on $$\partial \Omega$$ and the above formula reads $$ (\operatorname{grad} u, X) = (u, -\operatorname{div} X) + \int_{\partial \Omega}u\langle X, N \rangle \,dS. $$ This completes the proof.