I would like to evaluate the following sum (numerically will suffice): $$ \sum_{m,n=-\infty,(m,n)\neq(0,0)}^{\infty}\frac{1}{m^{4}+n^{4}} $$ I first tried to do $$ \sum_{m,n=1}^{\infty}\frac{1}{m^{4}+n^{4}} $$

NSum[1/(m^4 + n^4), {m, 1, Infinity}, {n, 1, Infinity}]

but got the error "Summand (or its derivative) -((4.\m^3)/(m^4+n^4)^2) is not numerical
at point n = 1.`." I don't understand this as it's a well-behaved, convergent sum. What is going on here?

In terms of the original sum I want to calculate, I'm not sure how to elegantly eliminate the $(m,n)=(0,0)$ term. I thought of using a Kronecker Delta like

NSum[(1 - KroneckerDelta[m, 0] KroneckerDelta[n, 0])/(m^4 + 
    n^4), {m, -Infinity, Infinity}, {n, -Infinity, Infinity}]

but it still complains about the infinite term. How can I avoid this?

Thanks in advance for any help.

  • 1
    $\begingroup$ For the first sum, you can exclude $(0,0)$ by making it contribute zero to the sum at that point with Piecewise[{{0, m == n == 0}}, 1/(m^4 + n^4)] $\endgroup$
    – flinty
    Apr 26, 2021 at 16:41
  • $\begingroup$ A similar question was asked, answered, and closed here. $\endgroup$
    – user64494
    Apr 26, 2021 at 17:44

3 Answers 3


Too long for a comment. The double sum under consideration can be treated as an iterated sum and the inner sum has a closed form:

f[n_] := Sum[Piecewise[{{1/(m^4 + n^4), m^2 + n^2 != 0}, {0, 
True}}], {m, -Infinity, Infinity}]

-((\[Pi] Sin[Sqrt[2] n \[Pi]])/( Sqrt[2] n^3 (Cos[Sqrt[2] n \[Pi]] - Cosh[Sqrt[2] n \[Pi]]))) - (\[Pi] Sinh[Sqrt[2] n \[Pi]])/( Sqrt[2] n^3 (Cos[Sqrt[2] n \[Pi]] - Cosh[Sqrt[2] n \[Pi]]))

or in $\LaTeX$ $$-\frac{\pi \sin \left(\sqrt{2} \pi n\right)}{\sqrt{2} n^3 \left(\cos \left(\sqrt{2} \pi n\right)-\cosh \left(\sqrt{2} \pi n\right)\right)}-\frac{\pi \sinh \left(\sqrt{2} \pi n\right)}{\sqrt{2} n^3 \left(\cos \left(\sqrt{2} \pi n\right)-\cosh \left(\sqrt{2} \pi n\right)\right)}$$ and f[0]==\[Pi]^4/45. You may play with it on your own. It's time to go to bed for me.


Divide the index ranges from - Infinity to Infinity into separate sums from - Inf to - 1 and 1 to Inf plus index = 0 and you get partial sums (1/(m^4 + n^4) is even) you can evaluate like

Table[4 (ParallelSum[1./(m^4 + n^4), {m, 1, 10^k}, {n, 1, 10^k}] + 
ParallelSum[1./(m^4), {m, 1, 10^k}]), {k, 1, 4}]
(* {7.34484946634854, 7.375876361817944, 7.3762162344005695, 7.376219664150702} *)

With index pairs {m,n} shown in the plot

enter image description here

the sum is easy evaluated to

4 NSum[1/((m - n)^4 + n^4), {m, 1, Infinity}, {n, 0, m - 1}]
  • $\begingroup$ Why 7.376022908995918 < 7.376219664150702 as in the Andreas' answer? $\endgroup$
    – user64494
    Apr 27, 2021 at 16:00
  • $\begingroup$ @user64494 compare 4*NSum[1/((m - n)^4 + n^4), {m, 1, 10^3}, {n, 0, m - 1}] with 4*N[Sum[1/((m - n)^4 + n^4), {m, 1, 10^3}, {n, 0, m - 1}], 10].The sums increase monotonically with the stop summation index. To use NSum with large summation index (or infinity) may be calling for trouble. $\endgroup$
    – Andreas
    Apr 27, 2021 at 17:06

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.