Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #5860 > unrolled thread

Re: how do you prevent numerator expansion when using 'Together'?

Started byAlexei Boulbitch <Alexei.Boulbitch@iee.lu>
First post2011-10-25 10:16 +0000
Last post2011-10-26 21:43 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Re: how do you prevent numerator expansion when using 'Together'? Alexei Boulbitch <Alexei.Boulbitch@iee.lu> - 2011-10-25 10:16 +0000
    Re: how do you prevent numerator expansion when using 'Together'? Dushan Mitrovich <dushanm@nnips.net> - 2011-10-26 21:43 +0000

#5860 — Re: how do you prevent numerator expansion when using 'Together'?

FromAlexei Boulbitch <Alexei.Boulbitch@iee.lu>
Date2011-10-25 10:16 +0000
SubjectRe: how do you prevent numerator expansion when using 'Together'?
Message-ID<j862a7$5l5$1@smc.vnet.net>
Hi,
You also can try the following. Assume that you have your complex expression instead of this

expr = 1/(d*g)*(a*g + b*g + a*e + b*e + a*f + b*f)


(a e + b e + a f + b f + a g + b g)/(d g)

simple one.  The third part of it is the numerator:

expr[[3]]

a e + b e + a f + b f + a g + b g

This can be also seen by the TreeForm. Then let us factor it:

MapAt[Factor, expr, {3}]

((a + b) (e + f + g))/(d g)

I hope this helps.
Best, Alexei




DrMajorBob wrote:
> Factor[(a + b)/d + ((a + b)*(e + f))/(d*g)]
>
> ((a + b) (e + f + g))/(d g)
>
> Together[(a + b)/d + ((a + b)*(e + f))/(d*g)]
>
> ((a + b) (e + f + g))/(d g)
>
>
Yes, this simplified example does this on my system too, but the actual
expression I have behaves the way I described.  Your counter-example
indicates there must be something in my actual expression that causes
the behavior.  I'll experiment to see what that might be.  Thanks for
pointing this out.

- Dushan

> On Sat, 22 Oct 2011 05:07:37 -0500, Dushan Mitrovich <dushanm at nnips.net>
> wrote:
>
>> I'm using Mathematica 8.  When using 'Together' on an expression the
>> numerator
>> is always expanded, complicating the appearance of the final result:
>>
>>      In:  Together[ (a+b)/d + ((a+b)*(e+f))/(d*g) ]
>>      Out: 1/(d*g) * (a*g + b*g + a*e + b*e + a*f + b*f)
>>
>> Instead, I'd much prefer the simpler form
>>           1/(d*g) * (a+b)*(g+e+f)
>>
>> What do I need to do to get the latter form?  Thanks.
>>
>> - Dushan
>>    [ reverse the middle word of address to reply ]
>>
>
>

Alexei BOULBITCH, Dr., habil.
IEE S.A.
ZAE Weiergewan,
11, rue Edmond Reuter,
L-5326 Contern, LUXEMBOURG

Office phone :  +352-2454-2566
Office fax:       +352-2454-3566
mobile phone:  +49 151 52 40 66 44

[toc] | [next] | [standalone]


#5879

FromDushan Mitrovich <dushanm@nnips.net>
Date2011-10-26 21:43 +0000
Message-ID<j89utf$73$1@smc.vnet.net>
In reply to#5860
Alexei Boulbitch wrote:
> Hi,
> You also can try the following. Assume that you have your complex expression instead of this
>
> expr = 1/(d*g)*(a*g + b*g + a*e + b*e + a*f + b*f)
>
>
> (a e + b e + a f + b f + a g + b g)/(d g)
>
> simple one.  The third part of it is the numerator:
>
> expr[[3]]
>
> a e + b e + a f + b f + a g + b g
>
> This can be also seen by the TreeForm. Then let us factor it:
>
> MapAt[Factor, expr, {3}]
>
> ((a + b) (e + f + g))/(d g)
>
> I hope this helps.


Thanks, Alexei.  I'd never used 'MapAt' before, so this new tool (for 
me) is really helpful.

- Dushan
[ reverse middle word of address to reply ]

>
> DrMajorBob wrote:
>> Factor[(a + b)/d + ((a + b)*(e + f))/(d*g)]
>>
>> ((a + b) (e + f + g))/(d g)
>>
>> Together[(a + b)/d + ((a + b)*(e + f))/(d*g)]
>>
>> ((a + b) (e + f + g))/(d g)
>>
>>
> Yes, this simplified example does this on my system too, but the actual
> expression I have behaves the way I described.  Your counter-example
> indicates there must be something in my actual expression that causes
> the behavior.  I'll experiment to see what that might be.  Thanks for
> pointing this out.
>
> - Dushan
>
>> On Sat, 22 Oct 2011 05:07:37 -0500, Dushan Mitrovich<dushanm at nnips.net>
>> wrote:
>>
>>> I'm using Mathematica 8.  When using 'Together' on an expression the
>>> numerator
>>> is always expanded, complicating the appearance of the final result:
>>>
>>>       In:  Together[ (a+b)/d + ((a+b)*(e+f))/(d*g) ]
>>>       Out: 1/(d*g) * (a*g + b*g + a*e + b*e + a*f + b*f)
>>>
>>> Instead, I'd much prefer the simpler form
>>>            1/(d*g) * (a+b)*(g+e+f)
>>>
>>> What do I need to do to get the latter form?  Thanks.
>>>
>>> - Dushan
>>>     [ reverse the middle word of address to reply ]
>>>
>>
>>
>
> Alexei BOULBITCH, Dr., habil.
> IEE S.A.
> ZAE Weiergewan,
> 11, rue Edmond Reuter,
> L-5326 Contern, LUXEMBOURG
>
> Office phone :  +352-2454-2566
> Office fax:       +352-2454-3566
> mobile phone:  +49 151 52 40 66 44
>
>

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web