The substitution in $\mathbb R^n$ goes as follow : If $\varphi: U\to \mathbb R^n$ is injective and $\mathcal C^1$ where $U\subset \mathbb R^n$ is open, and $f$ is continuous then $$\int_{\varphi(U)} f=\int_{U}f(\varphi)|\det J_\varphi|$$ where $J_\varphi$ is the Jacobian matrix of $\varphi$.
As a remark it's written that "If $\varphi$ and $\varphi'$ can be extend continuously to $\bar U$, taking $\bar U$ instead of $U$ in the remark doesn't change the result" and I tried to understand why.
Would it be for the following reason : If $U$ is open, then $\bar U=U\cup \partial U$ where $\partial U$ is the boundary of $U$. Since $\varphi$ is continuous and injective, we have that $\varphi(\bar U)=\varphi(U)\cup \partial \varphi(U)$ and since $U$ and $\varphi(U)$ are open, $\partial U$ and $\partial \varphi(U)$ has measure $0$, so finally
$$\int_{\varphi(\bar U)} f=\int_{\varphi(U)} f+\underbrace{\int_{\partial\varphi( U)}f}_{=0}=\int_{U}f(\varphi)|\det J_\varphi|=\int_{U}f(\varphi)|\det J_\varphi|+\underbrace{\int_{\partial U}f(\varphi)|\det J_\varphi|}_{=0}=\int_{\bar U}f(\varphi)|\det J_\varphi|.$$
Question: Is this the reason ?