# Abs[.] breaks my infinite sum

The following evaluates correctly to pi^2/4:

Sum[n^2  (Sin[n π]/(-1 + n^2))^2, {n, 1, ∞}]


The following gives a 1/0 error:

Sum[n^2  (Abs[Sin[n π]/(-1 + n^2)])^2, {n, 1, ∞}]


Why is that?

• Assuming[n > 0, Sum[n^2 (Abs[Sin[n \[Pi]]/(-1 + n^2)])^2, {n, 1, \[Infinity]}]] evaluates to Pi^2/4, too. – Michael E2 Feb 28 '18 at 12:52

Why do you say the first is correct? Its first term is indeterminate. For a guess, Sum used an analytic method that treated n as continuous internally, and removed the removable singularity at n==1, thus doing what you intended but not what you actually asked. When you used the non-analytic function Abs, it didn't do that.

More commentary in response to @Nasser:

The numerator of the function is always zero, so only the first term, whose denominator is zero, matters. Then:

Limit[n^2 (Sin[n \[Pi]]/(-1 + n^2))^2, n -> 1]
(* \[Pi]^2/4 *)


So, in a peculiar sense, the first sum is correct. That sense seems to be what @user120404 intended. I don't consider it correct, but perhaps this odd corner case is difficult for Mathematica to detect.

• Do you think Mathematica answer is then correct giving Pi^2/4? Is this a known series? Strange it sums it even with 1/0 being there. – Nasser Feb 27 '18 at 23:29
• When n=1, you get 0/0. In the limit, though, as n approaches 1, you get Pi2/4. – rhomboidRhipper Feb 27 '18 at 23:49
• @rhomboidRhipper sorry, meant to say Mathematica gives error Indeterminate for n=1. This happens in both cases. Since 0/0 is not defined. Does this mean Mathematica can do sum even if some terms in the series are Indeterminate? – Nasser Feb 27 '18 at 23:51