5
$\begingroup$

I am using MMA V11.2 under Linux

I am surprised by this:

In: Simplify[Abs[Sin[x]],{x>0,x<Pi}]
Out: Sin[x]        <-- ok

In: Simplify[Abs[Sin[x]],Element[x,Interval[{0,Pi}]]]
Out: Abs[Sin[x]]   <-- not ok

Questions:

  1. is it the same for more recent versions of MMA?

  2. is it possible to get the right simplification using Element[x,Interval[{0,Pi}]]] (which has the advantage of using Region which is a more conceptual approach)?

$\endgroup$
  • 2
    $\begingroup$ I'm not entirely certain why the latter one does what it does, but Element treats Intervals as geometric regions, and members of those geometric regions are vectors, even when they are of single dimension. (I don't think this is really properly documented anywhere.) Changing the code to Simplify[Abs[Sin[x]], Element[{x}, Interval[{0, Pi}]]] gives the expected result. $\endgroup$ – kirma Sep 18 '18 at 13:55
  • 1
    $\begingroup$ Thanks! That makes sense. I have not thought about that. Maybe you can cut/copy this to an answer I will upvote :) $\endgroup$ – Picaud Vincent Sep 18 '18 at 14:03
  • 1
    $\begingroup$ Related earlier comment by me: mathematica.stackexchange.com/a/108678/3056 $\endgroup$ – kirma Sep 18 '18 at 14:03
  • $\begingroup$ Wrote a bit more about it now that I remembered extra details. $\endgroup$ – kirma Sep 18 '18 at 14:14
  • $\begingroup$ Thanks, I upvoted. $\endgroup$ – Picaud Vincent Sep 18 '18 at 14:15
4
$\begingroup$

Element treats Intervals as geometric regions, and members of those geometric regions are vectors, even when they are of single dimension. (I don't think this is really properly documented anywhere - I tried to look at documentation of both.)

The fact that there are two different interpretations of an Interval - the old, and the new bought by geometric regions functionality - and the fact they're inherently single-dimensional objects causes repeated confusion on this specific manner.

Changing the code to

Simplify[Abs[Sin[x]], Element[{x}, Interval[{0, Pi}]]]

gives the expected result:

Sin[x]

If you don't "list" x, it's actually interpreted as a symbolic vector, whose components you can refer with Indexed (and without which the symbolic vector probably doesn't make alone sense for Simplify as an argument to Sin) and the simplification works:

Simplify[Abs[Sin[Indexed[x, 1]]], Element[x, Interval[{0, Pi}]]]

Sin[Indexed[x, {1}]]

Sometimes symbolic vectors work even as arguments to functions (on a place of an explicit one), but I have never gotten a grasp when it is supposed to work, and when not. This seems very fragile, or awfully documented at least.

$\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.