MathGroup Archive 2003

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

Search the Archive

Re: Those Pesky Minus Signs

  • To: mathgroup at smc.vnet.net
  • Subject: [mg43302] Re: [mg43275] Those Pesky Minus Signs
  • From: Selwyn Hollis <selwynh at earthlink.net>
  • Date: Sun, 24 Aug 2003 04:54:58 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

David,

Here's a rule that may be useful:

pullMinus :=
HoldPattern[(c_.)*Plus[x:Times[_?Negative, _] ..] ] :>
    With[{r = Plus @@ {x}[[All,2]]}, HoldForm[-(c*r)]]

-1/2(a + b + c)

	1/2(-a - b - c)

% /. pullMinus

	-1/2(a + b + c)

-----
Selwyn Hollis
http://www.math.armstrong.edu/faculty/hollis


On Saturday, August 23, 2003, at 08:09  AM, David Park wrote:

> Dear MathGroup,
>
> How would one simplify
>
> (-1/2)(a + b + c)
> 1/2(-a - b - c)
>
> so the minus sign was in front? Why does it get pulled within in the 
> first
> place?
>
> David Park
> djmp at earthlink.net
> http://home.earthlink.net/~djmp/
>
>


  • Prev by Date: Re: Pick random element from list
  • Next by Date: RE: Pick random element from list
  • Previous by thread: Those Pesky Minus Signs
  • Next by thread: Re: Re: Those Pesky Minus Signs