Re: Ordering an algebraic expression in Mathematica

*To*: mathgroup at smc.vnet.net*Subject*: [mg127555] Re: Ordering an algebraic expression in Mathematica*From*: Bob Hanlon <hanlonr357 at gmail.com>*Date*: Sat, 4 Aug 2012 05:59:25 -0400 (EDT)*Delivered-to*: l-mathgroup@mail-archive0.wolfram.com*Delivered-to*: l-mathgroup@wolfram.com*Delivered-to*: mathgroup-newout@smc.vnet.net*Delivered-to*: mathgroup-newsend@smc.vnet.net*References*: <20120803081520.53D86681E@smc.vnet.net>

First, you must use the form b d or b*d rather than bd when multiplying factors. expr = (a x + b) (c x + d) + b d x + x^3*a + c (x^2 + x^3); Collect[expr, x] b d + (b c + a d + b d) x + (c + a c) x^2 + (a + c) x^3 or if your output format ( Mathematica | Preferences | Evaluation | Format type of new output cells: ) is not StandardForm Collect[expr, x] // StandardForm b d + (b c + a d + b d) x + (c + a c) x^2 + (a + c) x^3 Not literally what you asked for, but doing that would be significantly more involved. Bob Hanlon On Fri, Aug 3, 2012 at 4:15 AM, <mrafiee87 at gmail.com> wrote: > Hi to all, > > Would you please kindly let me know, how can one sort an algebraic expression in Mathematica? > for example > a, b, c, d are constants > x is the parameter for ordering > > expression: > (ax+b)(cx+d)+bdx+x^3*a+c(x^2+x^3) > > I wanna get the following results: > bd +x(bd+ad+bc)+x^2(c)+x^3(a+c) > > Thank you very much >

**References**:**Ordering an algebraic expression in Mathematica***From:*mrafiee87@gmail.com