MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Abs[a] Sin[Abs[a]]

  • To: mathgroup at
  • Subject: [mg20984] Re: [mg20923] Abs[a] Sin[Abs[a]]
  • From: Andrzej Kozlowski <andrzej at>
  • Date: Thu, 2 Dec 1999 21:41:02 -0500 (EST)
  • Sender: owner-wri-mathgroup at

Mathematica can only manage this under the assumption a>0.
Simplify[ Abs[a] Sin[Abs[a]], a > 0]
a Sin[a]

One problem is that Simplify does not know that Abs[a] is -a for negative a.

Simplify[Abs[a], a < 0]

In fact one would really like Simplify to manage more complicated cases
involving Abs, e.g.:

Simplify[Abs[Sin[a]], a < 0]

Just for fun I have decided to write a quick hack that will give the right
answer for these cases. One has to modify Simplify in two ways. Firstly, we
add the above missing rule for Abs. This alone however is not enough. The
second change is a general rule for Simplify[expr, Element[something,
Reals]]. This is a more drastic change to the way Simplify works now but at
the moment I can't see anything that would be broken by it. Here is my

Simplify[expr_, x_ < 0] :=
  Simplify[expr /. {Abs[x] :> -x, Abs[Sin[x]] :> -Sin[x]}]
Simplify[expr_, Element[x_, Reals]] :=
  If[(Simplify[expr, x > 0] ===
          Simplify[expr, x < 0]) && ((Simplify[expr, x > 0] /. x :> 0) ===
          Simplify[expr, x == 0]), Simplify[expr, x > 0], Simplify[expr]]
(Really we should also give rules for Simplify[expr_,{a___,x_<0,b___}] etc).

Now indeed we get:

Simplify[Abs[a], a < 0]

Simplify[Abs[Sin[a]], a < 0]

and finally:

Simplify[ Abs[a] *Sin[Abs[a]], Element[a, Reals]]
a Sin[a]

 Of course there is a large number of other non-polynomial functions which
are odd and about which Simplify doesn't know so one would like to add a
rule for Simplify[Abs[f[a]],a<0] for all of these. Even this however would
not work in more complicated cases where f was some non-polynomial non
built-in function. The problem is that Simplify relies on the ability to
solve inequalities, which can really only be done in the case of polynomial

> From: Edward Goldobin <gold at>
To: mathgroup at
> Organization: Research Center Juelich GmbH
> Date: Wed, 1 Dec 1999 01:49:54 -0500 (EST)
> To: mathgroup at
> Subject: [mg20984] [mg20923] Abs[a] Sin[Abs[a]]
> How to compell Mathematica to simplify
> Abs[a] Sin[Abs[a]]
> to
> a Sin[a]
> ?
> Why it does not do it automatically? I also tried
> assumptions like a :enum: Reals.
> Thanx
> Edward

  • Prev by Date: Re: Q: Dickman function
  • Next by Date: Re: Solving complex trigonometric equations
  • Previous by thread: Re: Abs[a] Sin[Abs[a]]
  • Next by thread: Re: Abs[a] Sin[Abs[a]]