I have following summation that I want to implement using Mathematica:
Sum[
If[m == 0 && n == 0
, Nothing
, (1/z^2 + (1/(z - (m 2 π + n 2 π τ))^2 -
1/((m 2 π +
n 2 π τ))^2) /. {z -> π τ}) - (1/
z^2 + (1/(z - (m 2 π + n 2 π τ))^2 -
1/((m 2 π + n 2 π τ))^2) /. z -> π) //
Simplify
], {m, -∞, ∞}, {n, -∞, ∞}
]
Above code returns the following result:
$-\frac{2 \left(\tau ^2-1\right)}{\pi ^2 \tau ^2}$
However, if I remove the If
command in the above summation, Mathematica doesn't do the summation anymore, but I know the above expression is finite when m=0&&n=0
. What's going on here?
Sum
is not handling thatIf
in the way you might expect, and that result is simply the value whenm,n=0
. $\endgroup$Nothing
insideSum
? It has no sense. $\endgroup$Sum
will manage this though. $\endgroup$