Re: Why isn't Expand grouping terms by order?
- To: mathgroup at smc.vnet.net
- Subject: [mg87854] Re: Why isn't Expand grouping terms by order?
- From: Albert Retey <awnl at arcor.net>
- Date: Fri, 18 Apr 2008 07:12:06 -0400 (EDT)
- References: <firstname.lastname@example.org>
p at dirac.org wrote: > Consider this: > > In:= Expand[ (1+a*x)*(1+b*x), x] > > 2 > Out= 1 + a x + b x + a b x > > > How can I coax Mathematica to give me this, instead: > > 2 > Want= 1 + (a + b) x + a b x Collect[(1+a*x)*(1+b*x), x] > Why isn't Mathematica reporting the answer in terms of powers of x? When you ask mathematica to expand it expands, if you want it to collect, you need to tell it. It can't read your mind. hth, albert