It has been appeared $\delta(\mathbf r_1 -\mathbf r_2)$ in one of my integrals which I have to calculate. The differentials of the integral are $dr_1d\theta_1d\phi_1 dr_2d\theta_2d\phi_2$ So I need to write this Dirac delta in spherical coordinates. I just found $$ \delta(\mathbf r_1 -\mathbf r_2)=\frac{1}{r_1^2}\delta(r_1 -r_2)\delta(\cos\theta_1 -\cos\theta_2)\delta(\phi_1 -\phi_2) $$ by searching the web, but I'm not sure about that. How can I deal with this problem?
Addendum
This is my code and I try to calculate the result of ep
. Note that by DirecDelta[re-rp]
I mean $\delta(\mathbf r_e-\mathbf r_p)$ namely vectors of $r_e$ and $r_p$ beacaue I didn't know how to write them in my code (spirit of my question)!
mp = 1836;
\[Omega] = 10^-2;
me = 1;
M = mp + me;
{\[Alpha], \[Beta]} = \
{0.99930605221867707665950320006231777369976043701171875`50.,
0.00014974969686706935865193324186606105286045931279659271240234375\
`50.};
\[Gamma] = 1/2*M*\[Omega];
norm = 2.12025232778742133718363166442892649864;
a = SetPrecision[2.35, 50];
b = SetPrecision[2.4, 50];
c = SetPrecision[3.2, 50];
intrE[r_, re_] := (
E^(-2 r (\[Alpha] + r \[Beta])) (E^(-((
2 (me re + mp (-r + re))^2 \[Gamma])/M^2)) -
E^(-((2 (me re + mp (r + re))^2 \[Gamma])/M^2))) M^2)/(
4 mp (me + mp) \[Gamma]);
intE[re_?NumericQ] := (2*\[Pi])/re norm^2*
NIntegrate[r intrE[r, re], {r, 0, \[Infinity]}];
intrp[r_, rp_] := (
E^(-2 r (\[Alpha] + r \[Beta])) (E^(-((
2 (mp rp + me (-r + rp))^2 \[Gamma])/M^2)) -
E^(-((2 (mp rp + me (r + rp))^2 \[Gamma])/M^2))) M^2)/(
4 me (me + mp) \[Gamma]);
intP[rp_?NumericQ] := (2*\[Pi])/rp norm^2*
NIntegrate[r intrp[r, rp], {r, 0, \[Infinity]}];
ep = -NIntegrate[(
re^2*rp^2*intE[re]*intP[rp]*
DiracDelta[re - rp] Sin[\[Theta]e] Sin[\[Theta]p])/(
a - b*Sqrt[intE[re]*intP[rp]] + c *intE[re]*intP[rp]), {\[Theta]e,
0, \[Pi]}, {\[Theta]p, 0, \[Pi]}, {re, 0, \[Infinity]}, {rp,
0, \[Infinity]}, {\[Phi]e, 0, 2 \[Pi]}, {\[Phi]p, 0, 2 \[Pi]}]
Integrate[ DiracDelta[x] Which[x^2 < b^2, Exp[b^2/(b^2 - x^2)], True, 0], {x, -Infinity, Infinity}, Assumptions -> b > 0]==E
$\endgroup$DiracDelta
"Numerical routines will typically miss the contributions from measures at single points". $\endgroup$