# Proving an integration identity using the co-area formula

I want to prove that identity: $$\int _{B^n(0,R)} f(x)dx = \int _0^R r^{n-1} \int _{S^{n-1}} f(ry)dS(y)dr$$

where $$B^n(0,R)$$ is $$n$$-dimensional ball and $$S^{n-1}$$ is the $$(n-1)$$-dimensional sphere (of radius $$1$$)

I start by using the co-area formula with the function $$\phi(x) = |x|$$ and since $$\phi (x) = c$$ is exactly $$cS^{n-1}$$, I get: $$\int _{B^n(0,R)} f(x)dx = \int _0^R \int_{rS^{n-1}} f(x)dS(x)dr$$

Afterwards I thought about the change of variables $$x_i = ry_i$$ which leads me to:

$$\int_0^R \int _{rS^{n-1}} f(x)dS(x)dr = \int_0^R r^n \int_{S^{n-1}} f(ry)dS(y)dr$$ which is almost what I need but the power of $$r$$ is $$n$$ instead of $$n-1$$. I can't understand what is the problem, because I get the power $$n$$ from the jacobian of the variable change ($$J = r^n$$)

Help would be appreciated