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


Groups > comp.soft-sys.math.mathematica > #11194

Re: Ordering an algebraic expression in Mathematica

From Bob Hanlon <hanlonr357@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Ordering an algebraic expression in Mathematica
Date 2012-08-04 10:01 +0000
Message-ID <jvirt2$2sk$1@smc.vnet.net> (permalink)
References <20120803081520.53D86681E@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


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@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
>

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: Ordering an algebraic expression in Mathematica Bob Hanlon <hanlonr357@gmail.com> - 2012-08-04 10:01 +0000

csiph-web