Using conditional expression in summation

Hi,
I have the following sum to compute numerically using wolfram mathematica and i cant seem to succeed limiting my variables as intended. The sum is:

I tried using ConditionalExpression as follows:

Screenshotfrom2020-10-1209-45-29.png

But to no avail. Code for copying:

ConditionalExpression[\!\(
\*UnderoverscriptBox[\(\[Sum]\), \(n = \(-\[Infinity]\)\), \(\
\[Infinity]\)]
\*FractionBox[\(1\), \(
\*SuperscriptBox[\(n\), \(2\)] 
\*SuperscriptBox[\((n - m)\), \(2\)]\)]\), {n != {0, m}, 
  m \[Element] Integers}]

Does anybody know how to write the conditions properly so mathematica will solve the summation?

edit:
I have also tried the following way, but still the compiler doesn’t recognize m,n from the conditions in the actual summation:

code for copy:

Assuming[Element[m, Integers] && n != 0 && n != m, Simplify[\!\(
\*UnderoverscriptBox[\(\[Sum]\), \(n = \(-\[Infinity]\)\), \(\
\[Infinity]\)]
\*FractionBox[\(1\), \(
\*SuperscriptBox[\(n\), \(2\)] 
\*SuperscriptBox[\((n - m)\), \(2\)]\)]\)]]

Thanks for helping! :>

The sum can be split into 2 large pieces: n from -infinity to -1, plus n from 1 to +infinity. Then you have 3 cases for m: m < 0, m==0, and m>0.

I actually did the first one (splitting it into 2 summations), but i cant see how seperating it to m<0, m=0, m>0 is equivalent to ‘m is an integer’.
i have tried a new approach based on your answer:

code:

Assuming[m \[Element] Integers, \!\(
\*UnderoverscriptBox[\(\[Sum]\), \(n = \(-\[Infinity]\)\), \(-1\)]
\*FractionBox[\(1\), \(
\*SuperscriptBox[\(n\), \(2\)] 
\*SuperscriptBox[\((n - m)\), \(2\)]\)]\) + \!\(
\*UnderoverscriptBox[\(\[Sum]\), \(n = 1\), \(\[Infinity]\)]
\*FractionBox[\(1\), \(
\*SuperscriptBox[\(n\), \(2\)] 
\*SuperscriptBox[\((n - m)\), \(2\)]\)]\)]

and arrived to the following solotioun:

This might be the intended solution, but i am not certain. We have never used PolyGamma functions before, and although we dont really need to study it to get this result, i suspect it is not what the exercise was aiming for. I guess i am expecting a nice convergance to a compact form. So am i just paranoid or wolfram really misinterpet my quary?

Do you have access to Gradshteyn and Ryzhik?

I do, but couldnt find it there… At least not in the series section.

For the 3 cases of m, think about what happens to the denominator. For example, it is n^4 when m=0, so the two split summation terms are equal.

Hi Michael,

Try FullSimplify on the result

Assuming[Element[m, Integers], 
 Sum[1/(n^2*(n - m)^2), {n, -Infinity, -1}] + Sum[1/(n^2*(n - m)^2), {n, 1, Infinity}]]

(*
(12 EulerGamma + m \[Pi]^2 + 12 PolyGamma[0, 1 - m] + 
  6 m PolyGamma[1, 1 - m])/(
 6 m^3) + (-12 EulerGamma + m \[Pi]^2 - 12 PolyGamma[0, 1 + m] + 
  6 m PolyGamma[1, 1 + m])/(6 m^3)
*)

FullSimplify@%

(*
(-9 + m^2 \[Pi]^2 + 3 m \[Pi] Csc[m \[Pi]]^2 (m \[Pi] + Sin[2 m \[Pi]]))/(3 m^4)
*)

Cool this is helpful!
Now it looks like a more sensable answer thanks.
I guess the code was interperted correctly

Wow that is amazing. Thank you!

When I asked how splitting the ‘m’ into cases is the same as ‘m in Z’ I meant that by splitting you are still allowing ‘m’ to any Real number within those cases.

I see what you did there and this is very clever. I guess the fact that ‘m’ is part of the SUM limit force it to be an integer? Am I right?

I took m to be an integer because it is stated in your problem definition. :slight_smile:

haha obviously :D.

But how does Wolfram Mathematica know it needs to limit m to be an integer? The way you wrote it does not imply such a restriction on the code, yet it outputs the correct solution.

To be clear:
m>0 contains the case where m=1.59723621 which is not something i want to allow when im doing the summation

m is a parameter of the expression. Whether it is integer or real has no impact on the solution.

The sum looks familiar from decades ago. I’ve no recollection though of where it arises.