Formal adjoint of the exterior derivative on a manifold with boundary Let $(M,g)$ a compact Riemmanian manifold with boundary. I want to define the formal adjoint of the exterior derivative $\mathrm d\colon C^\infty(M)\to \Omega^1(M)$.
If $\partial M=\emptyset$ and $\xi$ is $1$ differential form on $M$, I can define $\mathrm d^\star \xi$ from the formula
$$
\langle f,\mathrm d^\ast \xi\rangle =\langle\mathrm d f,\xi\rangle
$$
imposing its validity for all $f\in C^\infty(M)$
If $\partial M\ne \emptyset$, Initially I thought substituting $C^\infty(M)$ with $C^\infty_0(M)$ (the space of scalar function with compact support contained in the interior of $M$) but I'm not sure that proceeding in this way $\mathrm d^\ast\colon \Omega^1(M)\to C^\infty(M)$ is well defined.
So, how I define $\mathrm d^\ast\colon \Omega^1(M)\to C^\infty(M)$ whene $M$ ad a non-void boundary?
Thanks in advance
 A: The definition of the formal adjoint is usually given in both cases (compact manifold with empty or not empty boundary) by testing against $C_0^\infty$ sections  (compactly supported). Of course in the case $\partial M = \emptyset$ it's the same as using $C^\infty$ sections.
The main difference is that now the formula $\langle df, \omega\rangle_{L^2(M)} = \langle f, d^*\omega\rangle_{L^2(M)}$ will hold only when $\omega $ (or $f$) vanish on $\partial M$.
In general, if $\omega$ or $f$ do not vanish on the boundary there will be an extra term , more precisely
$$\int_M \langle df, \omega\rangle \operatorname{vol}_M= \int_M \langle f, d^*\omega\rangle \operatorname{vol}_M+ \int_{\partial M}\langle \nu\wedge f, \omega\rangle\operatorname{vol}_{\partial M}$$
where $\nu = \langle\cdot, \frac {\partial}{\partial n}\rangle \in \Omega^1(M)$ is dual to the normal to the boundary.
The reason for this definition is functional Analysis.
Indeed $d$ defines  a closed, unbounded, densely defined operator $L^2(M)\to L^2(\Lambda^1M)$ ($L^2$-section), with a certain domain. Its  Von-Neumann adjoint coincides (in its domain of definition) with $d^*$ (beware in general the Von-Neumann adjoint is defined on a subset of the domain of the natural extension of $d^*$ to $L^2$).
What you gain is therefore a decomposition
$$L^2(M) = \ker (d)\oplus \overline{Im(d^*)}$$
$$L^2(\Lambda^1M) = \overline{Im(d)}\oplus \ker(d^*)$$
where  $d, d^*$ here are, with a little abuse of language, the extensions with the natural extended domain for $d$ and the domain given by the definition of Von-Neumann adjoint for $d^*$.
