I would like to compute the following integral, which arises from some physics problems, where $k_2$, $k_3$ are real, $z$ is in general complex, $$ \int_0^{2\pi}\int_0^{2\pi}\delta(k_2\cdot e^{i\theta}+k_3\cdot e^{j\phi} +z )d\theta d\phi $$ First integrate over $\theta$,
$$ \int_0^{2\pi} \delta(k_2\cdot e^{i\theta}+ \gamma)d\theta,\qquad \gamma=k_3\cdot e^{j\phi} + z $$
Then make the change of variables,
$$ \oint_c \delta(k_2\cdot x+ \gamma)\cdot\frac{1}{ix} dx =\oint_c i \frac{k_2}{\gamma}dx = 2\pi i \cdot\frac{k_2}{\gamma} $$
Plug this into the integral over $\phi$, do the same change of variable,
$$ \int_0^{2\pi} 2i\pi\cdot\frac{k_2}{k_3\cdot e^{j\phi} + z} d\phi=\oint_c 2i\pi\cdot\frac{k_2}{k_3\cdot y + z}\cdot\frac{1}{iy} dy = 2\pi \oint_c \frac{k_2/k_3}{y( y + z/k_3) }dy, $$
Finally apply the residue theorem,
$$ R(0)=2\pi(k_2/k_3)\lim_{y \to 0} y\cdot \frac{1}{y( y + z/k_3)} = (2\pi i)\cdot 2\pi k_2/z $$
while if $|-z/k_3|<1$,
$$ R(-z/k_3)=2\pi(k_2/k_3)\lim_{y \to -z/k_3} ( y + z/k_3)\cdot \frac{1}{y( y + z/k_3)}= - (2\pi i)\cdot 2\pi k_2/z $$
I was wondering if I did something wrong, in this case $z$ has to be pure imaginary to get the final integral real? also, it seems strange because the result does not explicitly depend on $k_3$.
I am no expert in the ways physicists manipulate Dirac deltas but I believe that, for every suitable functions $u$ and $v$, they consider that $$ \int \delta(u(t))v(t)\mathrm dt=\sum_t\frac{v(t)}{|u'(t)|}, $$ where the sum is on the finite set of roots $t$ of $u(t)=0$. Thus, for every nonzero $\gamma$, $$\int_0^{2\pi} \delta(k_2\cdot e^{i\theta}+ \gamma)\mathrm d\theta=\frac1{|\gamma|},$$ provided $|k_2|=|\gamma|$. The integral is zero otherwise. Applying this to each $\gamma=k_3\mathrm e^{i\phi}+z$, one sees that the double integral is $$\int_0^{2\pi}\frac{\mathbf 1_{|k_3\mathrm e^{i\phi}+z|=|k_2|}\mathrm d\phi}{|k_3\mathrm e^{i\phi}+z|}=\frac1{|k_2|}\int_0^{2\pi}\mathbf 1_{|k_3\mathrm e^{i\phi}+z|=|k_2|}\mathrm d\phi,$$ which is zero in general. The exceptions are when $z=0$ and $|k_3|=|k_2|\ne0$, and then the value is $\dfrac{2\pi}{|k_2|},$ and when $z=|k_3|=|k_2|=0$, and then the value is $4\pi^2$.