MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Ordering an algebraic expression in Mathematica


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
>



  • Prev by Date: Re: Mathematica as a New Approach to Teaching Maths
  • Next by Date: Re: Evaluation of boolean functions in Mathematica 8
  • Previous by thread: Ordering an algebraic expression in Mathematica
  • Next by thread: Re: Ordering an algebraic expression in Mathematica