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?
 A: 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.
A: I would just rely on the standard formula for integration with a delta function:
\begin{equation}
  \int_{x_1}^{x_2} f(x) \delta(x-a) \, dx
  =
  \begin{cases}
    f(a), & \text{if $x_1 < a < x_2$}, \\
    0, & \text{otherwise}.
  \end{cases}
\end{equation}
You can also consider the integration range in the left-hand side as a path $\mathcal{C}$ on the complex plane, and then it gives a non-zero result only when the path $\mathcal{C}$ passes through the point $a$.
I start from the OP's result:
\begin{equation}
\begin{split}
  I &\equiv
  \int_{-\infty}^\infty
  \int_{-\infty}^\infty
  \delta(x^2+y^2-R^2) \, dx dy \\
  &=
  \int_{-\infty}^\infty
  \int_{-\infty}^\infty
  \frac{1}{2\sqrt{R^2-y^2}} \Biggl[
    \delta\left(x-\sqrt{R^2-y^2}\,\right)
  + \delta\left(x+\sqrt{R^2-y^2}\,\right)
  \Biggr] dx dy.
\end{split}
\end{equation}
You can integrate it over $x$ by the delta function for each term, but it leads to a non-zero result only when $\sqrt{R^2-y^2}$ is real; otherwise, the integration path of $x$ does not pass through $\sqrt{R^2-y^2}$ (or -$\sqrt{R^2-y^2}$ for the second term). For this reason, you will get a constraint $-R<y<R$. The two terms give the same result, so the factor $2$ in the denominator cancels. The final result is:
\begin{equation}
  I
  =
  \int_{-R}^R
  \frac{dy}{\sqrt{R^2-y^2}} = \pi.
\end{equation}
A: 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.
