Re: Simplify and Abs
- To: mathgroup at smc.vnet.net
- Subject: [mg54678] Re: Simplify and Abs
- From: Peter Pein <petsie at arcor.de>
- Date: Fri, 25 Feb 2005 01:20:13 -0500 (EST)
- References: <cvk3fu$d6j$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Simon Anders wrote:
> Hi,
>
> can it really be that this is already beyond Mathematica?
>
> In := FullSimplify[Abs[p - 1], p < 1 && p > 1/2]
>
> Out := Abs[-1 + p]
>
> How do I make Matheamtica notice, that the assumptions constrain the
> argument of Abs[] to positive values?
>
> Any suggestions how to treat these kinds of problems? Specifically, I
> have a list of products of absolute values of simple polynomials in p
> and I know that p is in the interval [0,1].
>
> I would like to know whether the polynomials have constant sign over the
> interval so that the Abs[] can be removed. Can this be done automatically?
>
> TIA
> Simon
>
Hi Simon,
In[1]:=
TableForm[({#1, FullForm[#1]} & ) /@ {Abs[p - 1], 1 - p}]
Out[1]//TableForm=
Abs[-1 + p] Abs[Plus[-1, p]]
1 - p Plus[1, Times[-1, p]]
as the internal representation of 1-p is slightly more complicated, than
the one of Abs[p-1], FunctionExpand[Abs[p - 1], 1/2 < p < 1] is more
appropriate, than (Full)Simplify.
But you can lead Simplify[] to the desired result by means of the
option ComplexityFunction:
Simplify[Abs[p-1],1/2<p<1,
ComplexityFunction->(Count[#,Abs,Infinity,Heads->True]&)]
--
Peter Pein
Berlin