Re: Interesting failure of Collect

• To: mathgroup at smc.vnet.net
• Subject: [mg61349] Re: [mg61307] Interesting failure of Collect
• From: <bsyehuda at gmail.com>
• Date: Sun, 16 Oct 2005 00:18:03 -0400 (EDT)
• References: <200510150222.WAA17294@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Hi,
This is not a bug. You need to be aware how Mathematica stores expressions
internally. Many times it is not the same as we (humans) think of the
"right' representation.
For your problem use FullForm or TreeForm to observe that.
You will notice that the denominator of the second term in exprs involves -4
and not 4. "Human" may think that the (-) sign should be multiplying the
second subexpression by -1 while Mathematica stores it as I mentioned.
Try
Collect[expr2,Sin[p]/Pi] to see notice the difference.
yehuda

On 10/15/05, Blimbaum, Jerry CIV NSWC PC <jerry.blimbaum at navy.mil> wrote:
>
>
> Given the expr = Sin[p]/(4 Pi a) + Sin[p]/(4 Pi b)
>
> and then applying the command
>
>
> Collect[expr, Sin[p]/(4 Pi)] works as it should, however,
>
> expr2 = Sin[p]/(4 Pi a) - Sin[p]/(4 Pi b)
>
> leaves the expression untouched. (I realize I could use Simplify but
> this problem occurred on a much longer expression and this is intended
> just to convey the basic idea)....for longer expressions the Collect
> process works for all quantities with a + sign but the one with a minus
> sign will not be collected.....strikes me as a "bug".....
>
>
> thanks....jerry blimbaum
>
>
>

```

• Prev by Date: Function, Command, Operator, Object...etc.
• Next by Date: Re: Interesting failure of Collect
• Previous by thread: Re: Interesting failure of Collect
• Next by thread: Re: Interesting failure of Collect