A result like this appears as one of the terms when I compute coefficients in a Fourier Series:

expr =(Sin[n*Pi])/((-4 + n^2))

If I simplify all my terms, this happens:

Simplify[expr, Assumptions -> Element[n, Integers]] (*returns a zero*)

Which is true except if n=-2 or 2:

Limit[expr, n -> 2] (*give Pi/4*)

Shouldn't Simplify catching that?


1 Answer 1


(* "12.2.0 for Mac OS X x86 (64-bit) (December 12, 2020)" *)


From the "Possible Issues" section of the documentation for Simplify, "results of simplification of expressions with singularities are uncertain"

expr = (Sin[n*Pi])/((-4 + n^2));

The general result would be

expr = Module[{
   roots = n /. Solve[Denominator[expr] == 0, n]},
     {expr, And @@ Thread[roots != n]},
     Sequence @@ ({Limit[expr, n -> #], n == #} & /@ roots)}],
   Element[n, Integers]]]

enter image description here

  • $\begingroup$ Yup. I should have looked at Possible Issues before posting. Thanks @BobHanlon. $\endgroup$ Commented Jan 26, 2021 at 21:05

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.