       Re: Replacing spurious Abs

• To: mathgroup at smc.vnet.net
• Subject: [mg130858] Re: Replacing spurious Abs
• From: Bill Rowe <readnews at sbcglobal.net>
• Date: Tue, 21 May 2013 04:21:06 -0400 (EDT)
• Delivered-to: l-mathgroup@mail-archive0.wolfram.com
• Delivered-to: l-mathgroup@wolfram.com
• Delivered-to: mathgroup-outx@smc.vnet.net
• Delivered-to: mathgroup-newsendx@smc.vnet.net

```On 5/21/13 at 12:02 AM, carlos.felippa%colorado.edu at gtempaccount.com
wrote:

>Sometimes I get Abs[exp] from Simplify or Integrate, when it should
>be simply exp. Is there a simple way to get rid of the Abs, when exp
>may be an arbitrarily complex expression?  Something like
>/.Abs[#]->#?  Thanks.

In:= Abs[exp] /. Abs[a_] -> a

Out= exp

But keep in mind this is a literal syntax replacement which may
not be mathematically valid. That is you can do something like

In:= Sqrt /. Sqrt[a_] -> a

Out= 2

Turning Sqrt into 2 which is clearly not mathematically valid.

Another approach would be

In:= Assuming[exp > 0, Simplify@Abs[exp]]

Out= exp

which is a mathematically valid operation given the assumption
exp>0 is true. And this last can be done as:

In:= Abs[exp] // Assuming[exp > 0, Simplify@#] &

Out= exp

which is often handy

```

• Prev by Date: Can't get FindMinimum[] to quit using value specified by
• Next by Date: Re: Replacing spurious Abs
• Previous by thread: Re: Replacing spurious Abs
• Next by thread: NSolve Question