Let $B_1$ denote the unit ball in $\mathbb{R}^d$, let \begin{equation} \rho(x) = 1-|x| \quad \text{ for } x \in B_1, \end{equation} and let $\sigma >0$ be given. As per the comments, notice that $\rho(x)$ is in fact the distance of $x \in B_1$ to the boundary $\partial B_1$. For $k \geq 0$, consider the following norm \begin{equation} \| u\|_k^2 = \sum_{j=0\\ |\alpha|=j}^k \int_{B_1} \rho^{\sigma+j} |D^\alpha u|^2 dx, \end{equation} and we finally let $\mathcal{H}^k$ denote the completion of $C^\infty(\overline{B_1})$ with respect to the above norm, for $k \geq 0$. In particular, it can be shown that \begin{equation} \mathcal{H}^0 = L^2(B_1, \rho^\sigma dx) := L^2_\sigma, \end{equation} and also \begin{equation} \mathcal{H}^1 = L^2_\sigma \cap \dot{H}^1_{\sigma+1}, \end{equation} where $\dot{H}^1_{\sigma+1}$ is the homogeneous Sobolev space consisting of all $f \in L^1_{loc}(B_1)$ for which the seminorm \begin{equation} \int_{B_1} \rho^{\sigma+1} |\nabla u|^2 dx \end{equation} is finite, and similarly $\mathcal{H}^2 = L^2_\sigma \cap \dot{H}^1_{\sigma+1} \cap \dot{H}^2_{\sigma+2}$. An analogous characterization holds for the higher order $\mathcal{H}^k$ spaces.

Now, using standard integration by parts, it can be seen that

\begin{equation} \int_{B_1} \nabla u \cdot \nabla v \ \rho^{\sigma+1}dx = -\int_{B_1} \nabla \cdot (\rho^{\sigma+1} \nabla u) v dx \quad \forall u, v \in C^\infty(\overline{B_1}), \end{equation}

since the boundary term \begin{equation} \int_{B_1} \rho^{\sigma+1} \nabla u \cdot \nu \ v \ dS \end{equation} vanishes, due to the form of $\rho^{\sigma+1}$ given above.

My question is the following:

May one extend the above integration by parts formula to the case where, say, $u \in \mathcal{H}^2$ and $v \in \mathcal{H}^1$? Moreover, would this mean that $\rho^{\sigma+1} \nabla u \cdot \nu = 0$ on $\partial B_1$ in some "trace sense", a condition which clearly holds for any $u \in C^\infty(\overline{B_1})$?

Many thanks.