change of variables confusion Super dumb question but I can't seem to figure out what I'm doing wrong.
Let $E$ be some set and $E_r= \{ x \mid rx \in E\}$ for $r>0$. Then if $\phi \in C^1_c(\mathbb{R}^n;\mathbb{R}^n)$
$$\int_{E_r} \operatorname{div}(\phi(x))\,dx = \frac{1}{r^{n-1}}\int_E \operatorname{div}(\phi(y/r)) \, dy.$$
I applied the change of variables $x = y/r$ so then $dx = dy/r^n$ and the new domain of integration becomes $E$, but I don't know how to get this $n-1$ term in place of $n$.
 A: $\renewcommand\div{\mathrm{div}}$
Remember that the change of variables says
$$\int_{g(E)} f = \int_E (f\circ g) \cdot \;|\det g'|$$
Now let $g(y)=y/r$, so that
$$E_r=\{x\mid rx\in E\}=\{g(y)\mid y\in E\}=g(E)$$
Then
$$\begin{align*}
\int_{g(E)} \div\phi
&= \int_{E} ((\div\phi)\circ g)\cdot |\det g'|
\end{align*}$$
and you can calculate that
$$\begin{align*}
\div(\phi\circ g) &= \frac{1}{r}(\div\phi)\circ g \\[1mm]
|\det g'| &= \frac 1 {r^n}
\end{align*}$$
Solving from the first formula, you get
$(\div\phi)\circ g = r\cdot \div(\phi\circ g)$, so that
$$\begin{align*}
\int_{E_r} \div\phi
&= \int_{E} r\cdot ((\div\phi)\circ g)\cdot \frac 1{r^n}
\\
&= \frac{1}{r^{n-1}}\int_{E} (\div\phi)\circ g
\end{align*}$$
as you wanted.
Or, in the notation $\int_E f(x)\,dx=\int_E f$
$$\begin{align*}
\int_{E_r} (\div\phi)(x)\,dx
&= \frac{1}{r^{n-1}}\int_{E} (\div\phi)(g(y))\,dy.
\end{align*}$$
I think a possible source of your confusion is the notation $\div(\phi(x))$. Let me explain.
What we do is that we first apply the divergence operator $\div$ to the function $\phi:\mathbb R^n\to\mathbb R^n$, which yields another function $\div\phi:\mathbb R^n\to\mathbb R$. Then you evaluate $\div\phi$ at $x\in E_r$, giving you a real number $(\div\phi)(x)$. I'm of the opinion that you should not denote $(\div\phi)(x)$ as $\div(\phi(x))$.
First: if you take notation seriously, then $\div(\phi(x))$ should be zero, since $\phi(x)$ is the value of $\phi$ at $x$, so that it is already a point in $\mathbb R^n$ and hence its derivative is zero.
Second, and this the worst: if you write $(\div\phi)(x)$ as $\div(\phi(x))$, now the notation $\div(\phi(y/r))$ is confusing, because some people may interpret it as $(\div(\phi\circ g))(y)$, where $g(y)=y/r$ (as before) and some other may interpret it as $(\div\phi)(g(y))$.
My hypothesis is that this made you think that $\div(\phi\circ g)$ is the same as $(\div\phi)\circ g$, which is not true: as you have seen, they differ by a factor of $r$, which is precisely the missing $r$.
