I am trying to evaluate the following integral in Mathematica

$$ ∫_{-\infty}^{\infty}\mathrm dk_1∫_{-\infty}^{\infty}\mathrm dk_2 \frac{mπ}{(k_1^2+k_2^2+m^2)^{3/2}}\frac{Δ(k_1^2-k_2^2)}{\sqrt{[Δ(k_1^2-k_2^2)]^2}} $$

Integrate[( m π)/(k1^2 + k2^2 + m^2)^(
  3/2) ((k1^2 - k2^2) Δ)/ 
  Sqrt[(((k1^2 - k2^2)  Δ)^2)], {k1, -Infinity, 
  Infinity}, {k2, -Infinity, Infinity}]

where the second piece is just $\text{sign}(Δ(k_1^2-k_2^2))$. The integrand will flip sign under $k_1\leftrightarrow k_2$, except along the lines $k_1=\pm k_2$ where the integrand is not determined, thus the integral is nontrivial. Indeed, if I naively plug this one into Mathematica, then I obtain $-2π^2\text{sign}(mΔ)$. Now if I perform the following coordinate transformation

$ k_1=k\cos\phi , k_2=k\sin\phi $

which gives

$$ ∫_{0}^{\infty}\mathrm dkk∫_{0}^{2π}\mathrm d\phi \frac{mπ}{(k^2+m^2)^{3/2}}\frac{Δ k^2\cos 2\phi}{\sqrt{(Δ k^2\cos 2\phi)^2}} $$

  k^2 m π Δ Cos[2 ϕ])/((k^2 + m^2)^(3/2) Sqrt[
   k^4 Δ^2 Cos[2 ϕ]^2]) k, {k, 0, 
  Infinity}, {ϕ, 0, 2 Pi}]

which (not surprisingly) gives 0. In fact the following closely related integral is also evaluated to be zero by Mathematica.

$$ ∫_{-\infty}^{\infty}\mathrm dk_1∫_{-\infty}^{\infty}\mathrm dk_2 \frac{mπ}{(k_1^2+k_2^2+m^2)^{3/2}}\frac{Δ k_1 k_2}{\sqrt{(Δ k_1k_2)^2}} $$

Integrate[( m π)/(k1^2 + k2^2 + m^2)^(
  3/2) ((k1 k2) Δ)/ 
  Sqrt[(((k1 k2)  Δ)^2)], {k1, -Infinity, 
  Infinity}, {k2, -Infinity, Infinity}]

The null-result of the second and third integral is probably because Mathematica will first check the symmetry of the numerator before evaluating it.

Now my question is why Mathematica gives a nonzero result for the very first integral? Is it a bug (which I don't think it is likely)? How can I know how Mathematica evaluate the integrals (The command Trace gives something quite not clear.)?

Thank you!

  • $\begingroup$ Are you evaluating a Chern number, or the alike? $\endgroup$ Dec 16, 2018 at 7:04
  • $\begingroup$ @ΑλέξανδροςΖεγγ Yes, I did. But I believe it is zero now, but couldn't prove it yet. $\endgroup$
    – fagd
    Dec 16, 2018 at 17:05
  • $\begingroup$ @wuyudi, it's become a little confusing with your edit: the $\LaTeX$ uses lower case $\delta$, while the Mathematica code uses upper case $\Delta$. Please try to be consistent when making edits like these. $\endgroup$ May 19, 2020 at 11:48

2 Answers 2


If we can assume all variables are real, we can simplify one factor:

FullSimplify[((k1^2 - k2^2) Δ)/Sqrt[(((k1^2 - k2^2) Δ)^2)], {k1, k2, Δ} ∈ Reals]
(*  Sign[(k1 - k2) (k1 + k2) Δ]  *)

Now it's rather obviously zero by symmetry, unless m == 0:

AbsoluteTiming@ Integrate[(m π)/(k1^2 + k2^2 + m^2)^(3/2) Sign[(k1 - k2) (k1 + k2) Δ],
 {k1, -Infinity, Infinity}, {k2, -Infinity, Infinity}, Assumptions -> m > 0]
(*  {29.1478, 0}  *)

Of course, it's easier if we rotate the symmetry to align with the coordinate axes:

AbsoluteTiming@ Integrate[(m π)/(k1^2 + k2^2 + m^2)^(3/2) Sign[(k1 - k2) (k1 + k2) Δ] /.
    {k1 -> (k1 - k2)/Sqrt[2], k2 -> (k1 + k2)/Sqrt[2]},
  {k1, -Infinity, Infinity}, {k2, -Infinity, Infinity}, Assumptions -> m > 0]
(*  {0.458337, 0}  *)

It does seem the result without the assumption that m is a nonzero real number is unreliable. Note that if m is pure imaginary, the integral is divergent. It's a good idea to add the appropriate assumptions.

  • $\begingroup$ If I don't forget the factor of m in the numerator, the integral is even more obviously zero for m == 0 :) $\endgroup$
    – Michael E2
    Jan 15, 2019 at 19:59

Another way to verify is to evaluate the integral in pieces without limits and manually apply the limits. It's extra work, but if you doubt the result, it may be worth checking. The inner k2 integral.

k2int[k2_] = Integrate[((m*Pi)*((k1^2 - k2^2)*Δ))/((k1^2 + k2^2 + m^2)^(3/2)*
      Sqrt[((k1^2 - k2^2)*Δ)^2]), k2]//Simplify

Differentiate to check the result.

D[k2int[k2], k2] // Simplify

And we get back to the integrand. Now apply the limits.

intk2 = Limit[k2int[k2], k2 -> ∞] - Limit[k2int[k2], k2 -> -∞] // Simplify
(*-((2 π Δ m)/(Sqrt[Δ^2] (k1^2 + m^2)))*)

Now integrate over k1.

intk1[k1_] = Integrate[intk2, k1]


D[intk1[k1], k1]//Simplify

checks ok. Apply limits to get the final integral.

int = Limit[intk1[k1], k1 -> ∞] - Limit[intk1[k1], k1 -> -∞]
(*-((2 π^2 Δ Sqrt[1/m^2] m)/Sqrt[Δ^2])*)

which could be further simplified with assumptions for Δ and m

  • $\begingroup$ Thank you for the answer. Now I can guess this is how "Integrate" works: integrate without limits first then apply the limit later. This helps me to get a nonzero result for the second integral in polar coordinate, it is actually much faster!! But it will still give a null result for the third one. Do you have any idea to get around it? $\endgroup$
    – fagd
    Dec 16, 2018 at 0:12
  • $\begingroup$ Are you sure it's not zero. If you set fn[k2_] = the third integrand you will see fn[k2] == -fn[-k2]. A purely odd function should integrate to 0 for equal plus and minus limits. As far as the second integral, I don't understand why MMa can't cancel the Cos[2 phi] top and bottom to get a non-zero integral in phi. The integration limits should tell it that phi is real. $\endgroup$
    – Bill Watts
    Dec 16, 2018 at 0:59
  • 2
    $\begingroup$ I would be wary about using this method to compute integrals in Mathematica. $\endgroup$
    – march
    Dec 17, 2018 at 5:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.