Two dimensional integral involving Dirac delta It seems to me that
$$
\int_{-\infty}^\infty \int_{-\infty}^{\infty} \delta(x^2 + y^2 - R^2) dx dy
$$
should evaluate to $2\pi R$, the perimeter of a circle of radius $R$, but I'm having trouble getting this answer. I tried using the identity
$$
\delta(x^2 + y^2 - R^2) = \frac{1}{2\sqrt{R^2 - y^2}}\left[\delta\left(x - \sqrt{R^2 - y^2}\right) + \delta\left(x + \sqrt{R^2 - y^2} \right)\right]
$$
But it wasn't clear to me how to evaluate the $x$ integral after making this substitution. 

How do you evaluate the above integral? Does the integral represent the perimeter of a circle of radius $R$? If not, how should such an integral be written?
Keep in mind the dirac delta is not a function, but rather a distribution. In fact, its precise definition (in this case) is that for all test functions $f(x,y)$,
$$
\int_{\mathbb R^2}f(x,y)\delta(x^2+y^2-R^2)\ dx\ dy :=\int_{\theta=0}^{2\pi}f(R\cos\theta,R\sin\theta)\ d(R\theta).
$$
The left side has no independent meaning - it is defined to equal the right side.

In your case, take $f(x,y)$ to be the constant $1$ function and you get your answer.



EDIT: After the discussion in the comments, I see this question really boils down to asking


  What is a precise definition of $\delta(g(x,y))$?


More generally, one may ask for the definition of $\delta(g)$ where $\delta$ is the $n$-dimensional delta function and $g\colon \mathbb R^n\to \mathbb R^n$ is a smooth function. And the answer turns out to be that there is no such definition that has all the desired properties in general, even for $n=1$. An explicit counterexample is furnished in Remark 2 of these notes by Terry Tao.
Delta functions are just shorthand notation to restricting integration to a lower dimensional region (in this case, a circle). Delta function only makes real sense inside an integral, and has its own rules for changing variables.

In this case, just change variables to polar coordinates (not forgetting the Jacobian):

$$\int_{-\infty}^\infty\int_{-\infty}^\infty \delta(x^2+y^2-R^2)dx\,dy=
\int_0^{2\pi}\int_0^\infty \delta(r^2-R^2)r\,dr\,d\phi$$
The $\phi$ integral is trivial:
$$\color{red}{=2\pi\int_0^\infty \delta(r^2-R^2)r\, dr }$$

Consider now the defining property of the delta function that says it just evaluates the function at its peak position:

$$\int f(x)\delta(x-x_0)dx=f(x_0)$$

The other important part is the variable substitution rule:

$$\delta(g(x))=|g'(x_0)|^{-1}\delta(x-x_0)$$
where $x_0$ is the zero of $g(x)$.

In our case, $g(r)=r^2-R^2=(r-R)(r+R)$ has a zero at $r=R$ (the negative one is outside the integration range). We have $g'(R)=2R$. So, the above integral in $\color{red}{\text{red}}$ can be transformed into

$$=2\pi\int_0^\infty \frac{1}{2R}\delta(r-R)r\, dr=\pi$$

where we took into account that this delta function just evaluates the function $\frac{r}{2R}$ at $r=R$.

Notice that it is extremely important that the argument of the delta function is not $\sqrt{x^2+y^2}-R=r-R$ but $x^2+y^2-R^2=r^2-R^2$.

Another way of looking at this is to start from the red integral again, but change variables to $r^2=u$.

$$2\pi\int_0^\infty \delta(r^2-R^2)r\, dr=
2\pi\int_0^\infty \delta(u-R^2)\frac{du}{2}=\pi
$$
where the delta function now just evaluated function $\frac{1}{2}$ at $u=R^2$ which doesn't matter because the function was just a constant.

The moral of the story: it's not just important where the zero of the delta function's argument is, you have to take into account the functional form (especially the derivative). Stretched delta isn't the same as delta even if the peak is at the same place. If you imagine it as a narrow and tall Gaussian peak, you can see that stretching the function by changing variables changes its area.

You could also write your delta function as $$\delta(r^2-R^2)=\delta((r-R)(r+R))\equiv \delta(2R(r-R))\neq \delta(r-R)$$ where I took into account that the pre-factor $r+R$ is only important where $r=R$, so I put that in.