5
$\begingroup$

Consider the following code and its output:

Simplify[Sin[n Pi]/n, Assumptions -> Element[n, Integers]
(* 0 *)

However when I try

Simplify[Sin[n Pi]/n, Assumptions -> n == 0]

Simplify::infd: Expression Sin[n Pi]/n simplified to Indeterminate.

Indeterminate

I am wondering why didn't Simplify included the separate case n=0 in the first output, and how to avoid this type of errors.

$\endgroup$
2
  • 1
    $\begingroup$ In a pre-calclulus book I once used, an algebraic identity was an equation which is true for all values of the variables for which both sides are defined. That's less restrictive than saying they are identical as functions. Simplify seems to take the less restrictive approach. $\endgroup$ – Michael E2 Apr 30 '17 at 16:44
  • $\begingroup$ Related: (65624), (66166), (89990) $\endgroup$ – Michael E2 Apr 30 '17 at 16:45
6
$\begingroup$

The Possible Issues section of the documentation for Simplify states: "The Wolfram Language evaluates zero times a symbolic expression to zero ... Because of this, results of simplification of expressions with singularities are uncertain."

For the case, n==0 you need to take the Limit

Limit[Sin[n Pi]/n, n -> 0]

(*  π  *)

A Plot shows that this Limit is consistent

Plot[Sin[n Pi]/n, {n, -3, 3}]

enter image description here

Alternatively,

Sin[n Pi]/n == Pi Sin[n Pi]/(n Pi) == Pi Sinc[n Pi] // FullSimplify

(*  True  *)

FullSimplify[Pi Sinc[n Pi], Element[n, Integers]]

(*  π KroneckerDelta[n]  *)

% // PiecewiseExpand

enter image description here

$\endgroup$
2
$\begingroup$

Reduce is usually careful, compared with Simplify or Solve. (Note that the desired result, here represented by ConditionalExpression, is not really "simpler" in the usual LeafCount/ Simplify`SimplifyCount sense used by Simplify.) One oddity is the mathematically redundant n == 0 in the condition Element[n, Integers] || n == 0 makes a difference: The case n == 0 is not overlooked as it is with just Element[n, Integers]. This is true for Simplify[Sin[n Pi]/n, Element[n, Integers] || n == 0], too, although it returns Sin[n Pi]/n.

Here is the result of Reduce, set up to work like Simplify:

x /. First@Solve[Reduce[(Element[n, Integers] || n == 0) && x == Sin[n Pi]/n], x]
(*  ConditionalExpression[0, (n ∈ Integers && n >= 1) || (n ∈ Integers && n <= -1)]  *)

Note it returns Undefined, as it should as a function of an integer variable, if 0 is subsituted for n:

% /. n -> 0
(*  Undefined  *)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.